paper
stringlengths
13.4k
699k
reviews
stringlengths
0
38.9k
# Aspest: Bridging The Gap Between Active Learning And Selective Prediction Jiefeng Chen∗*jiefeng@cs.wisc.edu* University of Wisconsin-Madison Jinsung Yoon jinsungyoon@google.com Google Sayna Ebrahimi *saynae@google.com* Google Sercan Ö. Arık soarik@google.com Google Somesh Jha jha@cs.wisc.edu University of Wisconsin-Madison Google Tomas Pfister tpfister@google.com Google Reviewed on OpenReview: *https: // openreview. net/ forum? id= 3nprbNR3HB* ## Abstract Selective prediction aims to learn a reliable model that abstains from making predictions when uncertain. These predictions can then be deferred to humans for further evaluation. As an everlasting challenge for machine learning, in many real-world scenarios, the distribution of test data is different from the training data. This results in more inaccurate predictions, and often increased dependence on humans, which can be difficult and expensive. Active learning aims to lower the overall labeling effort, and hence human dependence, by querying the most informative examples. Selective prediction and active learning have been approached from different angles, with the connection between them missing. In this work, we introduce a new learning paradigm, *active selective prediction*, which aims to query more informative samples from the shifted target domain while increasing accuracy and coverage. For this new paradigm, we propose a simple yet effective approach, ASPEST, that utilizes ensembles of model snapshots with self-training with their aggregated outputs as pseudo labels. Extensive experiments on numerous image, text and structured datasets, which suffer from domain shifts, demonstrate that ASPEST can significantly outperform prior work on selective prediction and active learning (e.g. on the MNIST→SVHN benchmark with the labeling budget of 100, ASPEST improves the AUACC metric from 79.36% to 88.84%) and achieves more optimal utilization of humans in the loop. ## 1 Introduction Deep Neural Networks (DNNs) have shown notable success in many applications that require complex understanding of input data (He et al., 2016a; Devlin et al., 2018; Hannun et al., 2014), including the ∗Work done during internship at Google. Our code is available at: https://github.com/google-research/google-research/tree/master/active_selective_ prediction. ones that involve high-stakes decision making (Yang, 2020). For safe deployment of DNNs in high-stakes applications, it is typically required to allow them to abstain from their predictions that are likely to be wrong, and ask humans for assistance (a task known as selective prediction) (El-Yaniv et al., 2010; Geifman & El-Yaniv, 2017). Although selective prediction can render the predictions more reliable, it does so at the cost of human interventions. For example, if a model achieves 80% accuracy on the test data, an ideal selective prediction algorithm should reject those 20% misclassified samples and send them to a human for review. ![1_image_0.png](1_image_0.png) Figure 1: Illustration of the distribution shift problem and the proposed *active selective prediction* solution. Under distribution shift, the model trained on the source training dataset will suffer a large performance degradation on the unlabeled test dataset. We propose to use active selective prediction to solve this problem, where active learning is used to improve selective prediction under distribution shift. The selective predictor shown in Fig. (b) is built upon the source-trained model depicted in Fig. (a). In this setting, active learning selects a small subset of data for labeling which are used to improve selective prediction on the remaining unlabeled test data. This yields more reliable predictions and more optimized use of humans in the loop. Distribution shift can significantly exacerbate the need for such human intervention. The success of DNNs often relies on the assumption that both training and test data are sampled independently and identically from the same distribution. In practice, this assumption may not hold and can degrade the performance on the test domain (Barbu et al., 2019; Koh et al., 2021). For example, for satellite imaging applications, images taken in different years can vary drastically due to weather, light, and climate conditions (Koh et al., 2021). Existing selective prediction methods usually rely on model confidence to reject inputs (Geifman & El-Yaniv, 2017). However, it has been observed that model confidence can be poorly calibrated, especially with distribution shifts (Ovadia et al., 2019). The selective classifier might end up accepting many misclassified test inputs, making the predictions unreliable. Thus, selective prediction might yield an accuracy below the desired target performance, or obtain a low coverage, necessitating significant human intervention. To improve the performance of selective prediction, one idea is to rely on active learning and to have humans label a small subset of selected test data. The correct labels provided by humans can then be used to improve the accuracy and coverage (see Sec. 3.2) of selective prediction on the remaining unlabeled test data, thus reducing the need for subsequent human labeling efforts. In separate forms, selective prediction (Geifman & El-Yaniv, 2017; 2019) and active learning (Settles, 2009) have been studied extensively, however, to the best of our knowledge, this paper is first to propose performing active learning to improve selective prediction jointly, with the focus on the major real-world challenge of distribution shifts. Active domain adaptation (Su et al., 2020; Fu et al., 2021; Prabhu et al., 2021) is one area close to this setting, however, it does not consider selective prediction. In selective prediction, not only does a classifier need to be learned, but a selection scoring function also needs to be constructed for rejecting misclassified inputs. Thus, going beyond conventional active learning methods that focus on selecting examples for labeling to improve the accuracy, | Machine Learning Paradigm Accuracy Coverage Acquisition Function | Selectivity | Adapt f | Adapt g | Target Metric | | | | |--------------------------------------------------------------------|---------------|-----------|------------|------------------------------------------------|----|----|-------------------------------------| | Selective Prediction | High | Low | None | If g(x) ≥ τ , output f(x); otherwise, output ⊥ | ✗ | ✗ | cov|acc ≥ ta, acc|cov ≥ tc or AUACC | | Active Learning | Medium | 100% | a(B, f) | Always output f(x) | ✓ | ✗ | acc | | Active Selective Prediction | High | High | a(B, f, g) | If g(x) ≥ τ , output f(x); otherwise, output ⊥ | ✓ | ✓ | cov|acc ≥ ta, acc|cov ≥ tc or AUACC | Table 1: Comparing different machine learning paradigms. With distribution shift and a small labeling budget, active learning can achieve 100% coverage (predictions on all test data), but it fails to achieve the target accuracy. Selective prediction can achieve the target accuracy, but the coverage is low, which results in significant human intervention. Active selective prediction achieves the target accuracy with much higher coverage, significantly reducing human labeling effort. B: selected batch for labeling. f: classifier and g: selection scoring function. acc: accuracy and cov: coverage. we propose to also use those selected labeled examples to improve the selection scoring function. The optimal acquisition function (used to select examples for labeling) for this new setting is different compared to those in traditional active learning - e.g. if a confidence-based selection scoring function is employed, the selected labeled samples should have the goal of improving the estimation of that confidence score. In this paper, we introduce a new machine learning paradigm: active selective prediction under distribution shift (see Fig. 1), which combines selective prediction and active learning to improve accuracy and coverage, and hence use human labeling in a more efficient way. Table 1 shows the differences among selective prediction, active learning and active selective prediction. Active selective prediction is highly important for most real-world deployment scenarios (e.g., the batch prediction scenario where users give a batch of test inputs potentially with distribution shifts, and request predictions from a deployed pre-trained model). To the best of our knowledge, we are the first to formulate and investigate this problem, along with the judiciously chosen evaluation metrics for it (Sec. 3). We also introduce a novel and simple yet effective method, ASPEST, for this active selective prediction problem (Sec. 4). The key components of ASPEST, checkpoint ensembling and self-training, are designed to address the key challenge (i.e., the overconfidence issue) in the active selective prediction problem. On numerous real-world datasets, we show that ASPEST consistently outperforms other baselines proposed for active learning and selective prediction (Sec. 5). ## 2 Related Work Selective prediction (also known as prediction with rejection/deferral options) constitutes a common deployment scenario for DNNs, especially in high-stakes decision making scenarios. In selective prediction, models abstain from yielding outputs if their confidence on the likelihood of correctness is not sufficiently high. Such abstinence usually incurs deferrals to humans and results in additional cost (Mozannar & Sontag, 2020). Increasing the coverage - the ratio of the samples for which the DNN outputs can be reliable - is the fundamental goal (El-Yaniv et al., 2010; Fumera & Roli, 2002; Hellman, 1970; Geifman & El-Yaniv, 2019). Geifman & El-Yaniv (2017) considers selective prediction for DNNs with the 'Softmax Response' method, which applies a carefully selected threshold on the maximal response of the softmax layer to construct the selective classifier. Lakshminarayanan et al. (2017) shows that using deep ensembles can improve predictive uncertainty estimates and thus improve selective prediction. Rabanser et al. (2022) proposes a novel method, NNTD, for selective prediction that utilizes DNN training dynamics by using checkpoints during training. Our proposed method ASPEST also uses checkpoints to construct ensembles for selective prediction. In contrast to NNTD and other aforementioned methods, we combine selective prediction with active learning to improve its data efficiency while considering a holistic perspective of having humans in the loop. This new active selective prediction setup warrants new methods for selective prediction along with active learning. Active learning employs acquisition functions to select unlabeled examples for labeling, and uses these labeled examples to train models to utilize the human labeling budget more effectively while training DNNs (Settles, 2009; Dasgupta, 2011). Commonly-used active learning methods employ acquisition functions by considering uncertainty (Gal et al., 2017; Ducoffe & Precioso, 2018; Beluch et al., 2018) or diversity (Sener & Savarese, 2017; Sinha et al., 2019), or their combination (Ash et al., 2019; Huang et al., 2010). One core challenge for active learning is the "cold start" problem: often the improvement obtained from active learning is less significant when the amount of labeled data is significantly smaller (Yuan et al., 2020; Hacohen et al., 2022). Moreover, active learning can be particularly challenging under distribution shift (Kirsch et al., 2021; Zhao et al., 2021). Recently, active domain adaptation has been studied, where domain adaptation is combined with active learning (Su et al., 2020; Fu et al., 2021; Prabhu et al., 2021). Different from traditional active learning, active domain adaptation typically adapts a model pre-trained on the labeled source domain to the unlabeled target domain. In our work, we also try to adapt a source trained model to the unlabeled target test set using active learning, while focusing on building a selective classification model and reducing the human labeling effort. More related work are discussed in Appendix A. ## 3 Active Selective Prediction In this section, we first formulate the active selective prediction problem and then present the proposed evaluation metrics to quantify the efficacy of the methods. ## 3.1 Problem Setup Let X be the input space and Y = {1, 2*, . . . , K*} the label space.1 The training data distribution is given as PX,Y and the test data distribution is QX,Y (both are defined in the space *X × Y*). There might exist distribution shifts such as covariate shifts (i.e., QX,Y might be different from PX,Y ). Suppose for each input x, an oracle (e.g., the human annotator) can assign a ground-truth class label yx to it. Given a classifier ¯f : *X → Y* trained on a source training dataset Dtr ∼ PX,Y (∼ means "sampled from"), and an unlabeled target test dataset UX = {x1, . . . , xn} ∼ QX, our goal is to employ ¯f to yield reliable predictions on UX in a human-in-the-loop scenario. Holistically, we consider the two approaches to involve humans via the predictions they provide on the data: (i) selective prediction where uncertain predictions are deferred to humans to maintain a certain accuracy target; and (ii) active learning where a subset of UX unlabeled samples are selected for humans to improve the model with the extra labeled data to be used at the subsequent iterations. The concept of active selective prediction emerges from the potential synergistic optimization of these two approaches. By judiciously integrating active learning and selective prediction, we aim to minimize the demand for human labeling resources. Active learning in this context is tailored to select a minimal yet impactful set of samples for labeling, which in turn informs the development of a highly accurate selective predictor. This predictor effectively rejects misclassified samples, deferring them for human evaluation. As a result of this optimal integration, the number of samples requiring human intervention is significantly reduced, thereby enhancing the overall efficiency and resource utilization. Since these two approaches to involve humans have different objectives, their joint optimization to best use the human labeling resources is not straightforward. As an extension of the classifier f (initialized by ¯f), we propose to employ a selective classifier fs including a selection scoring function g : X → R to yield reliable predictions on UX. We define the predicted probability of the model f on the k-th class as f(x | k). Then, the classifier is f(x) = arg maxk∈Y f(x | k). g can be based on statistical operations on the outputs of f (e.g., g(x) = maxk∈Y f(x | k)). With f and g, the selective prediction model fs is defined as: $$f_{s}(\mathbf{x};\tau)={\begin{cases}f(\mathbf{x})&{\mathrm{if~}}g(\mathbf{x})\geq\tau,\\ \bot&{\mathrm{if~}}g(\mathbf{x})<\tau\end{cases}},$$ where τ is a threshold. If fs(x) = ⊥, then the DNN system would defer the predictions to a human in the loop. To improve the overall accuracy to reach the target, such deferrals require manual labeling. To reduce the human labeling cost and improve the accuracy of the selective classifier, we consider labeling a small subset of UX and adapt the selective classifier fs on the labeled subset via active learning. The goal is to significantly improve the accuracy and coverage of the selective classifier fs and thus reduce the total human labeling effort. Suppose the labeling budget for active learning is M (i.e., M examples from UX are selected to be labeled by humans). We assume that humans in the loop can provide correct labels. For active learning, we consider 1In this paper, we focus on the classification problem, although it can be extended to the regression problem. $\quad(1)$ . the transductive learning paradigm (Vapnik, 1998), which assumes all training and test data are observed beforehand and we can make use of the unlabeled test data for learning. Specifically, the active learning is performed on UX to build the selective classifier fs, with performance evaluation of fs only on UX. We adapt the source-trained classifier ¯f to obtain fs instead of training fs from scratch to maintain feasibly-low computational cost. Let's first consider the single-round setting. Suppose the acquisition function is a : X m *× F × G →* R, where m ∈ N +, F is the classifier space and G is the selection scoring function space. This acquisition function is different from the one used in traditional active learning (Gal et al., 2017) since traditional active learning doesn't have the goal of improving g. In the beginning, f is initialized by ¯f. We then select a batch B∗for labeling by solving the following objective: $$B^{*}=\arg\operatorname*{max}_{B\subset U_{X},|B|=M}a(B,f,g),$$ $$\left(2\right)$$ a(*B, f, g*), (2) for which the labels are obtained to get B˜∗. Then, we use B˜∗to update f and g (e.g., via fine-tuning). The above can be extended to a multi-round setting. Suppose we have T rounds and the labeling budget for each round is m = [M T ]. In the beginning, f0 is initialized by ¯f. At the t-th round, we first select a batch B∗ t for labeling by solving the following objective: $$B_{t}^{*}=\arg\max_{B\subset U_{X}\setminus(U_{t=1}^{t=1}B_{t}^{*}),|B|=m}a(B,f_{t-1},g_{t-1}),\tag{3}$$ for which the labels are obtained to get B˜∗ t . Then we use B˜∗ t to update ft−1 and gt−1 to get ft and gt (e.g., via fine-tuning the model on B˜∗ t ). With multiple-rounds setting, we define B∗ = ∪ T i=1B∗ i . ## 3.2 Evaluation Metrics To quantify the efficacy of the methods that optimize human-in-the-loop adaptation and decision making performance, appropriate metrics are needed. The performance of the selective classifier fs (defined in Eq. (1)) on UX is evaluated by the accuracy and coverage metrics, which are defined as: $$a c c(f_{s},\tau)={\frac{\mathbb{E}_{\mathbf{x}\sim U_{X}}\mathbb{I}[f(\mathbf{x})=y_{x}\wedge g(\mathbf{x})\geq\tau\wedge\mathbf{x}\not\in B^{*}]}{\mathbb{E}_{\mathbf{x}\sim U_{X}}\mathbb{I}[g(\mathbf{x})\geq\tau\wedge\mathbf{x}\not\in B^{*}]}}$$ $$\left(4\right)$$ $$\left(5\right)$$ $$cov(f_{s},\tau)={\frac{\mathbb{E}_{\mathbf{x}\sim U_{X}}\mathbb{I}[g(\mathbf{x})\geq\tau\wedge\mathbf{x}\not\in B^{*}]}{\mathbb{E}_{\mathbf{x}\sim U_{X}}\mathbb{I}[\mathbf{x}\not\in B^{*}]}}$$ We can tune the threshold τ to achieve a certain coverage. There could be an accuracy-coverage trade-off – as we increase coverage, the accuracy could be lower. We consider the following metrics that are agnostic to the threshold τ : (1) maximum accuracy at a target coverage denoted as acc|cov ≥ tc; (2) maximum coverage at a target accuracy denoted as cov|acc ≥ ta; (3) Area Under Accuracy-Coverage Curve denoted as AUACC. The definitions of these metrics are given in Appendix B. The target coverage tc is tailored to each dataset, acknowledging the varying levels of difficulty inherent to different datasets. Similar to tc, the target accuracy ta is set according to the dataset's complexity. For more challenging datasets, where achieving high accuracy is difficult, lower target accuracy thresholds are set. Conversely, for datasets where models typically achieve higher accuracy, more stringent accuracy targets are established. By adapting the target accuracy and coverage thresholds to the dataset-specific challenges, we ensure that our evaluation is both rigorous and relevant to each dataset's context. Additionally, we employ the AUACC metric as our primary metric for comparative analysis. This choice is strategic, as it helps standardize our evaluations across a variety of datasets and addresses potential inconsistencies that might arise from solely relying on threshold-based metrics. ## 3.3 Challenges For active selective prediction, we want to utilize active learning to improve the coverage and accuracy of the selective classifier fs, that consists of a classifier f and a selection scoring function g. In contrast to ![5_image_0.png](5_image_0.png) (a) Sample selection based on uncertainty (b) Sample selection based on diversity Figure 2: Illustration of the challenges in active selective prediction using a linear model to maximize the margin (distance to the decision boundary) for binary classification. We consider a single-round active learning setup, without the inclusion of already labeled data. The current decision boundary is derived from labeled source training data. Since we focus on assessing performance with respect to the unlabeled test data, where our evaluation metrics are applied, we omit source training data from this illustration. The model confidence is considered to be proportional to the margin (when the margin is larger, the confidence is higher and vice versa). Fig. (a) shows if the samples close to the current decision boundary are selected for labeling (uncertainty-based sample selection), then the adapted model suffers from the overconfidence issue (mis-classification with high confidence), which results in acceptance of some mis-classified points. Fig. (b) shows if diverse samples are selected for labeling (e.g., using the k-Center-Greedy algorithm (Sener & Savarese, 2017)), then the adapted model suffers from low accuracy. This leads to rejection of many points, necessitating significant human intervention. conventional active learning, which only aims to improve the accuracy of f, active selective prediction also aims to improve g so that it can accept those examples where f predicts correctly and reject those where f predicts incorrectly. Especially with distribution shift and a small labeling budget M, it can be challenging to train f for high accuracy. Therefore, g is critical in achieving high coverage and accuracy of fs, for which we consider the confidence of f (i.e., the maximum softmax score of f) and train f such that its confidence can be used to distinguish correct and incorrect predictions. This might not be achieved easily since it has been observed that f can have overconfident predictions especially under distribution shift (Goodfellow et al., 2014; Hein et al., 2019). Besides, for active learning, typically we select samples for labeling based on uncertainty or diversity. However, in active selective prediction, sample selection based on uncertainty may lead to overconfidence and sample selection based on diversity may lead to low accuracy of f, as illustrated in Fig. 2. Our experiments in Appendix F.2 show that these issues indeed exist - the methods based on uncertainty sampling (e.g., SR+Margin) achieve relatively high accuracy, but suffer from the overconfidence issue, while the methods based on diversity sampling (e.g. SR+kCG) don't have the overconfidence issue, but suffer from low accuracy of f. Moreover, the hybrid methods based on uncertainty and diversity sampling (SR+CLUE and SR+BADGE) still suffer from the overconfidence issue. To tackle these, we propose a novel method, ASPEST, described next. ## 4 Proposed Method: Aspest We propose a novel method Active Selective Prediction using Ensembles and Self-training (ASPEST), which utilizes two key techniques, checkpoint ensembles and self-training, to solve the active selective prediction problem. The key constituents, checkpoint ensembles and self-training, are designed to tackle the fundamental challenges in active selective prediction, with the ideas of selecting samples for labeling based on uncertainty to achieve high accuracy and using checkpoint ensembles and self-training to alleviate overconfidence. We empirically analyze why they can tackle the challenges in Section 5.3. In Appendix D, we analyze the complexity of the ASPEST algorithm. We first describe how the weights from the intermediate checkpoints during training are used to construct the checkpoint ensemble. Since we have all the test inputs, we don't need to save the checkpoints during training, but just record their outputs on the test set UX. Specifically, we use a n× K matrix P (recall that n = |UX| and K is the number of classes) to record the average of the softmax outputs of the checkpoint ensemble and use Ne to record the number of checkpoints in the current checkpoint ensemble. During training, we get a stream of checkpoints (assuming no two checkpoints arrive at the same time), and for each incoming checkpoint f, we update P and Ne as: $$P_{i,k}\gets\frac{1}{N_{e}+1}(P_{i,k}\cdot N_{e}+f({\bf x}_{i}\mid k))\quad\mbox{for$1\leq i\leq n$and$1\leq k\leq K$},\quad N_{e}\gets N_{e}+1.\tag{6}$$ Since it has been observed that an ensemble of DNNs (known as "deep ensembles") usually produces a confidence score that is better calibrated compared to a single DNN (Lakshminarayanan et al., 2017), we consider f to be in the form of deep ensembles and g to be the confidence of the ensemble. Specifically, we continue fine-tuning N models independently via Stochastic Gradient Descent (SGD) with different random seeds (e.g., the randomness can come from different random orders of training batches). At the beginning, we set each model f j 0 = ¯f (j = 1*, . . . , N*), and set Ne = 0 and P = 0n×K. Here, we initialize each model f j 0 with the source-trained classifier ¯f instead of random initialization, to minimize the computational cost. We fine-tune each model f j 0 on Dtr for ns steps via SGD using the following training objective: minθ j E(x,y)∈Dtr `CE(x, y; θ j), where `CE is the cross-entropy loss and θ jis the model parameters of f j 0 . For every cs steps when training each f j 0 , we update P and Ne using Eq (6) with the checkpoint model f j 0 . After constructing the initial checkpoint ensemble, we perform a T-round active learning process. In each round of active learning, we first select samples for labeling based on the margin of the checkpoint ensemble, then fine-tune the models on the selected labeled test data, and finally perform self-training. We describe the procedure below: Sample selection. In the t-th round, we select a batch Bt with a size of m = [M T ] from UX via: $$B_{t}=\arg\max_{B\subset U_{X}\setminus(\cup_{t=0}^{t-1}B_{t}),|B|=m}-\sum_{\mathbf{x}_{i}\in B}S(\mathbf{x}_{i})\tag{1}$$ $$\left(7\right)$$ where B0 = ∅, S(xi) = Pi,yˆ − maxk∈Y\{yˆ} Pi,k and yˆ = arg maxk∈Y Pi,k. We use an oracle to assign groundtruth labels to the examples in Bt to get B˜t. Here, we select the test samples for labeling based on the margin of the checkpoint ensemble. The test samples with lower margin should be closer to the decision boundary and they are data points where the ensemble is uncertain about its predictions. Training on those data points can either make the predictions of the ensemble more accurate or make the ensemble have higher confidence on its correct predictions. Fine-tuning. After the sample selection, we reset Ne and P as Ne = 0 and P = 0n×K, because we want to remove those checkpoints in the previous rounds with worse performance from the checkpoint ensemble (experiments in Appendix F.9 show that after each round of active learning, the accuracy of the ensemble will significantly improve). We then fine-tune each model f j t−1 (j = 1*, . . . , N*) independently via SGD with different randomness on the selected labeled test data to get f j t using the following training objective: $$\min_{\theta^{j}}\quad\mathbb{E}_{(\mathbf{x},y)\in\cup_{i=1}^{f}B_{i}}\quad\ell_{CE}(\mathbf{x},y;\theta^{j})+\lambda:\mathbb{E}_{(\mathbf{x},y)\in\mathcal{D}^{\text{tr}}}\quad\ell_{CE}(\mathbf{x},y;\theta^{j}),\tag{8}$$ where θ jis the model parameters of f j t−1 and λ is a hyper-parameter. Note that here we use joint training on Dtr and ∪ t l=1B˜l to avoid over-fitting to the small set of labeled test data and prevent the models from forgetting the source training knowledge (see the results in Appendix F.5 for the effect of using joint training and the effect of λ). For every ce epoch when fine-tuning each model f j t−1 , we update P and Ne using Eq. (6) with the checkpoint model f j t−1 . Self-training. After fine-tuning the models on the selected labeled test data and with the checkpoint ensemble, we construct a pseudo-labeled set R via: $$R=\{(\mathbf{x}_{i},[P_{i,1},\cdots,P_{i,K}])\mid\mathbf{x}_{i}\in U_{X}\land(\eta\leq\operatorname*{max}_{k\in\mathcal{Y}}P_{i,k}<1)\},$$ $$({\mathfrak{g}})$$ Pi,k < 1)}, (9) where maxk∈Y Pi,k is the confidence of the checkpoint ensemble on xi and η is a threshold (refer to Section 5.2 for the effect of η). We do not add those test data points with confidence equal to 1 into the pseudo-labeled set because training on those data points cannot change the models much and may even hurt the performance (refer to Appendix F.8 for the justification of such a design). We then perform self-training on the pseudolabeled set R. For computational efficiency, we only apply self-training on a subset of R. We construct the subset Rsub by randomly sampling up to [p · n] data points from R, where p ∈ [0, 1]. We train each model f j t (j = 1*, . . . , N*) further on the pseudo-labeled subset Rsub via SGD using the following training objective: $$\operatorname*{min}_{\theta^{j}}\quad\operatorname{\mathbb{E}}_{(\mathbf{x},\mathbf{y})\in R_{\mathrm{sub}}}\quad\ell_{K L}(\mathbf{x},\mathbf{y};\theta^{j})+\lambda\cdot\operatorname{\mathbb{E}}_{(\mathbf{x},\mathbf{y})\in\mathcal{D}^{\mathrm{tr}}}\quad\ell_{C E}(\mathbf{x},y;\theta^{j})$$ $$(10)$$ j) (10) where `KL is the KL-Divergence loss, which is defined as: `KL(x, y; θ) = PK k=1 yk · log( yk f(x|k;θ) ). We use the KL-Divergence loss with soft pseudo-labels to alleviate the overconfidence issue since the predicted labels might be wrong and training the models on those misclassified pseudo-labeled data using the typical cross entropy loss will cause the overconfidence issue, which hurts selective prediction performance. For every ce epoch of self-training each model f j t , we will update P and Ne using Eq (6) with the checkpoint model f j t . We add checkpoints during self-training into checkpoint ensemble to improve the sample selection in the next round of active learning. After T rounds active learning, we use the checkpoint ensemble as the final selective classifier: the classifier f(xi) = arg maxk∈Y Pi,k and the selection scoring function g(xi) = maxk∈Y Pi,k. ## 5 Experiments This section presents experimental results, especially focusing on the following questions: (Q1) Can we use a small labeling budget to significantly improve selective prediction performance under distribution shift? (Q2) Does the proposed ASPEST outperform baselines across different datasets with distribution shift? (Q3) What is the effect of checkpoint ensembles and self-training in ASPEST? ## 5.1 Setup Datasets. To demonstrate the practical applicability of active selective prediction, we conduct experiments not only on synthetic data but also on diverse real-world datasets, where distribution shifts are inherent and not artificially constructed. Specifically, we use the following datasets with distribution shift: (i) MNIST→SVHN (LeCun, 1998; Netzer et al., 2011), (ii) CIFAR-10→CINIC-10 (Krizhevsky et al., 2009; Darlow et al., 2018), (iii) FMoW (Koh et al., 2021), (iv) Amazon Review (Koh et al., 2021), (v) DomainNet (Peng et al., 2019) and (vi) Otto (Benjamin Bossan, 2015). Details of the datasets are described in Appendix E.2. Model architectures and source training. On MNIST→SVHN, we use CNN (LeCun et al., 1989). On CIFAR-10→CINIC-10, we use ResNet-20 (He et al., 2016b). On the FMoW dataset, we use DensetNet121 (Huang et al., 2017b). On Amazon Review, we use the pre-trained RoBERTa (Liu et al., 2019). On the DomainNet dataset, we use ResNet-50 (He et al., 2016a). On the Otto dataset, we use a multilayer perceptron. On each dataset, we train the models on the training set Dtr. More details on model architectures and training on source data are presented in Appendix E.3. Active learning hyper-parameters. We evaluate different methods with different labeling budget M values on each dataset. By default, we set the number of rounds T = 10 for all methods (Appendix F.6 presents the effect of T). During the active learning process, we fine-tune the model on the selected labeled test data. During fine-tuning, we don't apply any data augmentation to the test data. We use the same finetuning hyper-parameters for different methods to ensure a fair comparison. More details on the fine-tuning hyper-parameters can be found in Appendix E.4. Baselines. We consider Softmax Response (SR) (Geifman & El-Yaniv, 2017) and Deep Ensembles (DE) (Lakshminarayanan et al., 2017) with various active learning sampling methods as the baselines. SR+Uniform means combining SR with an acquisition function based on uniform sampling (similarly for DE and other acquisition functions). We consider sampling methods from both traditional active learning (e.g., BADGE (Ash et al., 2019)) and active domain adaptation (e.g., CLUE (Prabhu et al., 2021)). Appendix C further describes the details of the baselines. Hyper-parameters of ASPEST. Table 2 comprehensively lists all the hyperparameters used in ASPEST, along with their respective default values. We set λ = 1, ns = 1000 and N = 5 (see Appendix F.7 for the effect of N), which are the same as those for Deep Ensembles, for fair comparisons. For all datasets, we use cs = 200, p = 0.1, η = 0.9, the number of self-training epochs to be 20 and ce = 5. It is important to note that the majority of these hyperparameters are general training parameters, and as such, they would not significantly benefit from per-dataset tuning. This significantly reduces the complexity and the need for extensive validation datasets. Specifically, for hyperparameters ns, cs, ce, and p, we employ fixed values based on empirical evidence, thus eliminating the need for their adjustment across different datasets. For other hyperparameters λ, N, T, and η, we perform tuning based on the performance observed on a validation dataset (i.e., DomainNet R→I). Once tuned, these values are kept consistent across all other datasets. This approach mirrors real-world scenarios where practitioners often rely on a single, representative validation dataset to tune key hyperparameters before applying the model to various datasets. | Hyper-parameter | Notation | Default value | |----------------------------------------------------------------------------------------|------------|-----------------| | Trade-off parameter to balance the source and target losses in the training objectives | λ | 1 | | The number of training steps in the initial fine-tuning | ns | 1000 | | Number of models in the ensemble | N | 5 | | Number of rounds in active learning | T | 10 | | The step interval to update the checkpoint ensemble in the initial fine-tuning | cs | 200 | | The epoch interval to update the checkpoint ensemble | ce | 5 | | The fraction to subsample the pseudo-labeled set | p | 0.1 | | The threshold used to construct the pseudo-labeled set | η | 0.9 | | Method | cov∗ |acc ≥ 90% ↑ | Accuracy of f ↑ | | |-----------------------------|---------------------|-------------------|-----------| | Selective Prediction | SR (M=0) | 0.08±0.0 | 24.68±0.0 | | DE (M=0) | 0.12±0.1 | 26.87±0.8 | | | Margin (M=1K) | N/A | 82.26±0.3 | | | kCG (M=1K) | N/A | 59.98±4.6 | | | Active Learning | CLUE (M=1K) | N/A | 81.65±0.3 | | BADGE (M=1K) | N/A | 82.11±0.8 | | | Active Selective Prediction | ASPEST (M=1K) | 94.91±0.4 | 89.20±0.3 | Table 2: The hyperparameters used in the proposed method ASPEST. ## 5.2 Results Table 3: Results on MNIST→SVHN to describe the effect of combining selective prediction with active learning. The mean and std of each metric over three random runs are reported (mean±std). cov∗is defined in Appendix F.4. All numbers are percentages. **Bold** numbers are superior results. Impacts of combining selective prediction with active learning. We evaluate the accuracy of the source trained models on the test set UX of different datasets. The results in Appendix F.1 show that the models trained on the source training set Dtr suffer a performance drop on the target test set UX, and sometimes this drop can be large. For example, the model trained on MNIST has a source test accuracy of 99.40%. However, its accuracy on the target test set UX from SVHN is only 24.68%. If we directly build a selective classifier on top of the source trained model, then to achieve a target accuracy of 90%, the coverage would be at most 27.42%. In Table 3, we demonstrate that for a target accuracy of 90%, the coverage achieved by the selective prediction baselines SR and DE is very low (nearly 0%). It means that almost all test examples need human intervention or labeling. This is a large cost since the test set of SVHN contains over 26K images. The results in Table 3 also show that the active learning baselines Margin, kCG, CLUE and BADGE fail to achieve the target accuracy of 90% with a labeling budget of 1K. However, by combining selective prediction with active learning with the proposed method ASPEST, we only need to label 1K test examples to achieve a target accuracy of 90% with a coverage of 94.91%. Thus, during active learning and selective prediction processes, only 5.09% test examples from SVHN need to be labeled by a human to achieve the target accuracy of 90%, resulting in a significant reduction of the overall human labeling cost. Similar results are observed for other datasets (see Appendix F.4). | Dataset | DomainNet R→C (easy) | Amazon Review | Otto | | | | |---------------|------------------------|-----------------|-----------------|-----------|-----------------|-----------| | Metric | cov|acc ≥ 80% ↑ | AUACC ↑ | cov|acc ≥ 80% ↑ | AUACC ↑ | cov|acc ≥ 80% ↑ | AUACC ↑ | | SR+Uniform | 25.56±0.6 | 63.31±0.4 | 13.71±11.3 | 72.71±1.5 | 63.58±0.7 | 84.46±0.2 | | SR+Confidence | 25.96±0.2 | 64.20±0.6 | 11.28±8.9 | 72.89±0.7 | 69.63±1.7 | 85.91±0.3 | | SR+Entropy | 25.44±1.0 | 63.52±0.6 | 5.55±7.8 | 71.96±1.6 | 67.79±0.8 | 85.41±0.3 | | SR+Margin | 26.28±1.2 | 64.37±0.8 | 14.48±10.9 | 73.25±1.0 | 68.10±0.1 | 85.56±0.1 | | SR+kCG | 21.12±0.3 | 58.88±0.0 | 20.02±11.0 | 72.34±3.2 | 64.84±0.7 | 85.08±0.2 | | SR+CLUE | 27.17±0.8 | 64.38±0.6 | 4.15±5.9 | 73.43±0.4 | 68.21±1.2 | 85.82±0.3 | | SR+BADGE | 27.78±0.8 | 64.90±0.5 | 22.58±0.4 | 73.80±0.6 | 67.23±1.0 | 85.41±0.3 | | DE+Uniform | 30.82±0.8 | 67.60±0.4 | 34.35±1.4 | 76.20±0.3 | 70.74±0.5 | 86.78±0.1 | | DE+Entropy | 29.13±0.9 | 67.48±0.3 | 31.74±1.4 | 75.98±0.4 | 75.71±0.3 | 87.87±0.1 | | DE+Confidence | 29.90±0.8 | 67.45±0.3 | 35.12±1.8 | 76.63±0.2 | 75.52±0.2 | 87.84±0.1 | | DE+Margin | 31.82±1.3 | 68.85±0.4 | 33.42±1.3 | 76.18±0.2 | 75.49±0.8 | 87.89±0.2 | | DE+Avg-KLD | 32.23±0.2 | 68.73±0.2 | 33.03±1.5 | 76.21±0.4 | 75.91±0.2 | 87.89±0.0 | | DE+CLUE | 30.80±0.3 | 67.82±0.2 | 33.92±3.0 | 76.27±0.6 | 69.66±0.5 | 86.67±0.1 | | DE+BADGE | 30.16±1.3 | 68.46±0.3 | 32.23±3.7 | 76.13±0.7 | 73.23±0.2 | 87.55±0.1 | | ASPEST (ours) | 37.38±0.1 | 71.61±0.2 | 38.44±0.7 | 77.69±0.1 | 77.85±0.2 | 88.28±0.1 | Table 4: Results of comparing ASPEST to the baselines on DomainNet R→C, Amazon Review and Otto. The mean and std of each metric over three random runs are reported (mean±std). The labeling budget M is 500. All numbers are percentages. **Bold** numbers are superior results. Baseline comparisons. We compare ASPEST with two existing selective prediction methods: SR and DE with various active learning methods. The results in Table 4 (complete results on all datasets for all metrics and different labeling budgets are provided in Appendix F.3) show that ASPEST consistently outperforms the baselines across different image, text and tabular datasets. For example, for MNIST→SVHN, ASPEST improves the AUACC from 79.36% to 88.84% when the labeling budget (M) is only 100. When M = 500, for DomainNet R→C, ASPEST improves the AUACC from 68.85% to 71.61%; for Amazon Review, ASPEST improves the AUACC from 76.63% to 77.69%; for Otto, ASPEST improves the AUACC from 87.89% to 88.28%. ## 5.3 Analyses And Discussions In this section, we analyze why the key components checkpoint ensembles and self-training in ASPEST can improve selective prediction and perform ablation study to show their effect. Checkpoint ensembles can alleviate overfitting and overconfidence. We observe that in active selective prediction, when fine-tuning the model on the small amount of selected labeled test data, the model can suffer overfitting and overconfidence issues and ensembling the checkpoints in the training path can effectively alleviate these issues (see the analysis in Appendix F.10). Self-training can alleviate overconfidence. We observe that the checkpoint ensemble constructed after fine-tuning is less confident on the test data UX compared to the deep ensemble. Thus, using the softmax outputs of the checkpoint ensemble as soft pseudo-labels for self-training can alleviate overconfidence and improve selective prediction performance (see the analysis in Appendix F.11). Ablation studies. Compared to DE+Margin, ASPEST has two additional components: checkpoint ensemble and self-training. We perform ablation experiments on MNIST→SVHN and DomainNet to analyze | Dataset | MNIST→SVHN | DomainNet R→C | | | |------------------------------------|--------------|-----------------|-----------|-----------| | Metric | AUACC ↑ | AUACC ↑ | | | | Labeling Budget | 100 | 500 | 500 | 1000 | | DE+Margin | 78.59±1.4 | 94.31±0.6 | 68.85±0.4 | 71.29±0.3 | | ASPEST without self-training | 78.09±1.3 | 94.25±0.4 | 69.59±0.2 | 72.45±0.1 | | ASPEST without checkpoint ensemble | 83.78±2.9 | 96.54±0.2 | 69.94±0.1 | 72.20±0.4 | | ASPEST (η=0.1) | 83.77±1.7 | 96.01±0.4 | 70.35±0.2 | 72.89±0.4 | | ASPEST (η=0.5) | 83.99±1.3 | 96.24±0.2 | 70.92±0.3 | 73.37±0.1 | | ASPEST (η=0.6) | 85.17±1.3 | 96.24±0.2 | 70.96±0.2 | 73.05±0.1 | | ASPEST (η=0.8) | 85.40±2.3 | 96.74±0.1 | 71.05±0.2 | 72.99±0.3 | | ASPEST (η=0.9) | 88.84±1.0 | 96.62±0.2 | 71.61±0.2 | 73.27±0.2 | | ASPEST (η=0.95) | 87.67±1.3 | 96.74±0.1 | 71.03±0.3 | 73.38±0.2 | Table 5: Ablation study results for ASPEST. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. the effect of these. We also study the effect of the threshold η in self-training. The results in Table 5 show for MNIST→SVHN, adding the checkpoint ensemble component alone (ASPEST without self-training) does not improve the performance over DE+Margin, whereas adding the self-training component alone (ASPEST without checkpoint ensemble) can significantly improve the performance. For DomainNet, both checkpoint ensemble and self-training have positive contributions. For both cases, ASPEST (with both self-training and checkpoint ensemble) achieves much better results than DE+Margin or applying those components alone. We also show the performance is not highly sensitive to η, while typically setting larger η (e.g. η = 0.9) yields better results. Integrating with UDA. To study whether incorporating unsupervised domain adaption (UDA) techniques into training could improve active selective prediction, we evaluate DE with UDA and ASPEST with UDA in Appendix F.12. Our results show that ASPEST outperforms (or on par with) DE with UDA, although ASPEST doesn't utilize UDA. Furthermore, we show that by combining ASPEST with UDA, it might achieve even better performance. For example, on MNIST→SVHN, ASPEST with DANN improves the mean AUACC from 96.62% to 97.03% when the labeling budget is 500. However, in some cases, combining ASPEST with UDA yields much worse results. For example, on MNIST→SVHN, when the labeling budget is 100, combining ASPEST with UDA will reduce the mean AUACC by over 4%. We leave the exploration of UDA techniques to improve active selective prediction to future work - superior and robust UDA techniques can be easily incorporated into ASPEST to enhance its overall performance. ## 6 Conclusion In this paper, we introduce a new learning paradigm called *active selective prediction* which uses active learning to improve selective prediction under distribution shift. We show that this new paradigm results in improved accuracy and coverage on a distributionally shifted test domain and reduces the need for human labeling. We also propose a novel method ASPEST using checkpoint ensemble and self-training with a low labeling cost. We demonstrate ASPEST's effectiveness over other baselines for this new problem setup on various image, text and structured datasets. Future work in this direction can investigate unsupervised hyperparameter tuning on test data, online data streaming, or further minimizing the labeling effort by designing time-preserving labeling interfaces. ## Broader Impact Statement The proposed framework yields more reliable predictions with more optimized utilization of humans in the loop. One potential risk of such a system is that if the humans in the loop yield inaccurate or biased labels, our framework might cause them being absorbed by the predictor model and the selective prediction mechanism, and eventually the outcomes of the system might be inaccurate and biased. We leave the methods for inaccurate label or bias detection to future work. ## References Jordan T Ash, Chicheng Zhang, Akshay Krishnamurthy, John Langford, and Alekh Agarwal. Deep batch active learning by diverse, uncertain gradient lower bounds. *arXiv preprint arXiv:1906.03671*, 2019. Andrei Barbu, David Mayo, Julian Alverio, William Luo, Christopher Wang, Dan Gutfreund, Josh Tenenbaum, and Boris Katz. Objectnet: A large-scale bias-controlled dataset for pushing the limits of object recognition models. *Advances in neural information processing systems*, 32, 2019. William H Beluch, Tim Genewein, Andreas Nürnberger, and Jan M Köhler. The power of ensembles for active learning in image classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 9368–9377, 2018. Wendy Kan Benjamin Bossan, Josef Feigl. Otto group product classification challenge, 2015. Markus M Breunig, Hans-Peter Kriegel, Raymond T Ng, and Jörg Sander. Lof: identifying density-based local outliers. In *Proceedings of the 2000 ACM SIGMOD international conference on Management of data*, pp. 93–104, 2000. Jiefeng Chen, Frederick Liu, Besim Avci, Xi Wu, Yingyu Liang, and Somesh Jha. Detecting errors and estimating accuracy on unlabeled data with self-training ensembles. *Advances in Neural Information* Processing Systems, 34:14980–14992, 2021. Gordon Christie, Neil Fendley, James Wilson, and Ryan Mukherjee. Functional map of the world. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6172–6180, 2018. Ching-Yao Chuang, Antonio Torralba, and Stefanie Jegelka. Estimating generalization under distribution shifts via domain-invariant representations. *arXiv preprint arXiv:2007.03511*, 2020. Luke N Darlow, Elliot J Crowley, Antreas Antoniou, and Amos J Storkey. Cinic-10 is not imagenet or cifar-10. *arXiv preprint arXiv:1810.03505*, 2018. Sanjoy Dasgupta. Two faces of active learning. *Theoretical computer science*, 412(19):1767–1781, 2011. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. *arXiv preprint arXiv:1810.04805*, 2018. Melanie Ducoffe and Frederic Precioso. Adversarial active learning for deep networks: a margin based approach. *arXiv preprint arXiv:1802.09841*, 2018. Ran El-Yaniv et al. On the foundations of noise-free selective classification. Journal of Machine Learning Research, 11(5), 2010. Stanislav Fort, Huiyi Hu, and Balaji Lakshminarayanan. Deep ensembles: A loss landscape perspective. arXiv preprint arXiv:1912.02757, 2019. Bo Fu, Zhangjie Cao, Jianmin Wang, and Mingsheng Long. Transferable query selection for active domain adaptation. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition*, pp. 7272–7281, 2021. Giorgio Fumera and Fabio Roli. Support vector machines with embedded reject option. In International Workshop on Support Vector Machines, pp. 68–82. Springer, 2002. Yarin Gal, Riashat Islam, and Zoubin Ghahramani. Deep bayesian active learning with image data. In International Conference on Machine Learning, pp. 1183–1192. PMLR, 2017. Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096–2030, 2016. Yonatan Geifman and Ran El-Yaniv. Selective classification for deep neural networks. Advances in neural information processing systems, 30, 2017. Yonatan Geifman and Ran El-Yaniv. Selectivenet: A deep neural network with an integrated reject option. In *International conference on machine learning*, pp. 2151–2159. PMLR, 2019. Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. Advances in neural information processing systems, 17, 2004. Federica Granese, Marco Romanelli, Daniele Gorla, Catuscia Palamidessi, and Pablo Piantanida. Doctor: A simple method for detecting misclassification errors. *Advances in Neural Information Processing Systems*, 34:5669–5681, 2021. Guy Hacohen, Avihu Dekel, and Daphna Weinshall. Active learning on a budget: Opposite strategies suit high and low budgets. *arXiv preprint arXiv:2202.02794*, 2022. Awni Hannun, Carl Case, Jared Casper, Bryan Catanzaro, Greg Diamos, Erich Elsen, Ryan Prenger, Sanjeev Satheesh, Shubho Sengupta, Adam Coates, et al. Deep speech: Scaling up end-to-end speech recognition. arXiv preprint arXiv:1412.5567, 2014. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016a. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pp. 630–645. Springer, 2016b. Matthias Hein, Maksym Andriushchenko, and Julian Bitterwolf. Why relu networks yield high-confidence predictions far away from the training data and how to mitigate the problem. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 41–50, 2019. Martin E Hellman. The nearest neighbor classification rule with a reject option. IEEE Transactions on Systems Science and Cybernetics, 6(3):179–185, 1970. Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. *arXiv preprint arXiv:1610.02136*, 2016. Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E Hopcroft, and Kilian Q Weinberger. Snapshot ensembles: Train 1, get m for free. *arXiv preprint arXiv:1704.00109*, 2017a. Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 4700–4708, 2017b. Sheng-Jun Huang, Rong Jin, and Zhi-Hua Zhou. Active learning by querying informative and representative examples. *Advances in neural information processing systems*, 23, 2010. Fredrik D Johansson, David Sontag, and Rajesh Ranganath. Support and invertibility in domain-invariant representations. In *The 22nd International Conference on Artificial Intelligence and Statistics*, pp. 527– 536. PMLR, 2019. Amita Kamath, Robin Jia, and Percy Liang. Selective question answering under domain shift. *arXiv preprint* arXiv:2006.09462, 2020. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Andreas Kirsch, Tom Rainforth, and Yarin Gal. Test distribution-aware active learning: A principled approach against distribution shift and outliers. *arXiv preprint arXiv:2106.11719*, 2021. Sosuke Kobayashi, Shun Kiyono, Jun Suzuki, and Kentaro Inui. Diverse lottery tickets boost ensemble from a single pretrained model. *arXiv preprint arXiv:2205.11833*, 2022. Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, et al. Wilds: A benchmark of inthe-wild distribution shifts. In *International Conference on Machine Learning*, pp. 5637–5664. PMLR, 2021. Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. *Advances in neural information processing systems*, 30, 2017. Yann LeCun. The MNIST database of handwritten digits. 1998. URL http://yann.lecun.com/exdb/ mnist/. Yann LeCun, Bernhard Boser, John Denker, Donnie Henderson, Richard Howard, Wayne Hubbard, and Lawrence Jackel. Handwritten digit recognition with a back-propagation network. *Advances in neural* information processing systems, 2, 1989. Dong-Hyun Lee et al. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In *Workshop on challenges in representation learning, ICML*, volume 3, pp. 896, 2013. Xiaofeng Liu, Chaehwa Yoo, Fangxu Xing, Hyejin Oh, Georges El Fakhri, Je-Won Kang, Jonghye Woo, et al. Deep unsupervised domain adaptation: A review of recent advances and perspectives. APSIPA Transactions on Signal and Information Processing, 11(1), 2022. Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. *arXiv* preprint arXiv:1907.11692, 2019. Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Conditional adversarial domain adaptation. *Advances in neural information processing systems*, 31, 2018. Andrew McCallum, Kamal Nigam, et al. Employing em and pool-based active learning for text classification. In *ICML*, volume 98, pp. 350–358. Citeseer, 1998. Mohammad Moghimi, Serge J Belongie, Mohammad J Saberian, Jian Yang, Nuno Vasconcelos, and Li-Jia Li. Boosted convolutional neural networks. In *BMVC*, volume 5, pp. 6, 2016. Hussein Mozannar and David Sontag. Consistent estimators for learning to defer to an expert. In *International Conference on Machine Learning*, pp. 7076–7087. PMLR, 2020. Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011. Jianmo Ni, Jiacheng Li, and Julian McAuley. Justifying recommendations using distantly-labeled reviews and fine-grained aspects. In Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP), pp. 188–197, 2019. Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, David Sculley, Sebastian Nowozin, Joshua Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift. *Advances in neural information processing systems*, 32, 2019. F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. *Journal of Machine Learning Research*, 12:2825–2830, 2011. Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1406–1415, 2019. Viraj Prabhu, Arjun Chandrasekaran, Kate Saenko, and Judy Hoffman. Active domain adaptation via clustering uncertainty-weighted embeddings. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8505–8514, 2021. Stephan Rabanser, Anvith Thudi, Kimia Hamidieh, Adam Dziedzic, and Nicolas Papernot. Selective classification via neural network training dynamics. *arXiv preprint arXiv:2205.13532*, 2022. Shiori Sagawa, Pang Wei Koh, Tony Lee, Irena Gao, Sang Michael Xie, Kendrick Shen, Ananya Kumar, Weihua Hu, Michihiro Yasunaga, Henrik Marklund, et al. Extending the wilds benchmark for unsupervised adaptation. *arXiv preprint arXiv:2112.05090*, 2021. Kuniaki Saito, Donghyun Kim, Stan Sclaroff, Trevor Darrell, and Kate Saenko. Semi-supervised domain adaptation via minimax entropy. In *Proceedings of the IEEE/CVF International Conference on Computer* Vision, pp. 8050–8058, 2019. Mohammadreza Salehi, Hossein Mirzaei, Dan Hendrycks, Yixuan Li, Mohammad Hossein Rohban, and Mohammad Sabokrou. A unified survey on anomaly, novelty, open-set, and out-of-distribution detection: Solutions and future challenges. *arXiv preprint arXiv:2110.14051*, 2021. Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. arXiv preprint arXiv:1708.00489, 2017. Burr Settles. Active learning literature survey. 2009. Samarth Sinha, Sayna Ebrahimi, and Trevor Darrell. Variational adversarial active learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 5972–5981, 2019. Kihyuk Sohn, David Berthelot, Nicholas Carlini, Zizhao Zhang, Han Zhang, Colin A Raffel, Ekin Dogus Cubuk, Alexey Kurakin, and Chun-Liang Li. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. *Advances in neural information processing systems*, 33:596–608, 2020. Jong-Chyi Su, Yi-Hsuan Tsai, Kihyuk Sohn, Buyu Liu, Subhransu Maji, and Manmohan Chandraker. Active adversarial domain adaptation. In *Proceedings of the IEEE/CVF Winter Conference on Applications of* Computer Vision, pp. 739–748, 2020. Vladimir Vapnik. *Statistical learning theory*. Wiley, 1998. ISBN 978-0-471-03003-4. Feng Wang, Guoyizhe Wei, Qiao Liu, Jinxiang Ou, Hairong Lv, et al. Boost neural networks by checkpoints. Advances in Neural Information Processing Systems, 34:19719–19729, 2021. Colin Wei, Kendrick Shen, Yining Chen, and Tengyu Ma. Theoretical analysis of self-training with deep networks on unlabeled data. In *International Conference on Learning Representations*, 2020. Wanqian Yang. *Making Decisions Under High Stakes: Trustworthy and Expressive Bayesian Deep Learning*. PhD thesis, 2020. Huaxiu Yao, Caroline Choi, Bochuan Cao, Yoonho Lee, Pang Wei Koh, and Chelsea Finn. Wild-time: A benchmark of in-the-wild distribution shift over time. *arXiv preprint arXiv:2211.14238*, 2022. David Yarowsky. Unsupervised word sense disambiguation rivaling supervised methods. In 33rd annual meeting of the association for computational linguistics, pp. 189–196, 1995. Michelle Yuan, Hsuan-Tien Lin, and Jordan Boyd-Graber. Cold-start active learning through self-supervised language modeling. *arXiv preprint arXiv:2010.09535*, 2020. Eric Zhao, Anqi Liu, Animashree Anandkumar, and Yisong Yue. Active learning under label shift. In International Conference on Artificial Intelligence and Statistics, pp. 3412–3420. PMLR, 2021. Xiatian Zhu, Shaogang Gong, et al. Knowledge distillation by on-the-fly native ensemble. Advances in neural information processing systems, 31, 2018. # Supplementary Material In Section A, we discuss some additional related work. In Section B, we give the definitions of some evaluation metrics. In Section C, we describe the baselines in detail. In Section D, we show the complete ASPEST algorithm and analyze its computational complexity. In Section E, we provide the details of the experimental setup. In Section F, we give some additional experimental results. ## A More Related Work Distribution shift. Distribution shift, where the training distribution differs from the test distribution, often occurs in practice and can substantially degrade the accuracy of the deployed DNNs (Koh et al., 2021; Yao et al., 2022; Barbu et al., 2019). Distribution shift can also substantially reduce the quality of uncertainty estimation (Ovadia et al., 2019), which is often used for rejecting examples in selective prediction and selecting samples for labeling in active learning. Several techniques try to tackle the challenge caused by distribution shift, including accuracy estimation (Chen et al., 2021; Chuang et al., 2020), error detection (Hendrycks & Gimpel, 2016; Granese et al., 2021), out-of-distribution detection (Salehi et al., 2021), domain adaptation (Ganin et al., 2016; Saito et al., 2019), selective prediction (Kamath et al., 2020) and active learning (Kirsch et al., 2021). In our work, we combine selective prediction with active learning to address the issue of distribution shift. Deep ensembles. Ensembles of DNNs (or deep ensembles) have been successfully used to boost predictive performance (Moghimi et al., 2016; Zhu et al., 2018). Deep ensembles can also be used to improve the predictive uncertainty estimation (Lakshminarayanan et al., 2017; Fort et al., 2019). Lakshminarayanan et al. (2017) shows that random initialization of the NN parameters along with random shuffling of the data points are sufficient for deep ensembles to perform well in practice. However, training multiple DNNs from random initialization can be very expensive. To obtain deep ensembles more efficiently, recent papers explore using checkpoints during training to construct the ensemble (Wang et al., 2021; Huang et al., 2017a), or fine-tuning a single pre-trained model to create the ensemble (Kobayashi et al., 2022). In our work, we use the checkpoints during fine-tuning a source-trained model via active learning as the ensemble and further boost the ensemble's performance via self-training. We also use the ensemble's uncertainty measured by a margin to select samples for labeling in active learning. Self-training. Self-training is a common algorithmic paradigm for leveraging unlabeled data with DNNs. Self-training methods train a model to fit pseudo-labels (i.e., predictions on unlabeled data made by a previously-learned model) to boost the model's performance (Yarowsky, 1995; Grandvalet & Bengio, 2004; Lee et al., 2013; Wei et al., 2020; Sohn et al., 2020). In this work, we use self-training to improve selective prediction performance. Instead of using predicted labels as pseudo-labels as a common practice in prior works, we use the average softmax outputs of the checkpoints during training as the pseudo-labels and self-train the models in the ensemble on them with the KL-Divergence loss to improve selective prediction performance. ## B Evaluation Metrics We have introduced the accuracy and coverage metrics in Section 3.2. The accuracy is measured on the predictions made by the model without human intervention while the coverage is the fraction of remaining unlabeled data points where we can rely on the model's prediction without human intervention. The accuracy and coverage metrics depend on the threshold τ . The following evaluation metrics are proposed to be agnostic to the threshold τ : Maximum Accuracy at a Target Coverage. Given a target coverage tc, the maximum accuracy is defined as: $$\operatorname*{max}_{\tau}\quad a c c(f_{s},\tau),\quad s.t.\quad c o v(f_{s},\tau)\geq t_{c}$$ τacc(fs, τ ), s.t. cov(fs, τ ) ≥ tc (11) We denote this metric as acc|cov ≥ tc. $\left(11\right)_{\text{f}}$ Maximum Coverage at a Target Accuracy. Given a target accuracy ta, the maximum coverage is defined as: $$\operatorname*{max}_{\tau}\quad c o v(f_{s},\tau),\quad s.t.\quad a c c(f_{s},\tau)\geq t_{a}$$ $$(12)$$ When τ = ∞, we define cov(fs, τ ) = 0 and acc(fs, τ ) = 1. We denote this metric as cov|acc ≥ ta. Area Under Accuracy-Coverage Curve (AUACC). We define the AUACC metric as: $$\mathrm{AUACC}(f_{s})=\int_{0}^{1}a c c(f_{s},\tau)\mathrm{d}c o v(f_{s},\tau)$$ $$(13)$$ We use the composite trapezoidal rule to estimate the integration. ## C Baselines We consider two selective classification baselines Softmax Response (SR) (Geifman & El-Yaniv, 2017) and Deep Ensembles (DE) (Lakshminarayanan et al., 2017) and combine them with active learning techniques. We describe them in detail below. ## C.1 Softmax Response Suppose the neural network classifier is f where the last layer is a softmax. Let f(x | k) be the soft response output for the k-th class. Then the classifier is defined as f(x) = arg maxk∈Y f(x | k) and the selection scoring function is defined as g(x) = maxk∈Y f(x | k), which is also known as the Maximum Softmax Probability (MSP) of the neural network. Recall that with f and g, the selective classifier is defined in Eq (1). We use active learning to fine-tune the model f to improve selective prediction performance of SR on the unlabeled test dataset UX. The complete algorithm is presented in Algorithm 1. In our experiments, we always set λ = 1. We use the joint training objective (22) to avoid over-fitting to the small labeled test set ∪ t l=1B˜l and prevent the model from forgetting the source training knowledge. The algorithm can be combined with different kinds of acquisition functions. We describe the acquisition functions considered for SR below. Uniform. In the t-th round of active learning, we select [ M T ] data points as the batch Bt from UX \ ∪t−1 l=0Bl via uniform random sampling. The corresponding acquisition function is: a(B, ft−1, gt−1) = 1. When solving the objective (21), the tie is broken randomly. Confidence. We define the confidence score of f on the input x as $$(14)$$ $$S_{\mathrm{conf}}(\mathbf{x};f)=\operatorname*{max}_{k\in{\mathcal{Y}}}\quad f(\mathbf{x}\mid k)$$ $$(15)$$ k∈Yf(x | k) (14) Then the acquisition function in the t-th round of active learning is defined as: $$a(B,f_{t-1},g_{t-1})=-\sum_{\mathbf{x}\in B}S_{\mathrm{conf}}(\mathbf{x};f_{t-1})$$ Sconf(x; ft−1) (15) That is we select those test examples with the lowest confidence scores for labeling. Entropy. We define the entropy score of f on the input x as $$S_{\rm entropy}({\bf x};f)=\sum_{k\in{\cal Y}}\quad-f({\bf x}\mid k)\cdot\log f({\bf x}\mid k)\tag{1}$$ Then the acquisition function in the t-th round of active learning is defined as: $$a(B,f_{t-1},g_{t-1})=\sum_{\mathbf{x}\in B}S_{\mathrm{entropy}}(\mathbf{x};f_{t-1})$$ Sentropy(x; ft−1) (17) $$(1{\mathrm{f}}{\mathrm{o}})$$ $$(17)$$ That is we select those test examples with the highest entropy scores for labeling. Margin. We define the margin score of f on the input x as $S_{\rm margin}({\bf x};f)=f({\bf x}\mid\hat{g})-\max_{k\in{\cal Y}(\hat{g})}\quad f({\bf x}\mid k)$ $s.t.\quad\hat{g}=\mathop{\rm arg\,max}_{k\in{\cal Y}}\quad f({\bf x}\mid k)$ $$(18)$$ $$(19)$$ $$(20)$$ Then the acquisition function in the t-th round of active learning is defined as: $$a(B,f_{t-1},g_{t-1})=-\sum_{\mathbf{x}\in B}S_{\mathrm{margin}}(\mathbf{x};f_{t-1})$$ That is we select those test examples with lowest margin scores for labeling. kCG. We use the k-Center-Greedy algorithm proposed in (Sener & Savarese, 2017) to select test examples for labeling in each round. CLUE. We use the Clustering Uncertainty-weighted Embeddings (CLUE) proposed in (Prabhu et al., 2021) to select test examples for labeling in each round. Following (Prabhu et al., 2021), we set the hyper-parameter T = 0.1 on DomainNet and set T = 1.0 on other datasets. BADGE. We use the Diverse Gradient Embeddings (BADGE) proposed in (Ash et al., 2019) to select test examples for labeling in each round. Algorithm 1 Softmax Response with Active Learning Input: A training dataset Dtr, an unlabeled test dataset UX, the number of rounds T, the labeling budget M, a source-trained model ¯f, an acquisition function a and a hyper-parameter λ. Let f0 = ¯f. Let B0 = ∅. Let $g_{t}(\mathbf{x})=\max_{k\in\mathcal{Y}}f_{t}(\mathbf{x}\mid k)$. **for $t=1,\cdots,T$ do** Select a batch $B_{t}$ with a size T ] from UX for labeling via: $$B_{t}=\arg\operatorname*{max}_{B\subset U_{X}\setminus(\cup_{t=0}^{t-1}B_{t}),|B|=m}a(B,f_{t-1},g_{t-1})$$ $$(21)$$ Use an oracle to assign ground-truth labels to the examples in Bt to get B˜t. Fine-tune the model ft−1 using the following training objective: $$\begin{array}{r l}{\operatorname*{min}_{\theta}}&{{}\mathbb{E}_{(\mathbf{x},y)\in\cup_{i=1}^{t}B_{i}}\quad\ell_{C E}(\mathbf{x},y;\theta)+\lambda\cdot\mathbb{E}_{(\mathbf{x},y)\in\mathcal{D}^{t*}}\quad\ell_{C E}(\mathbf{x},y;\theta)}\end{array}$$ where θ is the model parameters of ft−1 and `CE is the cross-entropy loss function. Let ft = ft−1. end for Output: The classifier f = fT and the selection scoring function g = maxk∈Y f(x | k). ## C.2 Deep Ensembles It has been shown that deep ensembles can significantly improve selective prediction performance (Lakshminarayanan et al., 2017), not only because deep ensembles are more accurate than a single model, but also because deep ensembles yield more calibrated confidence. Suppose the ensemble model f contains N models f 1*, . . . , f* N . Let f j(x | k) denote the predicted probability of the model f j on the k-th class. We define the predicted probability of the ensemble model f on the k-th $$(22)$$ class as: $$f({\bf x}\mid k)=\frac{1}{N}\sum_{j=1}^{N}f^{j}({\bf x}\mid k).\tag{1}$$ $$(23)$$ The classifier is defined as f(x) = arg maxk∈Y f(x | k) and the selection scoring function is defined as g(x) = maxk∈Y f(x | k). We use active learning to fine-tune each model f jin the ensemble to improve selective prediction performance of the ensemble on the unlabeled test dataset UX. Each model f jis first initialized by the source-trained model ¯f, and then fine-tuned independently via Stochastic Gradient Decent (SGD) with different sources of randomness (e.g., different random order of the training batches) on the training dataset Dtr and the selected labeled test data. Note that this way to construct the ensembles is different from the standard Deep Ensembles method, which trains the models from different random initialization. We use this way to construct the ensemble due to the constraint in our problem setting, which requires us to fine-tune a given source-trained model ¯f. Training the models from different random initialization might lead to an ensemble with better performance, but it is much more expensive, especially when the training dataset and the model are large (e.g., training foundation models). Thus, the constraint in our problem setting is feasible in practice. The complete algorithm is presented in Algorithm 2. In our experiments, we always set λ = 1, N = 5, and ns = 1000. We also use joint training here and the reasons are the same as those for the Softmax Response baseline. The algorithm can be combined with different kinds of acquisition functions. We describe the acquisition functions considered below. Uniform. In the t-th round of active learning, we select [ M T ] data points as the batch Bt from UX \ ∪t−1 l=0Bl via uniform random sampling. The corresponding acquisition function is: a(B, ft−1, gt−1) = 1. When solving the objective (30), the tie is broken randomly. Confidence. The confidence scoring function Sconf for the ensemble model f is the same as that in Eq. (14) (f(x | k) for the ensemble model f is defined in Eq. (23)). The acquisition function in the t-th round of active learning is defined as: $$a(B,f_{t-1},g_{t-1})=-\sum_{\mathbf{x}\in B}S_{\mathrm{conf}}(\mathbf{x};f_{t-1})$$ $$(24)$$ That is we select those test examples with the lowest confidence scores for labeling. Entropy. The entropy scoring function Sentropy for the ensemble model f is the same as that in Eq. (16). The acquisition function in the t-th round of active learning is defined as: $$a(B,f_{t-1},g_{t-1})=\sum_{\mathbf{x}\in B}S_{\text{entropy}}(\mathbf{x};f_{t-1}),$$ That is we select those test examples with the highest entropy scores for labeling. $$(25)$$ Margin. The margin scoring function Smargin for the ensemble model f is the same as that in Eq. (18). The acquisition function in the t-th round of active learning is defined as: The equation function in the $\psi$-norm of active learning is defined as: $$a(B,f_{t-1},g_{t-1})=-\sum_{\mathbf{x}\in B}S_{\text{margin}}(\mathbf{x};f_{t-1})$$ That is we select those test examples with the lowest margin scores for labeling. Avg-KLD. The Average Kullback-Leibler Divergence (Avg-KLD) is proposed in (McCallum et al., 1998) as a disagreement measure for the model ensembles, which can be used for sample selection in active learning. The Avg-KLD score of the ensemble model f on the input x is defined as: $$S_{\mathrm{kl}}(\mathbf{x};f)={\frac{1}{N}}\sum_{j=1}^{N}\sum_{k\in{\mathcal{Y}}}\quad f^{j}(\mathbf{x}\mid k)\cdot\log{\frac{f^{j}(\mathbf{x}\mid k)}{f(\mathbf{x}\mid k)}}.$$ $$(26)$$ Then the acquisition function in the t-th round of active learning is defined as: $$a(B,f_{t-1},g_{t-1})=\sum_{\mathbf{x}\in B}S_{\mathrm{kl}}(\mathbf{x};f_{t-1}),$$ Skl(x; ft−1), (28) $$(27)$$ $$(28)$$ That is we select those test examples with the highest Avg-KLD scores for labeling. CLUE. CLUE (Prabhu et al., 2021) is proposed for a single model. Here, we adapt CLUE for the ensemble model, which requires a redefinition of the entropy function H(Y | x) and the embedding function φ(x) used in the CLUE algorithm. We define the entropy function as Eq. (16) with the ensemble model f. Suppose φ j is the embedding function for the model f jin the ensemble. Then, the embedding of the ensemble model f on the input x is [φ 1(x)*, . . . , φ*N (x)], which is the concatenation of the embeddings of the models f 1*, . . . , f* N on x. Following (Prabhu et al., 2021), we set the hyper-parameter T = 0.1 on DomainNet and set T = 1.0 on other datasets. BADGE. BADGE (Ash et al., 2019) is proposed for a single model. Here, we adapt BADGE for the ensemble model, which requires a redefinition of the gradient embedding gx in the BADGE algorithm. Towards this end, we propose the gradient embedding gx of the ensemble model f as the concatenation of the gradient embeddings of the models f 1*, . . . , f* N . Algorithm 2 Deep Ensembles with Active Learning Input: A training dataset Dtr, An unlabeled test dataset UX, the number of rounds T, the total labeling budget M, a source-trained model ¯f, an acquisition function a(*B, f, g*), the number of models in the ensemble N, the number of initial training steps ns, and a hyper-parameter λ. Let f j 0 = ¯f for j = 1*, . . . , N*. Fine-tune each model f j 0 in the ensemble via SGD for ns training steps independently using the following training objective with different randomness: $$\begin{array}{r l}{\operatorname*{min}_{\theta^{j}}}&{{}\mathbb{E}_{(\mathbf{x},y)\in{\mathcal{D}}^{\mathrm{tr}}}\quad\ell_{C E}(\mathbf{x},y;\theta^{j})}\end{array}$$ $$(29)$$ $$(30)$$ j) (29) where θ jis the model parameters of f j 0 and `CE is the cross-entropy loss function. Let B0 = ∅. Let gt(x) = maxk∈Y ft(x | k). for t = 1, · · · , T do Select a batch Bt with a size of m = [M T ] from UX for labeling via: $$B_{t}=\arg\operatorname*{max}_{B\subset U_{X}\setminus(\cup_{l=0}^{t-1}B_{l}),|B|=m}a(B,f_{t-1},g_{t-1})$$ $$(31)$$ a(B, ft−1, gt−1) (30) Use an oracle to assign ground-truth labels to the examples in Bt to get B˜t. Fine-tune each model f j t−1 in the ensemble via SGD independently using the following training objective with different randomness: $$\operatorname*{min}_{\theta^{j}}\quad\mathbb{E}_{(\mathbf{x},y)\in\cup_{i=1}^{t}\mathcal{B}_{i}}\quad\ell_{C E}(\mathbf{x},y;\theta^{j})+\lambda\cdot\mathbb{E}_{(\mathbf{x},y)\in\mathcal{D}^{u r}}\quad\ell_{C E}(\mathbf{x},y;\theta^{j})$$ j) (31) where θ jis the model parameters of f j t−1 . Let f j t = f j t−1 for j = 1*, . . . , N*. end for Output: The classifier f = fT and the selection scoring function g = maxk∈Y f(x | k). ## D Aspest Algorithm And Its Computational Complexity Algorithm 3 presents the overall ASPEST method. Figure 3 illustrates how the checkpoint ensemble and the pseudo-labeled set are constructed in the proposed ASPEST. Next, we will analyze the computational complexity of ASPEST. Let the complexity for one step of updating P and Ne be tu (mainly one forward pass of DNN); for one DNN gradient update step is tg (mainly one forward and backward pass of DNN); and for sample selection is ts (mainly sorting test examples). Then, the total complexity of ASPEST would be O N · ns cs · tu + N · Algorithm 3 Active Selective Prediction using Ensembles and Self-Training Input: A training set Dtr, a unlabeled test set UX, the number of rounds T, the labeling budget M, the number of models N, the number of initial training steps ns, the initial checkpoint steps cs, a checkpoint epoch ce, a threshold η, a sub-sampling fraction p, and a hyper-parameter λ. Let f j 0 = ¯f for j = 1*, . . . , N*. Set Ne = 0 and P = 0n×K. Fine-tune each f j 0 for ns training steps using the following training objective: $$\operatorname*{min}_{\theta^{j}}\mathbb{E}_{(\mathbf{x},y)\in{\mathcal{D}}^{\mathrm{tr}}}\quad\ell_{C E}(\mathbf{x},y;\theta^{j}),$$ θ and update P and Ne using Eq. (6) every cs training steps. for t = 1, · · · , T do Select a batch Bt from UX for labeling using the sample selection objective (7). Use an oracle to assign ground-truth labels to the examples in Bt to get B˜t. Set Ne = 0 and P = 0n×K. Fine-tune each f j t−1 using objective (8), while updating P and Ne using Eq (6) every ce training epochs. Let f j t = f j t−1 . Construct the pseudo-labeled set R via Eq (9) and create Rsub by randomly sampling up to [p · n] data points from R. Train each f j t further via SGD using the objective (10) and update P and Ne using Eq (6) every ce training epochs. end for Output: The classifier f(xi) = arg maxk∈Y Pi,k and the selection scoring function g(xi) = maxk∈Y Pi,k. ![21_image_0.png](21_image_0.png) Figure 3: Illustration of the checkpoint ensemble and pseudo-labeled set construction in the proposed ASPEST. ns · tg + T · [ts + N · (ef + es · p) · n b · tg + N · es+ef ce· tu] , where ef is the number of fine-tuning epochs and es is the number of self-training epochs and b is the batch size. Although the training objectives include training on Dtr, the complexity doesn't depend on the size of Dtr since we measure ef over ∪ t l=1B˜lin training objective (8) and measure es over Rsub in training objective (10). In practice, we usually have ts tg and tu tg. Also, we set es · *p < e*f , ns n b · T · ef and es+ef ce (ef + es · p)· n b . So the complexity of ASPEST is O N · T · n b · ef ·tg . Suppose the size of Dtr is ntr and the number of source training epochs is ep. Then, the complexity for source training is O( ntr b· ep · tg). In practice, we usually have N · T · n · ef ntr · ep. Overall, the complexity of ASPEST would be much smaller than that of source training. It should be noted that ASPEST shares the same computational complexity as the DE+Margin baseline, which also has a computational complexity of O N · T · n b · ef ·tg . While both methods utilize an ensemble approach, a key distinction is that DE+Margin does not incorporate self-training, unlike ASPEST. In contrast, the SR+Margin baseline, which does not utilize ensembles, has a lower computational complexity of O T · n b · ef · tg . While DE+Margin and ASPEST indeed have higher computational complexities compared to SR+Margin due to the inclusion of ensembles, this does not necessarily translate to proportionally longer running times. With careful implementation and adequate computational resources, it is feasible to train ensemble models in parallel, potentially aligning the actual running times of ASPEST with those of the baseline methods, SR+Margin and DE+Margin. This parallelization strategy could mitigate the increased computational demand, making the running times of ASPEST comparable to, if not competitive with, the baselines under similar resource conditions. ## E Details Of Experimental Setup E.1 Computing Infrastructure And Runtime We run all experiments with TensorFlow 2.0 on NVIDIA A100 GPUs in the Debian GNU/Linux 10 system. We report the total runtime of the proposed method ASPEST on each dataset in Table 6. Note that in our implementation, we train models in the ensemble sequentially. However, it is possible to train models in the ensemble in parallel, which can significantly reduce the runtime. With the optimal implementation, the inference latency of the ensemble can be as low as the inference latency of a single model. | Dataset | Total Runtime | |-------------------|-----------------| | MNIST→SVHN | 24 min | | CIFAR-10→CINIC-10 | 1 hour | | FMoW | 2 hour 48 min | | Amazon Review | 1 hour 34 min | | DomainNet (R→C) | 2 hours 10 min | | DomainNet (R→P) | 1 hour 45 min | | DomainNet (R→S) | 1 hour 51 min | | Otto | 18 min | Table 6: The runtime of ASPEST when the labeling budget M = 500. We use the default hyper-parameters for ASPEST described in Section 5.1. ## E.2 Datasets We describe the datasets used below. For all image datasets, we normalize the range of pixel values to [0,1]. MNIST→**SVHN.** The source training dataset Dtr is MNIST (LeCun, 1998) while the target test dataset UX is SVHN (Netzer et al., 2011). MNIST consists 28×28 grayscale images of handwritten digits, containing in total 5,500 training images and 1,000 test images. We resize each image to be 32×32 resolution and change them to be colored. We use the training set of MNIST as Dtr and the test set of MNIST as the source validation dataset. SVHN consists 32×32 colored images of digits obtained from house numbers in Google Street View images. The training set has 73,257 images and the test set has 26,032 images. We use the test set of SVHN as UX. CIFAR-10→**CINIC-10.** The source training dataset Dtr is CIFAR-10 (Krizhevsky et al., 2009) while the target test dataset UX is CINIC-10 (Darlow et al., 2018). CIFAR-10 consists 32×32 colored images with ten classes (dogs, frogs, ships, trucks, etc.), each consisting of 5,000 training images and 1,000 test images. We use the training set of CIFAR-10 as Dtr and the test set of CIFAR-10 as the source validation dataset. During training, we apply random horizontal flipping and random cropping with padding data augmentations to the training images. CINIC-10 is an extension of CIFAR-10 via the addition of downsampled ImageNet images. CINIC-10 has a total of 270,000 images equally split into training, validation, and test. In each subset (90,000 images) there are ten classes (identical to CIFAR-10 classes). There are 9,000 images per class per subset. We use a subset of the CINIC-10 test set containing 30,000 images as UX. FMoW. We use the FMoW-WILDS dataset from (Koh et al., 2021). FMoW-wilds is based on the Functional Map of the World dataset (Christie et al., 2018), which collected and categorized high-resolution satellite images from over 200 countries based on the functional purpose of the buildings or land in the image, over the years 2002–2018. The task is multi-class classification, where the input x is an RGB satellite image, the label y is one of 62 building or land use categories, and the domain d represents both the year the image was taken as well as its geographical region (Africa, the Americas, Oceania, Asia, or Europe). The FMoW dataset encompasses both temporal and geographical distribution shifts, covering diverse regions across various continents over a span of 16 years. The training set contains 76,863 images from the years 2002-2013. The In-Distribution (ID) validation set contains 11,483 images from the years 2002-2013. The OOD test set contains 22,108 images from the years 2016-2018. We resize each image to be 96×96 resolution to save computational cost. We use the training set as Dtr and the ID validation set as the source validation dataset. During training, we apply random horizontal flipping and random cropping with padding data augmentations to the training images. We use the OOD test set as UX. Amazon Review. We use the Amazon Review WILDS dataset from (Koh et al., 2021). The dataset comprises 539,502 customer reviews on Amazon taken from the Amazon Reviews dataset (Ni et al., 2019). The task is multi-class sentiment classification, where the input x is the text of a review, the label y is a corresponding star rating from 1 to 5, and the domain d is the identifier of the reviewer who wrote the review. The issue of distribution shifts in the Amazon Review dataset stems from the diverse writing styles and perspectives of different reviewers. The training set contains 245,502 reviews from 1,252 reviewers. The In-Distribution (ID) validation set contains 46,950 reviews from 626 of the 1,252 reviewers in the training set. The Out-Of-Distribution (OOD) test set contains 100,050 reviews from another set of 1,334 reviewers, distinct from those of the training set. We use the training set as Dtr and the ID validation set as the source validation dataset. We use a subset of the OOD test set containing 22,500 reviews from 300 reviewers as UX. DomainNet. DomainNet (Peng et al., 2019) is a dataset of common objects in six different domains. All domains include 345 categories (classes) of objects such as Bracelet, plane, bird, and cello. We use five domains from DomainNet including: (1) Real: photos and real world images. The training set from the Real domain has 120,906 images while the test set has 52,041 images; (2) Clipart: a collection of clipart images. The training set from the Clipart domain has 33,525 images while the test set has 14,604 images; (3) Sketch: sketches of specific objects. The training set from the Sketch has 48,212 images while the test set has 20,916 images; (4) Painting: artistic depictions of objects in the form of paintings. The training set from the Painting domain has 50,416 images while the test set has 21,850 images. (5) Infograph: infographic images with specific objects. The training set from the Infograph domain has 36,023 images while the test set has 15,582 images. We resize each image from all domains to be 96×96 resolution to save computational cost. We use the training set from the Real domain as Dtr and the test set from the Real domain as the source validation dataset. During training, we apply random horizontal flipping and random cropping with padding data augmentations to the training images. We use the test sets from three domains Clipart, Sketch, and Painting as three different UX for evaluation. So we evaluate three shifts: Real→Clipart (R→C), Real→Sketch (R→S), and Real→Painting (R→P). We use the remaining shift Real→Infograph (R→I) as a validation dataset for tuning the hyper-parameters. Otto. The Otto Group Product Classification Challenge (Benjamin Bossan, 2015) is a tabular dataset hosted on Kaggle 2. The task is to classify each product with 93 features into 9 categories. Each target category represents one of the most important product categories (like fashion, electronics, etc). It contains 61, 878 training data points. Since it only provides labels for the training data, we need to create the training, validation and test set. To create a test set that is from a different distribution than the training set, we apply the Local Outlier Factor (LOF) (Breunig et al., 2000), which is an unsupervised outlier detection method, on the Otto training data to identify a certain fraction (e.g., 0.2) of outliers as the test set. Specifically, we apply the *LocalOutlierFactor* function provided by scikit-learn (Pedregosa et al., 2011) on the training data with a contamination of 0.2 (contamination value determines the proportion of outliers in the data set) to identify the outliers. We identify 12, 376 outlier data points and use them as the test set UX. We then randomly split the remaining data into a training set Dtr with 43, 314 data points and a source validation set with 6, 188 data points. We show that the test set indeed has a distribution shift compared to the source 2URL: https://kaggle.com/competitions/otto-group-product-classification-challenge validation set, which causes the model trained on the training set to have a drop in performance (see Table 7 in Appendix F.1). ## E.3 Details On Model Architectures And Training On Source Data On all datasets, we use the following supervised training objective for training models on the source training set Dtr: $$\operatorname*{min}_{\theta}\quad\mathbb{E}_{(\mathbf{x},y)\in{\mathcal{D}}^{\mathrm{str}}}\quad\ell_{C E}(\mathbf{x},y;\theta)$$ $$(32)$$ E(x,y)∈Dtr `CE(x, y; θ) (32) where `CE is the cross-entropy loss and θ is the model parameters. On MNIST→SVHN, we use the Convolutional Neural Network (CNN) (LeCun et al., 1989) consisting of four convolutional layers followed by two fully connected layers with batch normalization and dropout layers. We train the model on the training set of MNIST for 20 epochs using the Adam optimizer (Kingma & Ba, 2014) with a learning rate of 10−3 and a batch size of 128. On CIFAR-10→CINIC-10, we use the ResNet-20 network (He et al., 2016b). We train the model on the training set of CIFAR-10 for 200 epochs using the SGD optimizer with a learning rate of 0.1, a momentum of 0.9, and a batch size of 128. The learning rate is multiplied by 0.1 at the 80, 120, and 160 epochs, respectively, and is multiplied by 0.5 at the 180 epoch. On the FMoW dataset, we use the DensetNet-121 network (Huang et al., 2017b) pre-trained on ImageNet. We train the model further for 50 epochs using the Adam optimizer with a learning rate of 10−4 and a batch size of 128. On the Amazon Review dataset, we use the pre-trained RoBERTa base model (Liu et al., 2019) to extract the embedding of the input sentence for classification (i.e., RoBERTa's output for the [CLS] token) and then build an eight-layer fully connected neural network (also known as a multi-layer perceptron) with batch normalization, dropout layers and L2 regularization on top of the embedding. Note that we only update the parameters of the fully connected neural network without updating the parameters of the pretrained RoBERTa base model during training (i.e., freeze the parameters of the RoBERTa base model during training). We train the model for 200 epochs using the Adam optimizer with a learning rate of 10−3 and a batch size of 128. On the DomainNet dataset, we use the ResNet-50 network (He et al., 2016a) pre-trained on ImageNet. We train the model further on the training set from the Real domain for 50 epochs using the Adam optimizer with a learning rate of 10−4 and a batch size of 128. On the Otto dataset, we use a six-layer fully connected neural network (also known as a multi-layer perceptron) with batch normalization, dropout layers and L2 regularization. We train the model on the created training set for 200 epochs using the Adam optimizer with a learning rate of 10−3 and a batch size of 128. ## E.4 Active Learning Hyper-Parameters During the active learning process, we fine-tune the model on the selected labeled test data. During fine-tuning, we don't apply any data augmentation to the test data. We use the same fine-tuning hyperparameters for different methods to ensure a fair comparison. The optimizer used is the same as that in the source training stage (described in Appendix E.3). On MNIST→SVHN, we use a learning rate of 10−3; On CIFAR-10→CINIC-10, we use a learning rate of 5 × 10−3; On FMoW, we use a learning rate of 10−4; On Amazon Review, we use a learning rate of 10−3; On DomainNet, we use a learning rate of 10−4; On Otto, we use a learning rate of 10−3. On all datasets, we fine-tune the model for at least 50 epochs and up to 200 epochs with a batch size of 128 and early stopping using 10 patient epochs. ## F Additional Experimental Results F.1 Evaluate Source-Trained Models In this section, we evaluate the accuracy of the source-trained models on the source validation dataset and the target test dataset UX. The models are trained on the source training set Dtr (refer to Appendix E.3 for the details of source training). The source validation data are randomly sampled from the training data distribution while the target test data are sampled from a different distribution than the training data distribution. The results in Table 7 show that the models trained on Dtr always suffer a drop in accuracy when evaluating them on the target test dataset UX. | Dataset | Source Accuracy | Target Accuracy | |-------------------|-------------------|-------------------| | MNIST→SVHN | 99.40 | 24.68 | | CIFAR-10→CINIC-10 | 90.46 | 71.05 | | FMoW | 46.25 | 38.01 | | Amazon Review | 65.39 | 61.40 | | DomainNet (R→C) | 63.45 | 33.37 | | DomainNet (R→P) | 63.45 | 26.29 | | DomainNet (R→S) | 63.45 | 16.00 | | Otto | 80.72 | 66.09 | Table 7: Results of evaluating the accuracy of the source-trained models on the source validation dataset and the target test dataset UX. All numbers are percentages. ## F.2 Evaluate Softmax Response With Various Active Learning Methods | Method | Accuracy of f ↑ | Overconfidence ratio ↓ | AUACC↑ | |---------------|-------------------|--------------------------|------------| | SR+Confidence | 45.29±3.39 | 16.91±2.24 | 64.14±2.83 | | SR+Entropy | 45.78±6.36 | 36.84±18.96 | 65.88±4.74 | | SR+Margin | 58.10±0.55 | 13.18±1.85 | 76.79±0.45 | | SR+kCG | 32.68±3.87 | 0.04±0.01 | 48.83±7.21 | | SR+CLUE | 55.22±2.27 | 9.47±0.94 | 73.15±2.68 | | SR+BADGE | 56.55±1.62 | 8.37±2.56 | 76.06±1.63 | | ASPEST (ours) | 71.82±1.49 | 0.10±0.02 | 88.84±1.02 | To see whether combining existing selective prediction and active learning approaches could solve the active selective prediction problem, we evaluate the existing selective prediction method Softmax Response (SR) with active learning methods based on uncertainty or diversity. The results in Table 8 show that the methods based on uncertainty sampling (SR+Confidence, SR+Entropy and SR+Margin) achieve relatively high accuracy of f, but suffer from the overconfidence issue (i.e., mis-classification with high confidence). The method based on diversity sampling (SR+kCG) doesn't have the overconfidence issue, but suffers from low accuracy of f. Also, the hybrid methods based on uncertainty and diversity sampling (SR+CLUE and SR+BADGE) still suffer from the overconfidence issue. In contrast, the proposed method ASPEST achieves much higher accuracy of f, effectively alleviates the overconfidence issue, and significantly improves the selective prediction performance. Table 8: Evaluating the Softmax Response (SR) method with various active learning methods and the proposed ASPEST on MNIST→SVHN. The experimental setup is describe in Section 5.1. The labeling budget M is 100. The overconfidence ratio is the ratio of *mis-classified* unlabeled test inputs that have confidence ≥ 1 (the highest confidence). The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. 26 ## F.3 Complete Evaluation Results We give complete experimental results for the baselines and the proposed method ASPEST on all datasets in this section. We repeat each experiment three times with different random seeds and report the mean and standard deviation (std) values. These results are shown in Table 9 (MNIST→SVHN), Table 10 (CIFAR10→CINIC-10), Table 11 (FMoW), Table 12 (Amazon Review), Table 13 (DomainNet R→C), Table 14 (DomainNet R→P), Table 15 (DomainNet R→S) and Table 16 (Otto). Our results show that the proposed method ASPEST consistently outperforms the baselines across different image, text and structured datasets. | Dataset | MNIST→SVHN | | | | | | | | | |-----------------|-----------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 90% ↑ | acc|cov ≥ 90% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 100 | 500 | 1000 | 100 | 500 | 1000 | 100 | 500 | 1000 | | SR+Uniform | 0.00±0.0 | 51.46±3.7 | 75.57±0.9 | 58.03±1.5 | 76.69±1.2 | 84.39±0.2 | 74.08±1.5 | 88.80±0.8 | 93.57±0.2 | | SR+Confidence | 0.00±0.0 | 55.32±5.1 | 82.22±1.3 | 47.66±3.4 | 79.02±0.7 | 87.19±0.4 | 64.14±2.8 | 89.93±0.6 | 94.62±0.2 | | SR+Entropy | 0.00±0.0 | 0.00±0.0 | 75.08±2.4 | 47.93±7.0 | 77.09±1.0 | 84.81±0.7 | 65.88±4.7 | 88.19±0.8 | 93.37±0.5 | | SR+Margin | 0.00±0.0 | 63.60±2.7 | 82.19±0.3 | 61.39±0.5 | 80.96±0.9 | 86.97±0.2 | 76.79±0.5 | 91.24±0.5 | 94.82±0.1 | | SR+kCG | 2.52±1.3 | 23.04±0.3 | 38.97±2.6 | 34.57±4.4 | 52.76±1.1 | 64.34±4.8 | 48.83±7.2 | 73.65±1.0 | 83.16±2.0 | | SR+CLUE | 0.00±0.0 | 62.03±2.4 | 81.29±1.1 | 57.35±1.9 | 79.55±0.8 | 86.28±0.5 | 72.72±1.9 | 90.98±0.5 | 94.99±0.2 | | SR+BADGE | 0.00±0.0 | 62.55±4.4 | 82.39±2.8 | 59.82±1.7 | 79.49±1.6 | 86.96±0.9 | 76.06±1.6 | 91.09±0.9 | 95.16±0.6 | | DE+Uniform | 24.71±5.6 | 68.98±1.6 | 83.67±0.1 | 63.22±1.7 | 81.67±0.4 | 87.32±0.1 | 79.36±1.7 | 92.47±0.2 | 95.48±0.0 | | DE+Entropy | 6.24±8.8 | 63.30±6.5 | 84.62±1.5 | 56.61±0.6 | 80.16±2.0 | 88.05±0.5 | 72.51±1.5 | 91.21±1.4 | 95.45±0.5 | | DE+Confidence | 14.92±5.1 | 67.87±1.4 | 89.41±0.3 | 61.11±2.9 | 81.80±0.5 | 89.75±0.1 | 75.85±3.0 | 92.16±0.2 | 96.19±0.1 | | DE+Margin | 21.59±3.8 | 77.84±2.8 | 92.75±0.3 | 62.88±1.2 | 85.11±1.1 | 91.17±0.1 | 78.59±1.4 | 94.31±0.6 | 97.00±0.0 | | DE+Avg-KLD | 10.98±4.6 | 61.45±3.4 | 88.06±2.2 | 54.80±1.6 | 78.21±1.6 | 89.23±0.9 | 71.67±2.2 | 90.92±0.8 | 96.23±0.4 | | DE+CLUE | 22.34±1.4 | 69.23±1.9 | 82.80±1.0 | 59.47±1.3 | 81.05±0.9 | 86.78±0.4 | 76.88±1.0 | 92.70±0.5 | 95.56±0.2 | | DE+BADGE | 22.02±4.5 | 72.31±1.2 | 88.23±0.4 | 61.23±1.9 | 82.69±0.5 | 89.15±0.2 | 77.65±1.9 | 93.38±0.2 | 96.51±0.1 | | ASPEST (ours) | 52.10±4.0 | 89.22±0.9 | 98.70±0.4 | 76.10±1.5 | 89.62±0.4 | 93.92±0.3 | 88.84±1.0 | 96.62±0.2 | 98.06±0.1 | | Dataset | CIFAR-10→CINIC-10 | | | | | | | | | |-----------------|---------------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 90% ↑ | acc|cov ≥ 90% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | SR+Uniform | 57.43±0.2 | 57.15±0.6 | 58.37±0.7 | 75.67±0.2 | 75.69±0.1 | 76.11±0.3 | 89.77±0.0 | 89.81±0.1 | 90.09±0.2 | | SR+Confidence | 57.96±0.6 | 57.05±0.7 | 61.11±1.1 | 76.49±0.2 | 76.87±0.2 | 78.77±0.4 | 90.00±0.2 | 89.92±0.2 | 90.91±0.3 | | SR+Entropy | 57.78±0.7 | 57.07±1.4 | 61.07±0.4 | 76.57±0.3 | 76.71±0.5 | 78.85±0.2 | 90.01±0.2 | 89.94±0.3 | 90.88±0.0 | | SR+Margin | 57.72±0.8 | 57.98±0.7 | 61.71±0.2 | 76.24±0.2 | 76.90±0.2 | 78.42±0.2 | 89.95±0.2 | 90.14±0.1 | 91.02±0.0 | | SR+kCG | 57.90±0.5 | 57.81±0.7 | 60.36±0.3 | 75.59±0.1 | 75.73±0.2 | 76.68±0.2 | 89.78±0.1 | 89.79±0.2 | 90.41±0.2 | | SR+CLUE | 57.29±0.5 | 58.89±0.5 | 62.28±0.2 | 75.74±0.2 | 76.68±0.3 | 78.10±0.2 | 89.67±0.2 | 90.15±0.1 | 91.03±0.1 | | SR+BADGE | 58.58±0.6 | 58.63±0.3 | 61.95±0.4 | 76.33±0.5 | 76.58±0.1 | 78.26±0.2 | 90.05±0.2 | 90.16±0.1 | 90.99±0.0 | | DE+Uniform | 58.06±0.3 | 58.72±0.1 | 59.54±0.3 | 76.65±0.1 | 77.06±0.2 | 77.46±0.1 | 90.26±0.1 | 90.45±0.1 | 90.73±0.1 | | DE+Entropy | 58.91±0.6 | 60.96±0.2 | 63.85±0.2 | 77.66±0.1 | 79.14±0.1 | 80.82±0.2 | 90.55±0.1 | 91.16±0.1 | 91.89±0.0 | | DE+Confidence | 58.53±0.3 | 61.03±0.6 | 64.42±0.2 | 77.73±0.2 | 79.00±0.1 | 80.87±0.0 | 90.53±0.0 | 91.11±0.1 | 91.96±0.0 | | DE+Margin | 58.76±0.5 | 61.60±0.5 | 64.92±0.5 | 77.61±0.2 | 78.91±0.1 | 80.59±0.1 | 90.56±0.1 | 91.11±0.1 | 91.98±0.1 | | DE+Avg-KLD | 59.99±0.6 | 62.05±0.3 | 65.02±0.5 | 77.84±0.1 | 79.15±0.0 | 81.04±0.1 | 90.74±0.1 | 91.30±0.1 | 92.10±0.1 | | DE+CLUE | 59.27±0.1 | 61.16±0.4 | 64.42±0.0 | 77.19±0.1 | 78.37±0.2 | 79.44±0.1 | 90.44±0.1 | 91.03±0.1 | 91.74±0.0 | | DE+BADGE | 59.37±0.4 | 61.61±0.1 | 64.53±0.4 | 77.13±0.1 | 78.33±0.2 | 79.44±0.3 | 90.49±0.1 | 91.12±0.0 | 91.78±0.1 | | ASPEST (ours) | 60.38±0.3 | 63.34±0.2 | 66.81±0.3 | 78.23±0.1 | 79.49±0.1 | 81.25±0.1 | 90.95±0.0 | 91.60±0.0 | 92.33±0.1 | Table 9: Results of comparing ASPEST to the baselines on MNIST→SVHN. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. Table 10: Results of comparing ASPEST to the baselines on CIFAR-10→CINIC-10. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. ## F.4 Effect Of Combining Selective Prediction With Active Learning Selective prediction without active learning corresponds to the case where the labeling budget M = 0 and the selected set B∗ = ∅. To make fair comparisons with selective prediction methods without active learning, we define a new coverage metric: $$c o v^{*}(f_{s},\tau)=\mathbb{E}_{\mathbf{x}\sim U_{\mathbf{x}}}\mathbb{I}[g(\mathbf{x})\geq\tau\wedge\mathbf{x}\notin B^{*}]$$ ∗] (33) $\left(\frac{9}{4}\right)$ | Dataset | FMoW | | | | | | | | | |-----------------|-----------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 70% ↑ | acc|cov ≥ 70% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | SR+Uniform | 38.50±0.7 | 42.00±0.5 | 52.34±1.1 | 51.76±0.7 | 54.27±0.2 | 60.31±0.7 | 65.75±0.4 | 67.67±0.3 | 72.73±0.3 | | SR+Confidence | 37.34±0.3 | 42.28±1.2 | 53.72±0.7 | 52.24±0.1 | 55.52±0.5 | 61.76±0.4 | 65.57±0.1 | 68.03±0.5 | 73.14±0.5 | | SR+Entropy | 37.42±0.3 | 42.08±0.2 | 51.18±0.4 | 51.74±0.4 | 54.94±0.2 | 60.62±0.2 | 65.31±0.2 | 68.00±0.1 | 71.99±0.2 | | SR+Margin | 38.40±1.4 | 44.67±0.7 | 55.68±1.5 | 52.88±0.3 | 56.66±0.4 | 62.98±0.7 | 66.11±0.6 | 69.12±0.4 | 73.86±0.5 | | SR+kCG | 36.50±0.8 | 39.76±1.2 | 45.87±0.6 | 49.36±0.7 | 51.45±0.5 | 55.47±0.1 | 64.34±0.5 | 66.21±0.6 | 69.63±0.2 | | SR+CLUE | 38.65±0.7 | 44.50±1.8 | 54.71±0.5 | 52.23±0.4 | 55.54±1.0 | 61.13±0.4 | 65.78±0.3 | 68.76±0.9 | 73.80±0.1 | | SR+BADGE | 40.47±1.5 | 45.65±1.2 | 57.59±0.4 | 53.08±1.0 | 56.63±0.3 | 63.57±0.2 | 66.74±0.8 | 69.43±0.6 | 74.76±0.2 | | DE+Uniform | 44.74±0.4 | 51.57±1.1 | 61.92±0.4 | 56.39±0.5 | 60.01±0.5 | 65.74±0.2 | 69.44±0.3 | 72.48±0.5 | 77.02±0.1 | | DE+Entropy | 43.76±0.3 | 50.52±1.4 | 62.73±0.4 | 56.29±0.3 | 60.31±0.3 | 66.53±0.2 | 69.02±0.1 | 72.10±0.5 | 76.65±0.2 | | DE+Confidence | 45.23±0.6 | 50.11±0.9 | 64.29±0.3 | 57.18±0.4 | 60.46±0.3 | 67.46±0.0 | 69.80±0.3 | 72.11±0.4 | 77.37±0.1 | | DE+Margin | 46.35±0.6 | 54.79±1.3 | 69.70±0.8 | 57.84±0.3 | 62.43±0.5 | 69.87±0.4 | 70.18±0.3 | 73.62±0.3 | 78.88±0.4 | | DE+Avg-KLD | 46.29±0.3 | 53.63±0.8 | 68.18±0.9 | 57.75±0.4 | 61.60±0.3 | 69.11±0.4 | 70.16±0.1 | 73.09±0.2 | 78.48±0.3 | | DE+CLUE | 45.22±0.2 | 49.97±0.3 | 58.05±0.5 | 56.39±0.1 | 59.05±0.1 | 63.23±0.4 | 69.53±0.0 | 71.95±0.1 | 75.72±0.3 | | DE+BADGE | 47.39±0.7 | 53.83±0.7 | 66.45±0.8 | 57.71±0.4 | 61.16±0.2 | 68.13±0.4 | 70.59±0.4 | 73.40±0.3 | 78.66±0.1 | | ASPEST (ours) | 53.05±0.4 | 59.86±0.4 | 76.52±0.6 | 61.18±0.2 | 65.18±0.2 | 72.86±0.3 | 71.12±0.2 | 74.25±0.2 | 79.93±0.1 | | Dataset | Amazon Review | | | | | | | | | |-----------------|-----------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 80% ↑ | acc|cov ≥ 80% ↑ | | AUACC ↑ | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | SR+Uniform | 13.71±11.3 | 24.10±5.3 | 24.87±2.6 | 65.13±0.8 | 66.33±0.6 | 66.26±0.3 | 72.71±1.5 | 73.64±0.7 | 73.53±0.7 | | SR+Confidence | 11.28±8.9 | 17.96±4.0 | 33.19±1.4 | 65.15±0.7 | 66.29±0.4 | 68.94±0.1 | 72.89±0.7 | 73.25±0.7 | 76.17±0.2 | | SR+Entropy | 5.55±7.8 | 13.32±9.5 | 25.47±1.8 | 65.11±1.1 | 66.56±0.7 | 67.31±0.7 | 71.96±1.6 | 72.53±1.1 | 74.19±0.5 | | SR+Margin | 14.48±10.9 | 22.61±4.2 | 28.35±6.1 | 65.75±0.5 | 66.31±0.4 | 68.15±0.4 | 73.25±1.0 | 73.65±0.5 | 75.17±0.8 | | SR+kCG | 20.02±11.0 | 17.02±12.2 | 29.08±4.2 | 64.03±3.1 | 66.17±0.5 | 66.63±1.0 | 72.34±3.2 | 74.35±0.7 | 74.49±1.0 | | SR+CLUE | 4.15±5.9 | 25.15±4.9 | 31.88±2.1 | 66.17±0.4 | 66.30±0.4 | 67.12±0.7 | 73.43±0.4 | 74.07±0.7 | 75.29±0.9 | | SR+BADGE | 22.58±0.4 | 23.78±6.4 | 30.71±4.6 | 66.29±0.4 | 66.31±0.6 | 68.58±0.7 | 73.80±0.6 | 74.00±1.0 | 75.76±0.8 | | DE+Uniform | 34.35±1.4 | 33.15±1.1 | 36.55±1.8 | 68.13±0.4 | 68.12±0.6 | 68.88±0.2 | 76.20±0.3 | 76.16±0.4 | 77.07±0.3 | | DE+Entropy | 31.74±1.4 | 36.29±1.6 | 40.33±1.7 | 68.19±0.3 | 69.44±0.2 | 71.27±0.3 | 75.98±0.4 | 77.10±0.3 | 78.53±0.3 | | DE+Confidence | 35.12±1.8 | 34.48±1.4 | 40.46±0.5 | 69.07±0.3 | 69.47±0.2 | 71.08±0.2 | 76.63±0.2 | 76.87±0.3 | 78.27±0.1 | | DE+Margin | 33.42±1.3 | 35.03±1.3 | 41.20±0.4 | 68.45±0.3 | 69.30±0.2 | 70.88±0.1 | 76.18±0.2 | 76.91±0.3 | 78.31±0.1 | | DE+Avg-KLD | 33.03±1.5 | 38.55±3.2 | 41.75±1.8 | 68.63±0.3 | 69.95±0.4 | 71.10±0.3 | 76.21±0.4 | 77.62±0.6 | 78.62±0.3 | | DE+CLUE | 33.92±3.0 | 35.27±1.4 | 34.83±3.1 | 68.09±0.3 | 68.07±0.3 | 68.40±0.6 | 76.27±0.6 | 76.65±0.3 | 76.69±0.7 | | DE+BADGE | 32.23±3.7 | 36.18±1.5 | 40.58±3.3 | 68.34±0.4 | 68.87±0.2 | 70.29±0.3 | 76.13±0.7 | 77.09±0.2 | 78.44±0.5 | | ASPEST (ours) | 38.44±0.7 | 40.96±0.8 | 45.77±0.1 | 69.31±0.3 | 70.17±0.2 | 71.60±0.2 | 77.69±0.1 | 78.35±0.2 | 79.51±0.2 | Table 11: Results of comparing ASPEST to the baselines on FMoW. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. Table 12: Results of comparing ASPEST to the baselines on Amazon Review. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. The range of cov∗(fs, τ ) is [0, 1 − M n ], where M = |B∗| and n = |UX|. If we use a larger labeling budget M for active learning, then the upper bound of cov∗(fs, τ ) will be smaller. Thus, in order to beat selective classification methods without active learning, active selective prediction methods need to use a small labeling budget to achieve significant accuracy and coverage improvement. We still use the accuracy metric defined in (4). We then define a new maximum coverage at a target accuracy ta metric as: $$\operatorname*{max}_{\tau}\quad c o v^{*}(f_{s},\tau),\quad s.t.\quad a c c(f_{s},\tau)\geq t_{a}$$ τcov∗(fs, τ ), s.t. acc(fs, τ ) ≥ ta (34) We denote this metric as cov∗|acc ≥ ta. We also measure the accuracy of f on the remaining unlabeled test data for different approaches. The results under these metrics are shown in Table 3 (MNIST→SVHN), Table 17 (CIFAR-10→CINIC-10 and Otto), Table 18 (FMoW and Amazon Review) and Table 19 (DomainNet). The results show that the coverage achieved by the selective prediction baselines SR and DE is usually low and the active learning baselines Margin, kCG, CLUE and BADGE fail to achieve the target accuracy with a labeling budget of 1K. $$(34)$$ | Dataset | DomainNet R→C (easy) | | | | | | | | | |-----------------|------------------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 80% ↑ | acc|cov ≥ 80% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | SR+Uniform | 25.56±0.6 | 27.68±0.8 | 29.86±0.0 | 43.63±0.4 | 45.57±0.3 | 47.27±0.4 | 63.31±0.4 | 65.11±0.5 | 66.70±0.2 | | SR+Confidence | 25.96±0.2 | 27.80±1.2 | 32.51±1.3 | 44.90±0.8 | 47.26±0.4 | 52.04±0.8 | 64.20±0.6 | 65.88±0.6 | 69.70±0.7 | | SR+Entropy | 25.44±1.0 | 27.79±0.4 | 33.51±1.1 | 44.46±0.7 | 46.96±0.3 | 52.25±0.5 | 63.52±0.6 | 65.72±0.2 | 70.03±0.5 | | SR+Margin | 26.28±1.2 | 27.77±1.0 | 32.92±0.4 | 45.24±1.0 | 47.12±0.7 | 52.29±0.4 | 64.37±0.8 | 65.91±0.6 | 70.01±0.4 | | SR+kCG | 21.12±0.3 | 21.79±0.4 | 23.43±0.5 | 39.19±0.1 | 40.59±0.4 | 41.11±0.3 | 58.88±0.0 | 60.11±0.4 | 60.89±0.1 | | SR+CLUE | 27.17±0.8 | 29.78±0.8 | 34.82±0.6 | 44.57±0.7 | 46.79±0.1 | 49.70±0.3 | 64.38±0.6 | 66.47±0.3 | 69.59±0.1 | | SR+BADGE | 27.78±0.8 | 30.78±0.6 | 36.00±0.6 | 45.36±0.6 | 48.43±0.6 | 53.00±0.4 | 64.90±0.5 | 67.56±0.4 | 71.39±0.4 | | DE+Uniform | 30.82±0.8 | 33.05±0.4 | 36.80±0.2 | 48.19±0.3 | 50.09±0.3 | 52.98±0.5 | 67.60±0.4 | 69.31±0.3 | 71.64±0.4 | | DE+Entropy | 29.13±0.9 | 34.07±0.3 | 40.82±0.3 | 48.67±0.4 | 51.66±0.2 | 57.81±0.2 | 67.48±0.3 | 70.05±0.2 | 74.64±0.2 | | DE+Confidence | 29.90±0.8 | 33.73±0.2 | 40.80±0.2 | 48.60±0.3 | 52.03±0.3 | 58.43±0.1 | 67.45±0.3 | 70.19±0.2 | 74.80±0.1 | | DE+Margin | 31.82±1.3 | 35.68±0.2 | 43.39±0.7 | 50.12±0.4 | 53.19±0.4 | 59.17±0.2 | 68.85±0.4 | 71.29±0.3 | 75.79±0.3 | | DE+Avg-KLD | 32.23±0.2 | 36.09±0.6 | 44.00±0.5 | 49.81±0.3 | 53.38±0.3 | 58.93±0.1 | 68.73±0.2 | 71.40±0.2 | 75.73±0.2 | | DE+CLUE | 30.80±0.3 | 33.04±0.4 | 35.52±0.2 | 48.56±0.3 | 49.91±0.3 | 51.40±0.2 | 67.82±0.2 | 69.10±0.2 | 70.62±0.2 | | DE+BADGE | 30.16±1.3 | 36.18±0.3 | 43.34±0.3 | 49.78±0.3 | 53.26±0.1 | 58.65±0.4 | 68.46±0.3 | 71.35±0.2 | 75.37±0.3 | | ASPEST (ours) | 37.38±0.1 | 39.98±0.3 | 48.29±1.0 | 54.56±0.3 | 56.95±0.1 | 62.69±0.2 | 71.61±0.2 | 73.27±0.2 | 77.40±0.4 | | Dataset | DomainNet R→P (medium) | | | | | | | | | |-----------------|--------------------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 70% ↑ | acc|cov ≥ 70% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | SR+Uniform | 21.01±1.0 | 21.35±0.3 | 22.64±0.5 | 36.78±0.6 | 37.18±0.2 | 38.20±0.4 | 51.87±0.7 | 52.31±0.0 | 53.34±0.4 | | SR+Confidence | 20.64±0.6 | 22.15±0.8 | 23.60±0.6 | 37.01±0.3 | 38.46±0.7 | 40.23±0.4 | 51.77±0.3 | 53.33±0.8 | 54.80±0.5 | | SR+Entropy | 20.76±0.7 | 22.11±0.3 | 23.56±0.3 | 37.09±0.2 | 38.38±0.3 | 40.30±0.1 | 51.86±0.4 | 53.29±0.3 | 54.81±0.2 | | SR+Margin | 21.43±0.4 | 23.29±0.3 | 24.70±1.0 | 37.21±0.2 | 39.15±0.4 | 40.81±0.4 | 52.33±0.1 | 54.09±0.3 | 55.70±0.4 | | SR+kCG | 17.33±0.4 | 17.62±0.2 | 18.49±0.2 | 33.97±0.3 | 34.12±0.1 | 34.36±0.1 | 48.61±0.5 | 48.65±0.2 | 49.25±0.2 | | SR+CLUE | 21.15±0.6 | 22.49±0.5 | 24.84±0.7 | 36.96±0.2 | 37.93±0.5 | 39.31±0.4 | 51.97±0.4 | 53.20±0.5 | 54.84±0.5 | | SR+BADGE | 20.07±0.3 | 22.21±0.5 | 24.92±0.2 | 36.10±0.1 | 38.11±0.4 | 40.40±0.5 | 50.99±0.0 | 53.10±0.4 | 55.40±0.4 | | DE+Uniform | 25.42±0.2 | 26.38±0.2 | 28.83±0.3 | 40.83±0.1 | 41.66±0.2 | 43.93±0.2 | 55.86±0.1 | 56.62±0.1 | 58.80±0.2 | | DE+Entropy | 25.74±0.4 | 27.11±0.4 | 30.39±0.1 | 41.34±0.1 | 42.92±0.3 | 45.92±0.3 | 56.06±0.2 | 57.51±0.3 | 60.10±0.2 | | DE+Confidence | 25.69±0.4 | 27.38±0.7 | 30.47±0.1 | 41.45±0.2 | 43.12±0.3 | 45.88±0.1 | 56.13±0.2 | 57.68±0.3 | 60.20±0.2 | | DE+Margin | 25.78±0.3 | 27.88±0.5 | 31.03±0.4 | 41.26±0.2 | 43.13±0.3 | 46.23±0.4 | 56.23±0.2 | 57.90±0.3 | 60.49±0.3 | | DE+Avg-KLD | 26.30±0.7 | 28.00±0.1 | 31.97±0.2 | 41.80±0.3 | 43.17±0.1 | 46.32±0.2 | 56.65±0.3 | 57.99±0.1 | 60.82±0.2 | | DE+CLUE | 25.38±0.6 | 26.65±0.4 | 27.89±0.1 | 40.86±0.3 | 41.62±0.2 | 42.46±0.1 | 55.79±0.4 | 56.65±0.2 | 57.71±0.1 | | DE+BADGE | 26.27±0.7 | 27.69±0.1 | 31.84±0.2 | 42.02±0.6 | 43.41±0.2 | 46.37±0.1 | 56.67±0.5 | 58.03±0.1 | 60.84±0.1 | | ASPEST (ours) | 29.69±0.1 | 32.50±0.3 | 35.46±0.6 | 44.96±0.1 | 46.77±0.2 | 49.42±0.1 | 58.74±0.0 | 60.36±0.0 | 62.84±0.2 | Table 13: Results of comparing ASPEST to the baselines on DomainNet R→C. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. Table 14: Results of comparing ASPEST to the baselines on DomainNet R→P. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. In contrast, the proposed active selective prediction method ASPEST achieves the target accuracy with a much higher coverage. ## F.5 Effect Of Joint Training In the problem setup, we assume that we have access to the training dataset Dtr and can use joint training to improve selective prediction performance. In this section, we perform experiments to study the effect of joint training and the effect of the loss coefficient λ when performing joint training. We consider three active selective prediction methods: SR+margin (Algorithm 1 with margin sampling), DE+margin (Algorithm 2 with margin sampling), and ASPEST (Algorithm 3). We consider λ ∈ {0, 0.5, 1.0, 2.0}. When λ = 0, we don't use joint training; when λ > 0, we use joint training. The results are shown in Table 20. From the results, we can see that using joint training (i.e., when λ > 0) can improve performance, especially when the labeling budget is small. Also, setting a too large value for λ (e.g., λ = 2) will lead to worse performance. Setting λ = 0.5 or 1 usually leads to better performance. In our experiments, we simply set λ = 1 by default. | Dataset | DomainNet R→S (hard) | | | | | | | | | |-----------------|------------------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 70% ↑ | acc|cov ≥ 70% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | SR+Uniform | 12.12±0.7 | 12.42±0.4 | 15.88±0.2 | 27.01±0.6 | 27.74±0.3 | 31.29±0.3 | 41.12±0.8 | 41.89±0.2 | 46.17±0.3 | | SR+Confidence | 11.06±1.1 | 11.48±0.5 | 14.49±1.5 | 26.53±1.4 | 27.98±0.2 | 31.31±0.7 | 40.26±1.6 | 41.65±0.2 | 45.46±1.1 | | SR+Entropy | 10.91±0.3 | 12.45±0.6 | 14.65±0.6 | 26.84±0.5 | 28.72±0.5 | 31.07±0.6 | 40.47±0.6 | 42.61±0.8 | 45.31±0.4 | | SR+Margin | 12.23±0.4 | 13.06±0.4 | 15.31±0.4 | 27.87±0.2 | 29.19±0.4 | 31.51±0.8 | 41.91±0.3 | 43.22±0.4 | 45.97±0.8 | | SR+kCG | 9.03±0.2 | 9.76±0.2 | 11.41±0.2 | 23.32±0.4 | 24.06±0.4 | 25.68±0.4 | 36.63±0.3 | 37.57±0.4 | 39.80±0.3 | | SR+CLUE | 12.39±0.3 | 14.17±1.0 | 15.80±0.8 | 27.82±0.4 | 29.68±0.4 | 30.62±0.8 | 42.00±0.4 | 44.19±0.7 | 45.58±0.9 | | SR+BADGE | 12.18±0.9 | 13.13±1.0 | 15.83±0.7 | 27.68±1.0 | 28.96±0.7 | 32.00±0.4 | 41.72±1.1 | 43.28±0.9 | 46.60±0.6 | | DE+Uniform | 15.91±0.5 | 17.55±0.4 | 21.33±0.3 | 31.37±0.5 | 32.57±0.4 | 36.12±0.2 | 46.28±0.5 | 47.79±0.4 | 51.64±0.2 | | DE+Entropy | 13.70±0.3 | 16.31±0.5 | 19.58±0.4 | 30.38±0.4 | 32.45±0.2 | 36.18±0.2 | 44.79±0.5 | 47.15±0.2 | 50.87±0.3 | | DE+Confidence | 13.73±0.2 | 16.21±0.2 | 19.22±0.4 | 30.55±0.3 | 33.02±0.1 | 36.29±0.5 | 45.05±0.3 | 47.59±0.0 | 50.84±0.4 | | DE+Margin | 14.99±0.2 | 17.45±0.4 | 21.74±0.7 | 31.67±0.5 | 33.51±0.5 | 37.88±0.3 | 46.38±0.5 | 48.44±0.5 | 52.78±0.4 | | DE+Avg-KLD | 15.75±0.5 | 18.14±0.7 | 22.15±0.3 | 31.36±0.2 | 33.79±0.2 | 37.96±0.2 | 46.29±0.1 | 48.77±0.3 | 53.02±0.3 | | DE+CLUE | 14.76±0.5 | 17.38±0.1 | 19.75±0.4 | 31.05±0.4 | 32.58±0.2 | 34.61±0.4 | 45.80±0.3 | 47.74±0.1 | 50.09±0.2 | | DE+BADGE | 14.97±0.1 | 17.49±0.3 | 21.71±0.3 | 31.35±0.2 | 33.46±0.1 | 37.35±0.3 | 46.03±0.1 | 48.31±0.1 | 52.33±0.2 | | ASPEST (ours) | 17.86±0.4 | 20.42±0.4 | 25.87±0.4 | 35.17±0.1 | 37.28±0.3 | 41.46±0.2 | 49.62±0.1 | 51.61±0.4 | 55.90±0.2 | | Dataset | | Otto | | | | | | | | |-----------------|-----------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 80% ↑ | acc|cov ≥ 80% ↑ | | AUACC ↑ | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | SR+Uniform | 63.58±0.7 | 64.06±0.4 | 67.49±0.9 | 73.56±0.3 | 73.57±0.6 | 75.21±0.2 | 84.46±0.2 | 84.61±0.3 | 85.72±0.2 | | SR+Confidence | 69.63±1.7 | 73.41±0.6 | 84.19±0.5 | 75.96±0.5 | 77.57±0.2 | 81.39±0.2 | 85.91±0.3 | 86.86±0.1 | 88.93±0.1 | | SR+Entropy | 67.79±0.8 | 73.83±1.0 | 83.12±0.7 | 75.43±0.4 | 77.91±0.3 | 81.07±0.2 | 85.41±0.3 | 86.94±0.2 | 88.86±0.1 | | SR+Margin | 68.10±0.1 | 74.10±0.4 | 82.53±0.2 | 75.52±0.0 | 77.66±0.1 | 80.93±0.1 | 85.56±0.1 | 86.99±0.1 | 88.83±0.1 | | SR+kCG | 64.84±0.7 | 62.90±1.1 | 59.85±1.0 | 73.75±0.3 | 73.03±0.2 | 71.90±0.3 | 85.08±0.2 | 84.67±0.2 | 83.79±0.3 | | SR+CLUE | 68.21±1.2 | 70.85±0.6 | 78.26±0.9 | 75.26±0.5 | 76.32±0.2 | 79.30±0.3 | 85.82±0.3 | 86.69±0.2 | 88.53±0.2 | | SR+BADGE | 67.23±1.0 | 73.52±0.2 | 83.17±0.4 | 74.74±0.3 | 77.43±0.2 | 81.20±0.2 | 85.41±0.3 | 87.10±0.2 | 89.25±0.1 | | DE+Uniform | 70.74±0.5 | 72.20±0.6 | 75.58±0.5 | 76.40±0.1 | 77.06±0.2 | 78.35±0.2 | 86.78±0.1 | 87.26±0.1 | 88.11±0.1 | | DE+Entropy | 75.71±0.3 | 80.91±0.2 | 92.62±0.2 | 78.44±0.1 | 80.29±0.1 | 84.05±0.1 | 87.87±0.1 | 88.77±0.1 | 90.99±0.1 | | DE+Confidence | 75.52±0.2 | 81.69±0.7 | 92.15±0.9 | 78.28±0.1 | 80.49±0.2 | 83.83±0.1 | 87.84±0.1 | 89.05±0.1 | 90.98±0.1 | | DE+Margin | 75.49±0.8 | 81.36±0.8 | 92.49±0.4 | 78.41±0.3 | 80.50±0.2 | 84.06±0.2 | 87.89±0.2 | 89.10±0.2 | 90.95±0.2 | | DE+Avg-KLD | 75.91±0.2 | 80.97±0.5 | 91.94±0.8 | 78.50±0.1 | 80.33±0.2 | 83.80±0.2 | 87.89±0.0 | 89.06±0.1 | 90.98±0.1 | | DE+CLUE | 69.66±0.5 | 70.52±0.1 | 70.17±0.4 | 76.09±0.3 | 76.32±0.1 | 76.31±0.2 | 86.67±0.1 | 87.11±0.0 | 87.06±0.1 | | DE+BADGE | 73.23±0.2 | 77.89±0.6 | 86.32±0.5 | 77.33±0.1 | 79.21±0.3 | 82.32±0.2 | 87.55±0.1 | 88.75±0.1 | 90.58±0.0 | | ASPEST (ours) | 77.85±0.2 | 84.20±0.6 | 94.26±0.6 | 79.28±0.1 | 81.40±0.1 | 84.62±0.1 | 88.28±0.1 | 89.61±0.1 | 91.49±0.0 | | Dataset | CIFAR-10→CINIC-10 | Otto | | | | |-----------------------------|---------------------|-----------------|-------------------|-----------------|-----------| | Method | cov∗ |acc ≥ 90% ↑ | Accuracy of f ↑ | cov∗ |acc ≥ 80% ↑ | Accuracy of f ↑ | | | Selective Prediction | SR (M=0) | 57.43±0.0 | 71.05±0.0 | 62.90±0.0 | 66.09±0.0 | | DE (M=0) | 56.64±0.2 | 71.33±0.1 | 67.69±0.4 | 68.12±0.3 | | | Margin (M=1000) | N/A | 72.74±0.1 | N/A | 70.19±0.2 | | | kCG (M=1000) | N/A | 71.16±0.1 | N/A | 65.88±0.2 | | | Active Learning | CLUE (M=1000) | N/A | 72.32±0.2 | N/A | 68.64±0.2 | | BADGE (M=1000) | N/A | 72.11±0.1 | N/A | 69.80±0.4 | | | Active Selective Prediction | ASPEST (M=1000) | 61.23±0.2 | 74.89±0.1 | 77.40±0.5 | 74.13±0.1 | Table 15: Results of comparing ASPEST to the baselines on DomainNet R→S. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. Table 16: Results of comparing ASPEST to the baselines on Otto. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. Table 17: Results on CIFAR-10→CINIC-10 and Otto for studying the effect of combining selective prediction with active learning. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. | Dataset | FMoW | Amazon Review | | | | |-----------------------------|-------------------|-----------------|-------------------|-----------------|-----------| | Method | cov∗ |acc ≥ 70% ↑ | Accuracy of f ↑ | cov∗ |acc ≥ 80% ↑ | Accuracy of f ↑ | | | Selective Prediction | SR (M=0) | 32.39±0.0 | 38.01±0.0 | 26.79±0.0 | 61.40±0.0 | | DE (M=0) | 37.58±0.3 | 41.08±0.0 | 35.81±1.9 | 63.89±0.1 | | | Margin (M=1000) | N/A | 45.17±0.5 | N/A | 62.64±0.6 | | | kCG (M=1000) | N/A | 40.20±0.3 | N/A | 62.03±0.3 | | | Active Learning | CLUE (M=1000) | N/A | 43.75±0.7 | N/A | 62.32±0.4 | | BADGE (M=1000) | N/A | 44.73±0.3 | N/A | 62.44±0.5 | | | Active Selective Prediction | ASPEST (M=1000) | 57.15±0.4 | 52.42±0.1 | 39.14±0.8 | 65.47±0.2 | | Dataset | DomainNet R→C (easy) | DomainNet R→P (medium) | | DomainNet R→S (hard) | | | | |---------------------------------------------|-------------------------------------------------------------------------------------------------------|--------------------------|-----------|------------------------|-----------|-----------|-----------| | Method | cov∗ |acc ≥ 80% ↑ Accuracy of f ↑ cov∗ |acc ≥ 70% ↑ Accuracy of f ↑ cov∗ |acc ≥ 70% ↑ Accuracy of f ↑ | | | | | | | | Selective Prediction | SR (M=0) | 21.50±0.0 | 33.37±0.0 | 18.16±0.0 | 26.29±0.0 | 7.16±0.0 | 15.99±0.0 | | DE (M=0) | 26.15±0.2 | 37.12±0.1 | 22.44±0.2 | 29.73±0.1 | 9.90±0.4 | 19.15±0.0 | | | Margin (M=1000) | N/A | 39.42±0.6 | N/A | 29.83±0.3 | N/A | 22.14±0.3 | | | Active Learning | kCG (M=1000) | N/A | 33.74±0.4 | N/A | 25.92±0.0 | N/A | 18.14±0.3 | | CLUE (M=1000) | N/A | 38.97±0.1 | N/A | 28.88±0.5 | N/A | 22.44±0.3 | | | BADGE (M=1000) | N/A | 40.32±0.5 | N/A | 28.91±0.4 | N/A | 21.87±0.5 | | | Active Selective Prediction ASPEST (M=1000) | 37.24±0.3 | 47.76±0.1 | 31.01±0.3 | 35.69±0.1 | 19.45±0.3 | 28.16±0.3 | | Table 18: Results on FMoW and Amazon Review for studying the effect of combining selective prediction with active learning. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. Table 19: Results on DomainNet R→C, R→P and R→S for studying the effect of combining selective prediction with active learning. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. ## F.6 Effect Of The Number Of Rounds T In this section, we study the effect of the number of rounds T in active learning. The results in Table 21 show that larger T usually leads to better performance, and the proposed method ASPEST has more improvement as we increase T compared to SR+Margin and DE+Margin. Also, when T is large enough, the improvement becomes minor (or can even be worse). Considering that in practice, we might not be able to set a large T due to resource constraints, we thus set T = 10 by default. ## F.7 Effect Of The Number Of Models N In The Ensemble In this section, we study the effect of the number of models N in the ensemble for DE+Margin and ASPEST. The results in Table 22 show that larger N usually leads to better results. However, larger N also means a larger computational cost. In our experiments, we simply set N = 5 by default. ## F.8 Effect Of The Upper Bound In Pseudo-Labeled Set Construction When constructing the pseudo-labeled set R using Eq. (9), we exclude those test data points with confidence equal to 1. In this section, we study whether setting such an upper bound can improve performance. The results in Table 23 show that when the labeling budget is small, setting such an upper bound can improve performance significantly. However, when the labeling budget is large, setting such an upper bound may not improve the performance. Since we focus on the low labeling budget region, we decide to set such an upper bound for the proposed ASPEST method. ## F.9 Ensemble Accuracy After Each Round Of Active Learning We evaluate the accuracy of the ensemble model ft in the ASPEST algorithm after the t-th round of active learning. Recall that ft contains N models f 1 t , . . . , f N t and ft(x) = arg maxk∈Y 1 N PN j=1 f j t (x | k). The results in Table 24 show that after each round of active learning, the accuracy of the ensemble model will be improved significantly. | Dataset | MNIST→SVHN | DomainNet R→C (easy) | | | |---------------------|--------------|------------------------|-----------|-----------| | Metric | AUACC ↑ | AUACC ↑ | | | | Labeling Budget | 100 | 500 | 500 | 1000 | | SR+Margin (λ = 0) | 71.90±3.1 | 90.56±0.8 | 60.05±0.9 | 60.34±1.2 | | SR+Margin (λ = 0.5) | 75.54±1.7 | 91.43±0.5 | 64.99±0.7 | 66.81±0.5 | | SR+Margin (λ = 1) | 76.79±0.5 | 91.24±0.5 | 64.37±0.8 | 65.91±0.6 | | SR+Margin (λ = 2) | 72.71±2.5 | 90.80±0.3 | 64.17±0.3 | 66.21±0.2 | | DE+Margin (λ = 0) | 77.12±0.5 | 94.26±0.5 | 66.86±0.5 | 69.29±0.6 | | DE+Margin (λ = 0.5) | 79.35±1.4 | 94.22±0.2 | 69.28±0.3 | 71.60±0.2 | | DE+Margin (λ = 1) | 78.59±1.4 | 94.31±0.6 | 68.85±0.4 | 71.29±0.3 | | DE+Margin (λ = 2) | 77.64±2.3 | 93.81±0.4 | 68.54±0.1 | 71.28±0.2 | | ASPEST (λ = 0) | 84.48±2.5 | 96.99±0.2 | 68.61±1.2 | 73.21±1.2 | | ASPEST (λ = 0.5) | 86.46±3.1 | 97.01±0.0 | 71.53±0.1 | 73.69±0.1 | | ASPEST (λ = 1) | 88.84±1.0 | 96.62±0.2 | 71.61±0.2 | 73.27±0.2 | | ASPEST (λ = 2) | 85.46±1.7 | 96.43±0.1 | 70.54±0.3 | 73.02±0.1 | | Dataset | MNIST→SVHN | DomainNet R→C (easy) | | | |------------------|--------------|------------------------|-----------|-----------| | Metric | AUACC ↑ | AUACC ↑ | | | | Labeling Budget | 100 | 500 | 500 | 1000 | | SR+Margin (T=1) | 63.10±2.7 | 75.42±3.6 | 65.16±0.4 | 66.76±0.3 | | SR+Margin (T=2) | 68.09±3.1 | 87.45±1.6 | 64.64±0.8 | 66.91±0.1 | | SR+Margin (T=5) | 74.87±1.7 | 91.32±0.5 | 64.35±0.2 | 66.76±0.3 | | SR+Margin (T=10) | 76.79±0.5 | 91.24±0.5 | 64.37±0.8 | 65.91±0.6 | | SR+Margin (T=20) | 72.81±1.5 | 90.34±1.3 | 63.65±0.6 | 66.08±0.4 | | DE+Margin (T=1) | 69.85±0.5 | 82.74±2.1 | 68.39±0.2 | 70.55±0.0 | | DE+Margin (T=2) | 75.25±1.0 | 90.90±1.0 | 68.79±0.2 | 70.95±0.5 | | DE+Margin (T=5) | 78.41±0.2 | 93.26±0.3 | 68.80±0.2 | 71.21±0.2 | | DE+Margin (T=10) | 78.59±1.4 | 94.31±0.6 | 68.85±0.4 | 71.29±0.3 | | DE+Margin (T=20) | 76.84±0.4 | 94.67±0.2 | 68.50±0.5 | 71.39±0.2 | | ASPEST (T=1) | 62.53±1.0 | 80.72±1.5 | 69.44±0.1 | 71.79±0.2 | | ASPEST (T=2) | 75.08±1.4 | 89.70±0.7 | 70.68±0.2 | 72.56±0.3 | | ASPEST (T=5) | 81.57±1.8 | 95.43±0.1 | 71.23±0.1 | 73.19±0.1 | | ASPEST (T=10) | 88.84±1.0 | 96.62±0.2 | 71.61±0.2 | 73.27±0.2 | | ASPEST (T=20) | 91.26±0.9 | 97.32±0.1 | 70.57±0.4 | 73.32±0.3 | Table 20: Ablation study results for the effect of using joint training and the effect of the loss coefficient λ. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. Table 21: Ablation study results for the effect of the number of rounds T. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. ## F.10 Empirical Analysis For Checkpoint Ensemble In this section, we analyze why the proposed checkpoint ensemble can improve selective prediction performance. We postulate the rationales: (1) the checkpoint ensemble can help with generalization; (2) the checkpoint ensemble can help with reducing overconfident wrong predictions. Regarding (1), when fine-tuning the model on the small set of selected labeled test data, we hope that the fine-tuned model could generalize to remaining unlabeled test data. However, since the selected test set is small, we might have an overfitting issue. So possibly some intermediate checkpoints along the training path achieve better generalization than the end checkpoint. By using checkpoint ensemble, we might get an | Dataset | MNIST→SVHN | DomainNet R→C (easy) | | | |-----------------|--------------|------------------------|-----------|-----------| | Metric | AUACC ↑ | AUACC ↑ | | | | Labeling Budget | 100 | 500 | 500 | 1000 | | DE+Margin (N=2) | 67.41±3.9 | 91.20±0.8 | 65.82±0.5 | 67.72±0.4 | | DE+Margin (N=3) | 77.53±1.5 | 93.41±0.1 | 67.54±0.4 | 69.61±0.2 | | DE+Margin (N=4) | 74.46±2.7 | 93.65±0.3 | 68.09±0.2 | 70.65±0.3 | | DE+Margin (N=5) | 78.59±1.4 | 94.31±0.6 | 68.85±0.4 | 71.29±0.3 | | DE+Margin (N=6) | 79.34±0.7 | 94.40±0.1 | 68.63±0.2 | 71.65±0.3 | | DE+Margin (N=7) | 80.30±1.5 | 93.97±0.2 | 69.41±0.1 | 71.78±0.3 | | DE+Margin (N=8) | 78.91±1.5 | 94.52±0.2 | 69.00±0.0 | 71.88±0.4 | | ASPEST (N=2) | 80.38±1.2 | 96.26±0.0 | 69.14±0.3 | 71.36±0.3 | | ASPEST (N=3) | 84.86±1.0 | 96.60±0.2 | 69.91±0.2 | 72.25±0.2 | | ASPEST (N=4) | 84.94±0.3 | 96.76±0.1 | 70.68±0.2 | 73.09±0.2 | | ASPEST (N=5) | 88.84±1.0 | 96.62±0.2 | 71.61±0.2 | 73.27±0.2 | | ASPEST (N=6) | 84.51±0.5 | 96.66±0.2 | 71.20±0.2 | 73.42±0.3 | | ASPEST (N=7) | 86.70±2.3 | 96.90±0.2 | 71.16±0.2 | 73.50±0.1 | | ASPEST (N=8) | 88.59±0.9 | 97.01±0.1 | 71.62±0.3 | 73.76±0.2 | | Dataset | MNIST→SVHN | DomainNet R→C (easy) | | | |----------------------------|--------------|------------------------|-----------|-----------| | Metric | AUACC ↑ | AUACC ↑ | | | | Labeling Budget | 100 | 500 | 500 | 1000 | | ASPEST without upper bound | 86.95±1.4 | 96.59±0.1 | 71.39±0.1 | 73.52±0.2 | | ASPEST | 88.84±1.0 | 96.62±0.2 | 71.61±0.2 | 73.27±0.2 | Table 22: Ablation study results for the effect of the number of models N in the ensemble. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. Table 23: Ablation study results for the effect of setting an upper bound when constructing the pseudo-labeled set R in ASPEST. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. ensemble that achieves better generalization to remaining unlabeled test data. Although standard techniques like cross-validation and early stopping can also reduce overfitting, they are not suitable in the active selective prediction setup since the amount of labeled test data is small. Regarding (2), when fine-tuning the model on the small set of selected labeled test data, the model can get increasingly confident on the test data. Since there exist high-confidence mis-classified test points, incorporating intermediate checkpoints along the training path into the ensemble can reduce the average confidence of the ensemble on those mis-classified test points. By using checkpoint ensemble, we might get an ensemble that has better confidence estimation for selective prediction on the test data. We perform experiments on the image dataset MNIST→SVHN and the text dataset Amazon Review to verify these two hypotheses. We employ one-round active learning with a labeling budget of 100 samples. We use the margin sampling method for sample selection and fine-tune a single model on the selected labeled test data for 200 epochs. We first evaluate the median confidence of the model on the correctly classified and mis-classified test data respectively when fine-tuning the model on the selected labeled test data. In Figure 4, we show that during fine-tuning, the model gets increasingly confident not only on the correctly classified test data, but also on the mis-classified test data. We then evaluate the Accuracy, the area under the receiver operator characteristic curve (AUROC) and the area under the accuracy-coverage curve (AUACC) metrics of the checkpoints during fine-tuning and the checkpoint ensemble constructed after fine-tuning on the target test dataset. The AUROC metric is equivalent to the probability that a randomly chosen correctly classified input has a higher confidence score | Metric | Ensemble Test Accuracy | | | | |-----------------|--------------------------|----------------------|-------|-------| | Dataset | MNIST→SVHN | DomainNet R→C (easy) | | | | Labeling Budget | 100 | 500 | 500 | 1000 | | Round 0 | 24.67 | 24.87 | 37.33 | 37.46 | | Round 1 | 24.91 | 43.80 | 39.61 | 39.67 | | Round 2 | 37.75 | 54.91 | 41.15 | 41.55 | | Round 3 | 45.62 | 64.15 | 41.97 | 43.24 | | Round 4 | 50.94 | 71.65 | 42.57 | 45.09 | | Round 5 | 56.75 | 77.23 | 43.85 | 45.62 | | Round 6 | 59.82 | 79.97 | 44.20 | 46.60 | | Round 7 | 63.10 | 81.43 | 45.02 | 47.51 | | Round 8 | 67.49 | 82.78 | 45.17 | 48.59 | | Round 9 | 69.93 | 84.70 | 45.80 | 48.66 | | Round 10 | 71.14 | 85.48 | 46.36 | 49.70 | Table 24: Ensemble test accuracy of ASPEST after each round of active learning. All numbers are percentages. ![33_image_0.png](33_image_0.png) Figure 4: Evaluating the median confidence of the model on the correctly classified and mis-classified test data respectively when fine-tuning the model on the selected labeled test data. than a randomly chosen mis-classified input. Thus, the AUROC metric can measure the quality of the confidence score for selective prediction. The results in Figure 5 show that in the fine-tuning path, different checkpoints have different target test accuracy and the end checkpoint may not have the optimal target test accuracy. The checkpoint ensemble can have better target test accuracy than the end checkpoint. Also, in the fine-tuning path, different checkpoints have different confidence estimation (the quality of confidence estimation is measured by the metric AUROC) on the target test data and the end checkpoint may not have the optimal confidence estimation. The checkpoint ensemble can have better confidence estimation than the end checkpoint. Furthermore, in the fine-tuning path, different checkpoints have different selective prediction performance (measured by the metric AUACC) on the target test data and the end checkpoint may not have the optimal selective prediction performance. The checkpoint ensemble can have better selective prediction performance than the end checkpoint. ## F.11 Empirical Analysis For Self-Training In this section, we analyze why the proposed self-training can improve selective prediction performance. Our hypothesis is that after fine-tuning the models on the selected labeled test data, the checkpoint ensemble constructed is less confident on the test data UX compared to the deep ensemble (obtained by ensembling the end checkpoints). Thus, using the softmax outputs of the checkpoint ensemble as soft pseudo-labels for self-training can alleviate the overconfidence issue and improve selective prediction performance. ![34_image_0.png](34_image_0.png) Figure 5: Evaluating the checkpoints during fine-tuning and the checkpoint ensemble constructed after fine-tuning on the target test dataset. We perform experiments on the image dataset MNIST→SVHN and the text dataset Amazon Review to verity this hypothesis. To see the effect of self-training better, we only employ one-round active learning (i.e., only apply one-round self-training) with a labeling budget of 100 samples. We visualize the histogram of the confidence scores on the test data UX for the deep ensemble and the checkpoint ensemble after fine-tuning. We also evaluate the receiver operator characteristic curve (AUROC) and the area under the accuracy-coverage curve (AUACC) metrics of the checkpoint ensemble before and after the self-training. We use the AUROC metric to measure the quality of the confidence score for selective prediction. The results in Figure 6 show that the checkpoint ensemble is less confident on the test data UX compared to the deep ensemble. On the high-confidence region (i.e., confidence≥ η. Recall that η is the confidence threshold used for constructing the pseudo-labeled set R. We set η = 0.9 in our experiments), the checkpoint ensemble is also less confident than the deep ensemble. Besides, the results in Table 25 show that after self-training, both AUROC and AUACC metrics of the checkpoint ensemble are improved significantly. Therefore, the self-training can alleviate the overconfidence issue and improve selective prediction performance. | Dataset | MNIST→SVHN | Amazon Review | | | |----------------------|--------------|-----------------|--------|--------| | Metric | AUROC↑ | AUACC↑ | AUROC↑ | AUACC↑ | | Before self-training | 73.92 | 66.75 | 67.44 | 76.24 | | After self-training | 74.31 | 67.37 | 67.92 | 76.80 | Table 25: Evaluating the AUROC and AUACC metrics of the checkpoint ensemble before and after self-training. All numbers are percentages. ## F.12 Training With Unsupervised Domain Adaptation In this section, we study whether incorporating Unsupervised Domain Adaptation (UDA) techniques into training could improve the selective prediction performance. UDA techniques are mainly proposed to adapt the representation learned on the labeled source domain data to the target domain with unlabeled data from the target domain (Liu et al., 2022). We can easily incorporate those UDA techniques into SR (Algorithm 1), ![35_image_0.png](35_image_0.png) Figure 6: Plot the histogram of the confidence scores on the test data UX for the deep ensemble and the checkpoint ensemble after fine-tuning. DE (Algorithm 2), and the proposed ASPEST (Algorithm 3) by adding unsupervised training losses into the training objectives. We consider the method DE with UDA and the method ASPEST with UDA. The algorithm for DE with UDA is presented in Algorithm 4 and the algorithm for ASPEST with UDA is presented in Algorithm 5. We consider UDA techniques based on representation matching where the goal is to minimize the distance between the distribution of the representation on Dtr and that on UX. Suppose the model f is a composition of a prediction function h and a representation function φ (i.e., f(x) = h(φ(x))). Then LUDA(Dtr, UX; θ) = d(p φ Dtr , p φ UX ), which is a representation matching loss. We consider the representation matching losses from the state-of-the-art UDA methods DANN (Ganin et al., 2016) and CDAN (Long et al., 2018). We evaluate two instantiations of Algorithm 4 - DE with DANN and DE with CDAN, and two instantiations of Algorithm 5 - ASPEST with DANN and ASPEST with CDAN. The values of the hyper-parameters are the same as those described in the paper except that we set ns = 20. For DANN and CDAN, we set the hyperparameter between the source classifier and the domain discriminator to be 0.1. The results are shown in Table 26 (MNIST→SVHN), Table 27 (CIFAR-10→CINIC-10), Table 28 (FMoW), Table 29 (Amazon Review), Table 30 (DomainNet R→C), Table 31 (DomainNet R→P), Table 32 (DomainNet R→S) and Table 33 (Otto). From the results, we can see that ASPEST outperforms (or on par with) DE with DANN and DE with CDAN across different datasets, although ASPEST doesn't use UDA techniques. We further show that by combining ASPEST with UDA, it might achieve even better performance. For example, on MNIST→SVHN, ASPEST with DANN improves the mean AUACC from 96.62% to 97.03% when the labeling budget is 500. However, in some cases, combining ASPEST with DANN or CDAN leads to much worse results. For example, on MNIST→SVHN, when the labeling budget is 100, combining ASPEST with DANN or CDAN will reduce the mean AUACC by over 4%. It might be because in those cases, DANN or CDAN fails to align the representations between the source and target domains. Existing work also show that UDA methods may not have stable performance across different kinds of distribution shifts and sometimes they can even yield accuracy degradation (Johansson et al., 2019; Sagawa et al., 2021). So our findings align with those of existing work. Algorithm 4 DE with Unsupervised Domain Adaptation Input: A training dataset Dtr, An unlabeled test dataset UX, the number of rounds T, the total labeling budget M, a source-trained model ¯f, an acquisition function a(*B, f, g*), the number of models in the ensemble N, the number of initial training epochs ns, and a hyper-parameter λ. Let f j 0 = ¯f for j = 1*, . . . , N*. Fine-tune each model f j 0 in the ensemble via SGD for ns training epochs independently using the following training objective with different randomness: $$\begin{array}{r l}{\operatorname*{min}_{\theta^{j}}}&{{}\mathbb{E}_{(\mathbf{x},y)\in\mathcal{D}^{\mathrm{tr}}}\quad\ell_{C E}(\mathbf{x},y;\theta^{j})+L_{U D A}(\mathcal{D}^{\mathrm{tr}},U_{X};\theta^{j})}\end{array}$$ j) (35) where LUDA is a loss function for unsupervised domain adaptation. Let B0 = ∅. Let gt(x) = maxk∈Y ft(x | k). for t = 1, · · · , T do Select a batch Bt with a size of m = [M T ] from UX for labeling via: $$(35)$$ $$B_{t}=\arg\operatorname*{max}_{B\subset U_{X}\setminus(\cup_{l=0}^{t-1}B_{l}),|B|=m}a(B,f_{t-1},g_{t-1})$$ $$(36)$$ $$(37)$$ a(B, ft−1, gt−1) (36) Use an oracle to assign ground-truth labels to the examples in Bt to get B˜t. Fine-tune each model f j t−1 in the ensemble via SGD independently using the following training objective with different randomness: $$\operatorname*{min}_{\theta^{j}}\quad\mathbb{E}_{(\mathbf{x},y)\in\cup_{i=1}^{\ell}B_{i}}\quad\ell_{C E}(\mathbf{x},y;\theta^{j})+\lambda\cdot\mathbb{E}_{(\mathbf{x},y)\in\mathcal{D}^{\mathrm{tr}}}\quad\ell_{C E}(\mathbf{x},y;\theta^{j})+L_{U D A}(\mathcal{D}^{\mathrm{tr}},U_{X};\theta^{j})$$ j) (37) where θ jis the model parameters of f j t−1 . Let f j t = f j t−1 . end for Output: The classifier f = fT and the selection scoring function g = maxk∈Y f(x | k). Algorithm 5 ASPEST with Unsupervised Domain Adaptation Input: A training set Dtr, a unlabeled test set UX, the number of rounds T, the labeling budget M, the number of models N, the number of initial training epochs ns, a checkpoint epoch ce, a threshold η, a sub-sampling fraction p, and a hyper-parameter λ. Let f j 0 = ¯f for j = 1*, . . . , N*. Set Ne = 0 and P = 0n×K. Fine-tune each f j 0 for ns training epochs using the following training objective: $$(38)$$ $$\operatorname*{min}_{\theta^{j}}\quad\mathbb{E}_{(\mathbf{x},y)\in\mathcal{D}^{\mathrm{tr}}}\quad\ell_{C E}(\mathbf{x},y;\theta^{j})+L_{U D A}(\mathcal{D}^{\mathrm{tr}},U_{X};\theta^{j}),$$ j), (38) where LUDA is a loss function for unsupervised domain adaptation. During fine-tuning, update P and Ne using Eq. (6) every ce training epochs. for t = 1, · · · , T do Select a batch Bt from UX for labeling using the sample selection objective (7). Use an oracle to assign ground-truth labels to the examples in Bt to get B˜t. Set Ne = 0 and P = 0n×K. Fine-tune each f j t−1 using the following training objective: $$\min_{\theta\}\quad\mathbb{E}_{(\mathbf{x},y)\in U_{i=1}^{l}\hat{B}_{l}}\quad\ell_{CE}(\mathbf{x},y;\theta^{j})+\lambda\cdot\mathbb{E}_{(\mathbf{x},y)\in\mathcal{D}^{u}}\quad\ell_{CE}(\mathbf{x},y;\theta^{j})+L_{UDA}(\mathcal{D}^{\mathrm{tr}},U_{X};\theta^{j}),$$ $$,U_{X};\theta^{j}),\qquad(39)$$ During fine-tuning, update P and Ne using Eq (6) every ce training epochs. Let f j t = f j t−1 . Construct the pseudo-labeled set R via Eq (9) and create Rsub by randomly sampling up to [p · n] data points from R. Train each f j t further via SGD using the objective (10) and update P and Ne using Eq (6) every ce training epochs. end for Output: The classifier f(xi) = arg maxk∈Y Pi,k and the selection scoring function g(xi) = maxk∈Y Pi,k. | Dataset | MNIST→SVHN | | | | | | | | | |---------------------------|-----------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 90% ↑ | acc|cov ≥ 90% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 100 | 500 | 1000 | 100 | 500 | 1000 | 100 | 500 | 1000 | | DE with DANN + Uniform | 27.27±1.8 | 72.78±2.0 | 87.05±0.5 | 63.95±1.4 | 82.99±0.8 | 88.64±0.2 | 80.37±0.7 | 93.25±0.4 | 96.05±0.1 | | DE with DANN + Entropy | 11.33±8.2 | 74.04±2.2 | 91.06±1.4 | 58.28±2.1 | 83.64±0.9 | 90.41±0.5 | 74.62±1.6 | 93.45±0.5 | 96.47±0.2 | | DE with DANN + Confidence | 15.68±6.3 | 76.34±3.1 | 93.96±1.2 | 61.32±3.0 | 85.02±0.9 | 91.64±0.4 | 76.43±3.0 | 93.85±0.6 | 96.97±0.3 | | DE with DANN + Margin | 30.64±2.1 | 83.44±0.9 | 96.17±0.5 | 66.79±0.9 | 87.30±0.4 | 92.71±0.2 | 82.14±0.8 | 95.40±0.3 | 97.60±0.1 | | DE with DANN + Avg-KLD | 22.30±3.0 | 78.13±2.1 | 93.42±1.0 | 63.22±2.0 | 85.40±0.8 | 91.47±0.5 | 78.88±1.6 | 94.25±0.5 | 97.02±0.2 | | DE with DANN + CLUE | 16.42±13.6 | 72.27±2.8 | 86.71±0.4 | 61.79±2.7 | 82.72±1.1 | 88.46±0.2 | 77.47±3.4 | 93.33±0.5 | 96.21±0.0 | | DE with DANN + BADGE | 25.41±10.9 | 78.83±1.2 | 90.94±1.1 | 63.93±4.4 | 85.27±0.5 | 90.45±0.5 | 79.82±4.1 | 94.58±0.3 | 96.89±0.1 | | DE with CDAN + Uniform | 28.10±4.8 | 73.15±0.7 | 87.50±0.6 | 63.95±2.7 | 83.10±0.3 | 88.86±0.3 | 80.28±2.2 | 93.44±0.1 | 96.13±0.2 | | DE with CDAN + Entropy | 6.94±9.8 | 74.38±1.5 | 90.77±1.3 | 59.90±2.3 | 84.14±0.4 | 90.32±0.6 | 76.04±2.0 | 93.48±0.3 | 96.38±0.2 | | DE with CDAN + Confidence | 13.47±10.2 | 75.15±2.8 | 92.77±0.7 | 60.98±2.0 | 84.62±0.9 | 91.23±0.3 | 76.19±2.8 | 93.62±0.6 | 96.63±0.1 | | DE with CDAN + Margin | 22.44±3.3 | 81.84±2.5 | 96.07±0.2 | 62.89±3.8 | 86.71±1.0 | 92.64±0.0 | 78.69±2.6 | 94.89±0.5 | 97.57±0.0 | | DE with CDAN + Avg-KLD | 20.23±4.1 | 80.62±1.7 | 93.13±2.5 | 62.23±2.7 | 86.34±0.6 | 91.30±1.0 | 77.68±2.5 | 94.81±0.4 | 96.97±0.4 | | DE with CDAN + CLUE | 7.47±6.4 | 72.61±2.9 | 87.22±0.2 | 57.82±2.9 | 82.50±1.3 | 88.62±0.1 | 73.33±2.3 | 93.38±0.7 | 96.31±0.0 | | DE with CDAN + BADGE | 26.88±3.5 | 79.21±0.1 | 92.50±0.7 | 65.69±1.7 | 85.32±0.1 | 91.18±0.4 | 81.10±1.3 | 94.73±0.1 | 97.17±0.2 | | ASPEST (ours) | 52.10±4.0 | 89.22±0.9 | 98.70±0.4 | 76.10±1.5 | 89.62±0.4 | 93.92±0.3 | 88.84±1.0 | 96.62±0.2 | 98.06±0.1 | | ASPEST with DANN (ours) | 37.90±2.4 | 91.61±0.6 | 99.39±0.4 | 69.45±1.7 | 90.70±0.3 | 94.42±0.4 | 84.55±1.0 | 97.03±0.1 | 98.23±0.1 | | ASPEST with CDAN (ours) | 30.97±11.7 | 91.39±0.6 | 99.50±0.3 | 67.58±3.2 | 90.60±0.3 | 94.46±0.2 | 82.20±3.3 | 96.95±0.1 | 98.26±0.1 | Table 26: Results of evaluating DE with UDA and ASPEST with UDA on MNIST→SVHN. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. | Dataset | CIFAR-10→CINIC-10 | | | | | | | | | |---------------------------|---------------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 90% ↑ | acc|cov ≥ 90% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | DE with DANN + Uniform | 58.85±0.3 | 59.39±0.2 | 60.04±0.1 | 77.06±0.2 | 77.33±0.2 | 77.84±0.1 | 90.40±0.1 | 90.60±0.1 | 90.73±0.1 | | DE with DANN + Entropy | 59.42±0.4 | 60.86±0.3 | 64.52±0.3 | 78.14±0.2 | 79.20±0.1 | 81.31±0.1 | 90.72±0.0 | 91.06±0.1 | 92.02±0.0 | | DE with DANN + Confidence | 59.44±0.6 | 61.08±0.3 | 65.12±0.2 | 78.19±0.1 | 79.38±0.0 | 81.29±0.1 | 90.73±0.1 | 91.26±0.1 | 92.06±0.0 | | DE with DANN + Margin | 59.81±0.3 | 62.26±0.4 | 65.58±0.4 | 78.15±0.0 | 79.25±0.1 | 81.05±0.1 | 90.76±0.1 | 91.30±0.1 | 92.11±0.0 | | DE with DANN + Avg-KLD | 60.50±0.5 | 62.04±0.1 | 65.08±0.2 | 78.32±0.1 | 79.31±0.1 | 81.07±0.0 | 90.89±0.1 | 91.34±0.0 | 92.11±0.0 | | DE with DANN + CLUE | 60.20±0.5 | 61.69±0.2 | 64.08±0.2 | 77.84±0.2 | 78.35±0.2 | 79.38±0.1 | 90.73±0.2 | 91.07±0.1 | 91.63±0.0 | | DE with DANN + BADGE | 60.18±0.4 | 62.15±0.2 | 65.31±0.6 | 77.70±0.1 | 78.54±0.1 | 79.81±0.2 | 90.72±0.1 | 91.19±0.1 | 91.86±0.1 | | DE with CDAN + Uniform | 58.72±0.2 | 59.49±0.5 | 60.28±0.2 | 77.16±0.0 | 77.52±0.1 | 77.90±0.1 | 90.45±0.1 | 90.65±0.0 | 90.78±0.1 | | DE with CDAN + Entropy | 58.73±0.4 | 60.82±0.5 | 64.45±0.2 | 77.95±0.1 | 79.20±0.1 | 81.04±0.1 | 90.57±0.1 | 91.10±0.1 | 91.86±0.1 | | DE with CDAN + Confidence | 59.10±0.6 | 61.03±0.6 | 64.60±0.2 | 77.92±0.0 | 79.26±0.2 | 81.07±0.0 | 90.59±0.0 | 91.10±0.2 | 91.96±0.0 | | DE with CDAN + Margin | 59.88±0.5 | 61.57±0.9 | 64.82±0.4 | 78.09±0.3 | 79.02±0.2 | 80.82±0.1 | 90.73±0.1 | 91.17±0.2 | 91.98±0.1 | | DE with CDAN + Avg-KLD | 60.51±0.1 | 61.71±0.5 | 65.03±0.3 | 78.20±0.2 | 79.29±0.2 | 81.15±0.1 | 90.85±0.0 | 91.19±0.1 | 92.07±0.1 | | DE with CDAN + CLUE | 60.12±0.5 | 61.77±0.3 | 64.06±0.2 | 77.88±0.1 | 78.38±0.2 | 79.42±0.2 | 90.73±0.1 | 91.08±0.1 | 91.64±0.0 | | DE with CDAN + BADGE | 60.28±0.7 | 61.84±0.2 | 65.29±0.3 | 77.68±0.2 | 78.53±0.1 | 79.84±0.2 | 90.73±0.1 | 91.17±0.0 | 91.95±0.1 | | ASPEST (ours) | 60.38±0.3 | 63.34±0.2 | 66.81±0.3 | 78.23±0.1 | 79.49±0.1 | 81.25±0.1 | 90.95±0.0 | 91.60±0.0 | 92.33±0.1 | | ASPEST with DANN (ours) | 61.69±0.2 | 63.58±0.4 | 66.81±0.4 | 78.68±0.1 | 79.68±0.1 | 81.42±0.1 | 91.16±0.1 | 91.66±0.1 | 92.37±0.1 | | ASPEST with CDAN (ours) | 61.00±0.2 | 62.80±0.4 | 66.78±0.1 | 78.56±0.1 | 79.54±0.1 | 81.49±0.0 | 91.13±0.0 | 91.57±0.1 | 92.41±0.0 | | Dataset | FMoW | | | | | | | | | |---------------------------|-----------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 70% ↑ | acc|cov ≥ 70% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | DE with DANN + Uniform | 46.11±0.6 | 51.77±0.3 | 62.76±0.5 | 57.62±0.3 | 60.67±0.4 | 66.21±0.2 | 70.17±0.3 | 72.46±0.3 | 76.83±0.2 | | DE with DANN + Entropy | 44.36±0.7 | 48.19±0.3 | 59.52±0.8 | 56.78±0.1 | 59.51±0.0 | 65.75±0.3 | 69.09±0.2 | 71.02±0.2 | 75.15±0.3 | | DE with DANN + Confidence | 44.46±0.5 | 49.32±0.1 | 61.47±0.3 | 57.04±0.3 | 60.51±0.3 | 66.61±0.1 | 69.14±0.1 | 71.50±0.1 | 75.70±0.1 | | DE with DANN + Margin | 48.09±0.4 | 54.35±0.5 | 70.11±0.4 | 59.07±0.2 | 62.79±0.2 | 70.02±0.1 | 70.76±0.1 | 73.29±0.2 | 78.25±0.1 | | DE with DANN + Avg-KLD | 48.42±0.1 | 55.95±0.2 | 68.73±1.1 | 59.06±0.2 | 63.44±0.2 | 69.41±0.5 | 70.84±0.1 | 73.83±0.1 | 77.91±0.4 | | DE with DANN + CLUE | 44.14±0.6 | 46.15±0.2 | 49.02±0.5 | 56.01±0.3 | 56.89±0.2 | 58.66±0.3 | 69.11±0.2 | 70.16±0.2 | 71.46±0.2 | | DE with DANN + BADGE | 48.57±0.5 | 54.47±0.5 | 67.69±0.9 | 58.61±0.2 | 61.67±0.0 | 68.71±0.5 | 71.17±0.2 | 73.64±0.1 | 78.65±0.3 | | DE with CDAN + Uniform | 46.08±0.7 | 51.92±0.8 | 62.87±0.2 | 57.45±0.1 | 60.73±0.4 | 66.19±0.2 | 69.93±0.3 | 72.57±0.4 | 76.87±0.1 | | DE with CDAN + Entropy | 44.42±0.3 | 49.32±0.1 | 60.11±0.3 | 56.83±0.1 | 60.04±0.2 | 65.95±0.2 | 69.18±0.2 | 71.34±0.3 | 75.44±0.3 | | DE with CDAN + Confidence | 44.75±0.1 | 49.34±0.1 | 62.80±1.0 | 57.09±0.1 | 60.50±0.2 | 66.94±0.4 | 69.27±0.1 | 71.60±0.2 | 76.14±0.3 | | DE with CDAN + Margin | 47.48±0.7 | 54.48±0.7 | 70.25±0.9 | 58.98±0.4 | 62.98±0.3 | 70.10±0.4 | 70.55±0.3 | 73.46±0.2 | 78.39±0.3 | | DE with CDAN + Avg-KLD | 48.43±0.2 | 54.37±0.4 | 68.93±0.6 | 59.36±0.2 | 62.71±0.2 | 69.54±0.2 | 71.12±0.2 | 73.35±0.2 | 77.97±0.2 | | DE with CDAN + CLUE | 44.09±0.3 | 46.11±0.5 | 48.90±0.1 | 55.78±0.3 | 56.98±0.2 | 58.46±0.2 | 69.03±0.1 | 70.02±0.2 | 71.31±0.1 | | DE with CDAN + BADGE | 47.93±0.2 | 54.61±0.2 | 67.01±0.5 | 58.16±0.1 | 61.81±0.1 | 68.36±0.2 | 70.91±0.2 | 73.63±0.1 | 78.52±0.2 | | ASPEST (ours) | 53.05±0.4 | 59.86±0.4 | 76.52±0.6 | 61.18±0.2 | 65.18±0.2 | 72.86±0.3 | 71.12±0.2 | 74.25±0.2 | 79.93±0.1 | | ASPEST with DANN (ours) | 51.02±0.9 | 58.63±1.1 | 72.97±0.9 | 61.10±0.5 | 64.98±0.4 | 71.21±0.4 | 71.03±0.3 | 73.79±0.4 | 77.84±0.3 | | ASPEST with CDAN (ours) | 51.40±0.6 | 58.21±0.6 | 73.94±0.6 | 61.38±0.2 | 65.04±0.2 | 71.63±0.2 | 71.17±0.1 | 73.59±0.1 | 78.04±0.2 | Table 27: Results of evaluating DE with UDA and ASPEST with UDA on CIFAR-10→CINIC-10. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. Table 28: Results of evaluating DE with UDA and ASPEST with UDA on FMoW. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. | Dataset | Amazon Review | | | | | | | | | |---------------------------|-----------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 80% ↑ | acc|cov ≥ 80% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | DE with DANN + Uniform | 38.55±3.3 | 37.25±1.8 | 39.21±1.9 | 69.06±0.6 | 68.94±0.1 | 69.41±0.2 | 77.52±0.7 | 77.03±0.4 | 77.70±0.2 | | DE with DANN + Entropy | 38.22±2.3 | 41.85±0.8 | 41.57±1.3 | 69.48±0.3 | 70.71±0.3 | 71.55±0.2 | 77.49±0.5 | 78.39±0.2 | 78.58±0.1 | | DE with DANN + Confidence | 38.01±1.0 | 38.36±2.5 | 38.89±1.3 | 69.45±0.1 | 70.16±0.3 | 71.44±0.2 | 77.54±0.2 | 77.58±0.5 | 78.48±0.3 | | DE with DANN + Margin | 36.82±1.3 | 36.89±1.3 | 41.98±1.5 | 69.35±0.3 | 69.63±0.3 | 71.27±0.2 | 77.30±0.3 | 77.23±0.3 | 78.34±0.3 | | DE with DANN + Avg-KLD | 37.15±2.9 | 38.21±1.3 | 42.46±1.4 | 69.38±0.4 | 69.79±0.2 | 71.21±0.2 | 77.25±0.6 | 77.72±0.3 | 78.68±0.3 | | DE with DANN + CLUE | 40.23±4.0 | 34.71±1.8 | 31.38±0.9 | 68.95±0.7 | 68.07±0.2 | 67.44±0.3 | 77.62±1.0 | 76.27±0.6 | 75.60±0.2 | | DE with DANN + BADGE | 37.51±1.8 | 37.00±0.9 | 41.62±2.3 | 68.98±0.4 | 69.27±0.1 | 70.20±0.4 | 77.20±0.4 | 77.21±0.1 | 78.31±0.5 | | DE with CDAN + Uniform | 37.81±0.3 | 37.83±2.7 | 39.52±0.8 | 68.93±0.1 | 69.16±0.7 | 69.50±0.3 | 77.16±0.1 | 77.30±0.7 | 77.74±0.3 | | DE with CDAN + Entropy | 37.99±0.8 | 37.68±1.1 | 42.55±0.9 | 69.54±0.3 | 70.01±0.2 | 71.52±0.2 | 77.52±0.2 | 77.61±0.1 | 78.63±0.1 | | DE with CDAN + Confidence | 35.76±0.9 | 38.69±2.8 | 41.43±2.1 | 69.24±0.0 | 70.45±0.4 | 71.50±0.4 | 77.08±0.2 | 77.82±0.4 | 78.47±0.3 | | DE with CDAN + Margin | 37.68±2.9 | 37.43±1.0 | 42.18±1.3 | 69.50±0.3 | 69.80±0.4 | 71.29±0.0 | 77.50±0.5 | 77.31±0.3 | 78.46±0.3 | | DE with CDAN + Avg-KLD | 37.85±1.6 | 40.71±0.9 | 44.35±0.9 | 69.41±0.3 | 70.29±0.1 | 71.28±0.2 | 77.28±0.5 | 78.11±0.2 | 78.86±0.2 | | DE with CDAN + CLUE | 34.85±2.7 | 34.03±1.3 | 30.70±0.4 | 68.70±0.3 | 67.84±0.1 | 67.12±0.3 | 76.95±0.7 | 76.23±0.4 | 75.36±0.4 | | DE with CDAN + BADGE | 39.47±0.2 | 39.29±1.1 | 41.64±0.9 | 69.33±0.0 | 69.34±0.2 | 70.58±0.2 | 77.52±0.2 | 77.49±0.2 | 78.24±0.3 | | ASPEST (ours) | 38.44±0.7 | 40.96±0.8 | 45.77±0.1 | 69.31±0.3 | 70.17±0.2 | 71.60±0.2 | 77.69±0.1 | 78.35±0.2 | 79.51±0.2 | | ASPEST with DANN (ours) | 40.22±0.5 | 41.99±1.4 | 45.84±0.1 | 69.42±0.1 | 70.30±0.1 | 71.58±0.2 | 78.00±0.1 | 78.34±0.3 | 79.43±0.1 | | ASPEST with CDAN (ours) | 40.02±0.5 | 42.46±0.6 | 44.95±0.4 | 69.50±0.1 | 70.37±0.2 | 71.42±0.0 | 77.80±0.1 | 78.57±0.1 | 79.25±0.0 | | Dataset | DomainNet R→C (easy) | | | | | | | | | |---------------------------|------------------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 80% ↑ | acc|cov ≥ 80% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | DE with DANN + Uniform | 33.53±0.5 | 36.28±0.3 | 40.13±1.0 | 50.57±0.5 | 52.19±0.1 | 55.15±0.1 | 69.34±0.3 | 70.98±0.2 | 73.50±0.3 | | DE with DANN + Entropy | 28.66±1.0 | 34.47±0.1 | 42.77±0.7 | 48.13±0.6 | 52.70±0.3 | 59.01±0.2 | 66.60±0.5 | 70.64±0.1 | 75.45±0.2 | | DE with DANN + Confidence | 29.92±0.4 | 35.29±1.0 | 43.33±0.4 | 48.61±0.1 | 53.36±0.5 | 59.72±0.3 | 67.23±0.2 | 70.92±0.5 | 75.89±0.3 | | DE with DANN + Margin | 35.19±0.3 | 39.63±0.2 | 46.51±0.5 | 52.29±0.3 | 55.60±0.2 | 60.97±0.4 | 70.70±0.1 | 73.41±0.1 | 77.24±0.3 | | DE with DANN + Avg-KLD | 36.02±0.6 | 39.67±0.5 | 47.20±0.8 | 53.00±0.3 | 55.75±0.3 | 61.22±0.3 | 71.19±0.3 | 73.51±0.2 | 77.46±0.2 | | DE with DANN + CLUE | 32.26±1.5 | 35.09±0.4 | 35.66±0.3 | 50.21±0.0 | 50.90±0.1 | 51.50±0.1 | 69.17±0.2 | 70.20±0.2 | 70.82±0.1 | | DE with DANN + BADGE | 35.27±0.5 | 38.88±0.3 | 45.97±0.7 | 52.15±0.3 | 54.89±0.1 | 60.03±0.3 | 70.65±0.1 | 72.95±0.1 | 76.87±0.1 | | DE with CDAN + Uniform | 33.49±0.6 | 36.01±0.7 | 39.93±0.2 | 50.46±0.2 | 51.89±0.1 | 55.23±0.2 | 69.32±0.3 | 70.86±0.3 | 73.55±0.2 | | DE with CDAN + Entropy | 29.50±0.5 | 33.86±0.3 | 42.24±0.5 | 48.01±0.1 | 52.52±0.3 | 58.96±0.2 | 66.82±0.2 | 70.28±0.1 | 75.33±0.1 | | DE with CDAN + Confidence | 29.21±1.0 | 34.92±0.6 | 43.36±0.4 | 48.48±0.4 | 52.85±0.4 | 59.88±0.4 | 66.82±0.5 | 70.61±0.4 | 75.93±0.3 | | DE with CDAN + Margin | 35.87±0.7 | 38.37±0.4 | 46.42±0.6 | 52.58±0.1 | 55.28±0.2 | 61.20±0.2 | 70.95±0.2 | 72.95±0.2 | 77.26±0.1 | | DE with CDAN + Avg-KLD | 36.21±0.6 | 40.08±0.3 | 47.62±0.4 | 52.95±0.3 | 55.93±0.1 | 61.56±0.2 | 71.29±0.3 | 73.60±0.1 | 77.58±0.2 | | DE with CDAN + CLUE | 31.74±2.1 | 35.11±0.2 | 35.87±0.5 | 49.99±0.2 | 51.39±0.2 | 51.43±0.2 | 69.04±0.3 | 70.35±0.0 | 70.82±0.3 | | DE with CDAN + BADGE | 34.74±0.5 | 38.68±0.7 | 45.87±1.0 | 51.80±0.3 | 54.75±0.2 | 60.22±0.1 | 70.38±0.1 | 72.90±0.2 | 76.85±0.2 | | ASPEST (ours) | 37.38±0.1 | 39.98±0.3 | 48.29±1.0 | 54.56±0.3 | 56.95±0.1 | 62.69±0.2 | 71.61±0.2 | 73.27±0.2 | 77.40±0.4 | | ASPEST with DANN (ours) | 37.41±0.8 | 42.45±1.0 | 49.74±0.6 | 55.60±0.1 | 58.29±0.2 | 63.64±0.2 | 71.88±0.2 | 74.18±0.4 | 78.09±0.0 | | ASPEST with CDAN (ours) | 36.60±1.2 | 42.96±0.6 | 50.86±0.2 | 55.55±0.2 | 58.71±0.2 | 63.85±0.2 | 71.99±0.2 | 74.60±0.2 | 78.45±0.3 | Table 29: Results of evaluating DE with UDA and ASPEST with UDA on Amazon Review. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. Table 30: Results of evaluating DE with UDA and ASPEST with UDA on DomainNet R→C. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. | Dataset | DomainNet R→P (medium) | | | | | | | | | |---------------------------|--------------------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 70% ↑ | acc|cov ≥ 70% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | DE with DANN + Uniform | 26.98±0.1 | 28.34±0.5 | 30.63±0.2 | 41.96±0.2 | 42.89±0.2 | 44.73±0.1 | 57.04±0.1 | 58.10±0.2 | 59.87±0.1 | | DE with DANN + Entropy | 24.75±0.4 | 27.02±0.5 | 30.10±0.2 | 40.29±0.4 | 42.34±0.2 | 45.78±0.2 | 55.19±0.3 | 57.12±0.3 | 60.21±0.1 | | DE with DANN + Confidence | 22.41±0.9 | 27.03±0.6 | 31.70±0.6 | 39.05±0.5 | 42.61±0.2 | 46.60±0.2 | 53.66±0.6 | 57.35±0.3 | 60.93±0.4 | | DE with DANN + Margin | 29.16±0.1 | 30.58±0.3 | 33.64±0.6 | 43.78±0.2 | 45.17±0.2 | 47.69±0.4 | 58.76±0.1 | 59.94±0.0 | 62.19±0.4 | | DE with DANN + Avg-KLD | 29.52±0.1 | 31.17±0.4 | 34.09±0.3 | 43.84±0.3 | 45.33±0.2 | 48.18±0.2 | 58.89±0.2 | 60.25±0.2 | 62.54±0.2 | | DE with DANN + CLUE | 27.48±0.5 | 27.83±0.2 | 28.39±0.5 | 42.05±0.3 | 42.34±0.2 | 42.65±0.1 | 57.32±0.3 | 57.64±0.2 | 57.99±0.2 | | DE with DANN + BADGE | 28.92±0.1 | 30.36±0.2 | 33.86±0.3 | 43.38±0.1 | 44.85±0.1 | 47.64±0.3 | 58.38±0.0 | 59.82±0.1 | 62.26±0.2 | | DE with CDAN + Uniform | 26.96±0.4 | 28.33±0.2 | 29.98±0.4 | 41.77±0.3 | 42.85±0.2 | 44.23±0.4 | 56.86±0.4 | 58.01±0.0 | 59.42±0.4 | | DE with CDAN + Entropy | 24.91±0.4 | 26.30±0.9 | 30.33±0.4 | 40.34±0.3 | 42.07±0.6 | 45.79±0.2 | 55.38±0.4 | 56.70±0.8 | 60.23±0.2 | | DE with CDAN + Confidence | 24.58±0.7 | 27.11±0.5 | 31.07±0.5 | 40.32±0.2 | 42.64±0.3 | 46.25±0.3 | 55.14±0.3 | 57.40±0.3 | 60.63±0.3 | | DE with CDAN + Margin | 28.33±0.1 | 30.17±0.3 | 33.54±0.4 | 43.44±0.4 | 44.77±0.1 | 47.56±0.2 | 58.31±0.2 | 59.65±0.1 | 62.17±0.2 | | DE with CDAN + Avg-KLD | 28.69±0.2 | 30.99±0.9 | 34.30±0.2 | 43.64±0.2 | 45.34±0.2 | 48.22±0.1 | 58.60±0.1 | 60.15±0.4 | 62.67±0.1 | | DE with CDAN + CLUE | 27.52±0.6 | 27.96±0.2 | 28.18±0.5 | 42.02±0.2 | 42.44±0.1 | 42.67±0.2 | 57.21±0.3 | 57.70±0.1 | 58.04±0.3 | | DE with CDAN + BADGE | 28.79±0.1 | 30.28±0.1 | 33.77±0.4 | 43.45±0.0 | 44.73±0.3 | 47.84±0.2 | 58.47±0.1 | 59.64±0.2 | 62.37±0.2 | | ASPEST (ours) | 29.69±0.1 | 32.50±0.3 | 35.46±0.6 | 44.96±0.1 | 46.77±0.2 | 49.42±0.1 | 58.74±0.0 | 60.36±0.0 | 62.84±0.2 | | ASPEST with DANN (ours) | 31.75±0.4 | 33.58±0.3 | 36.96±0.2 | 46.16±0.1 | 47.64±0.2 | 50.37±0.3 | 59.63±0.2 | 61.06±0.1 | 63.75±0.1 | | ASPEST with CDAN (ours) | 30.39±0.4 | 33.57±0.3 | 37.53±0.7 | 45.90±0.1 | 47.71±0.2 | 50.31±0.2 | 59.13±0.3 | 61.17±0.2 | 63.69±0.3 | | Dataset | DomainNet R→S (hard) | | | | | | | | | |---------------------------|------------------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 70% ↑ | acc|cov ≥ 70% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | DE with DANN + Uniform | 17.55±0.4 | 19.82±0.3 | 23.57±0.4 | 32.61±0.5 | 34.56±0.3 | 37.73±0.2 | 47.60±0.5 | 49.92±0.4 | 53.52±0.1 | | DE with DANN + Entropy | 10.77±0.8 | 15.38±0.5 | 20.11±0.5 | 27.78±0.7 | 31.09±0.2 | 36.39±0.3 | 41.69±0.7 | 45.62±0.3 | 51.05±0.4 | | DE with DANN + Confidence | 10.64±1.2 | 15.22±0.4 | 20.25±0.5 | 28.09±1.0 | 31.76±0.3 | 36.86±0.8 | 41.94±1.3 | 46.19±0.3 | 51.48±0.7 | | DE with DANN + Margin | 17.90±0.7 | 20.44±0.6 | 25.52±0.4 | 33.61±0.1 | 35.79±0.5 | 40.29±0.3 | 48.67±0.1 | 51.03±0.6 | 55.64±0.4 | | DE with DANN + Avg-KLD | 18.02±1.0 | 21.22±0.2 | 25.46±0.2 | 34.00±0.2 | 36.51±0.2 | 40.72±0.2 | 49.05±0.2 | 51.79±0.2 | 55.95±0.2 | | DE with DANN + CLUE | 15.77±0.3 | 18.14±0.7 | 19.49±0.4 | 32.10±0.1 | 33.42±0.3 | 34.50±0.3 | 47.18±0.2 | 48.63±0.3 | 50.03±0.3 | | DE with DANN + BADGE | 16.84±0.9 | 20.88±0.3 | 25.11±0.3 | 33.97±0.1 | 36.20±0.2 | 40.01±0.3 | 48.87±0.2 | 51.46±0.2 | 55.33±0.2 | | DE with CDAN + Uniform | 17.33±0.5 | 19.79±0.1 | 22.99±0.5 | 32.47±0.5 | 34.59±0.3 | 37.88±0.2 | 47.49±0.5 | 50.02±0.2 | 53.51±0.3 | | DE with CDAN + Entropy | 12.48±0.8 | 15.19±0.8 | 20.23±0.0 | 28.83±0.1 | 32.41±0.4 | 36.57±0.1 | 42.93±0.5 | 47.00±0.3 | 51.24±0.2 | | DE with CDAN + Confidence | 11.23±0.6 | 13.93±0.1 | 18.45±1.3 | 28.67±0.3 | 31.35±0.4 | 35.56±0.8 | 42.87±0.5 | 45.40±0.7 | 49.80±1.0 | | DE with CDAN + Margin | 18.06±0.7 | 20.39±0.3 | 25.05±0.3 | 33.98±0.2 | 35.76±0.2 | 40.11±0.1 | 49.15±0.1 | 50.92±0.1 | 55.27±0.1 | | DE with CDAN + Avg-KLD | 18.63±1.0 | 20.80±0.3 | 25.49±0.9 | 34.19±0.4 | 36.41±0.2 | 40.53±0.5 | 49.45±0.5 | 51.58±0.1 | 55.74±0.5 | | DE with CDAN + CLUE | 16.51±0.3 | 18.82±0.1 | 19.47±0.1 | 32.23±0.2 | 33.83±0.4 | 34.72±0.3 | 47.40±0.2 | 49.11±0.2 | 49.98±0.3 | | DE with CDAN + BADGE | 17.52±0.8 | 21.48±0.5 | 25.35±0.4 | 33.53±0.5 | 36.19±0.4 | 40.31±0.3 | 48.67±0.5 | 51.65±0.3 | 55.62±0.3 | | ASPEST (ours) | 17.86±0.4 | 20.42±0.4 | 25.87±0.4 | 35.17±0.1 | 37.28±0.3 | 41.46±0.2 | 49.62±0.1 | 51.61±0.4 | 55.90±0.2 | | ASPEST with DANN (ours) | 16.35±1.2 | 23.18±0.4 | 28.00±0.1 | 36.56±0.2 | 39.40±0.4 | 42.94±0.1 | 50.58±0.4 | 53.73±0.3 | 57.25±0.1 | | ASPEST with CDAN (ours) | 18.81±1.1 | 22.95±0.8 | 28.17±0.2 | 36.85±0.3 | 39.10±0.2 | 43.25±0.3 | 51.14±0.3 | 53.47±0.2 | 57.26±0.2 | Table 31: Results of evaluating DE with UDA and ASPEST with UDA on DomainNet R→P. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. Table 32: Results of evaluating DE with UDA and ASPEST with UDA on DomainNet R→S. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results. | Dataset | Otto | | | | | | | | | |---------------------------|-----------------|-----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | Metric | cov|acc ≥ 80% ↑ | acc|cov ≥ 80% ↑ | AUACC ↑ | | | | | | | | Labeling Budget | 500 | 1000 | 2000 | 500 | 1000 | 2000 | 500 | 1000 | 2000 | | DE with DANN + Uniform | 70.35±0.5 | 72.42±0.4 | 75.63±0.7 | 76.12±0.3 | 77.04±0.1 | 78.25±0.1 | 86.67±0.1 | 87.16±0.1 | 88.09±0.1 | | DE with DANN + Entropy | 75.27±0.3 | 81.25±0.1 | 92.23±0.3 | 78.14±0.1 | 80.45±0.0 | 83.73±0.1 | 87.73±0.1 | 88.91±0.0 | 90.90±0.1 | | DE with DANN + Confidence | 74.66±0.3 | 81.62±0.1 | 92.57±0.6 | 78.05±0.2 | 80.50±0.0 | 83.67±0.2 | 87.51±0.1 | 89.06±0.1 | 90.94±0.1 | | DE with DANN + Margin | 75.47±0.4 | 82.56±0.7 | 91.86±0.9 | 78.26±0.1 | 80.79±0.2 | 83.61±0.3 | 87.87±0.1 | 89.08±0.0 | 90.88±0.1 | | DE with DANN + Avg-KLD | 76.02±0.6 | 81.78±0.4 | 91.82±0.3 | 78.53±0.0 | 80.70±0.1 | 83.88±0.0 | 87.99±0.0 | 89.17±0.0 | 90.90±0.1 | | DE with DANN + CLUE | 69.68±0.4 | 68.07±0.3 | 62.70±0.6 | 75.81±0.3 | 75.44±0.0 | 73.49±0.3 | 86.68±0.2 | 86.31±0.1 | 84.89±0.2 | | DE with DANN + BADGE | 74.69±0.5 | 79.04±0.6 | 87.63±0.4 | 77.97±0.1 | 79.57±0.3 | 82.99±0.1 | 87.82±0.1 | 88.92±0.1 | 90.67±0.1 | | DE with CDAN + Uniform | 70.25±0.9 | 72.43±0.4 | 75.21±0.7 | 76.09±0.3 | 76.94±0.1 | 78.13±0.1 | 86.56±0.3 | 87.14±0.2 | 87.90±0.1 | | DE with CDAN + Entropy | 74.73±0.6 | 81.60±0.8 | 92.58±0.2 | 77.97±0.2 | 80.59±0.3 | 83.81±0.2 | 87.47±0.1 | 88.93±0.1 | 90.84±0.1 | | DE with CDAN + Confidence | 74.88±0.6 | 81.30±0.8 | 92.53±0.9 | 78.06±0.2 | 80.51±0.3 | 83.85±0.3 | 87.43±0.2 | 88.99±0.1 | 90.95±0.1 | | DE with CDAN + Margin | 76.68±1.0 | 81.57±0.4 | 92.20±0.5 | 78.74±0.5 | 80.62±0.2 | 84.01±0.2 | 88.08±0.2 | 88.85±0.2 | 91.09±0.0 | | DE with CDAN + Avg-KLD | 75.88±0.4 | 81.82±0.8 | 91.43±1.1 | 78.45±0.1 | 80.72±0.3 | 83.72±0.3 | 87.92±0.2 | 89.12±0.2 | 90.91±0.2 | | DE with CDAN + CLUE | 69.86±0.5 | 67.79±0.2 | 63.46±0.9 | 76.09±0.2 | 75.42±0.3 | 73.66±0.3 | 86.81±0.1 | 86.25±0.1 | 85.00±0.1 | | DE with CDAN + BADGE | 74.68±0.4 | 79.46±0.3 | 87.57±0.4 | 77.89±0.1 | 79.78±0.1 | 82.85±0.1 | 87.78±0.1 | 88.90±0.1 | 90.72±0.1 | | ASPEST (ours) | 77.85±0.2 | 84.20±0.6 | 94.26±0.6 | 79.28±0.1 | 81.40±0.1 | 84.62±0.1 | 88.28±0.1 | 89.61±0.1 | 91.49±0.0 | | ASPEST with DANN (ours) | 78.14±0.4 | 83.33±0.5 | 93.61±0.0 | 79.33±0.1 | 81.23±0.1 | 84.21±0.1 | 88.36±0.2 | 89.32±0.1 | 91.26±0.0 | | ASPEST with CDAN (ours) | 77.75±0.3 | 83.68±0.5 | 94.44±0.3 | 79.27±0.0 | 81.30±0.2 | 84.76±0.1 | 88.35±0.1 | 89.59±0.0 | 91.41±0.0 | Table 33: Results of evaluating DE with UDA and ASPEST with UDA on Otto. The mean and std of each metric over three random runs are reported (mean±std). All numbers are percentages. **Bold** numbers are superior results.
Review 1: Summary: This paper introduces a new learning paradigm called active selective prediction that combines selective prediction (not predicting on uncertain points) and active learning (deciding which datapoints to obtain human labels for). The authors' new framework aims to query more informative sample that the model is uncertain on, and propose an approach called ASPEST that utilizes ensembles of model snapshots with self-training with their aggregated outputs as pseudo labels. They show that this approach is quite effective on several datasets for selective prediction, active learning, and distribution shifts. Strengths and Weaknesses: The paper is well-written, methods seems solid, experiments are shown on a wide range of datasets, and improvements are consistent. There is both theoretical and empirical analysis of the proposed problem setting and method. Results are carefully studied and analyzed. My biggest issue with the paper is that I don't know if the problem is actually something we see in the real-world. The experiments seem to be on synthetic shifts from one dataset to another. It would be much more compelling if there is a unique real-world task where this problem setting and method is actually required, or performance would be close to 0% or random. This would significantly improve the paper and address my concerns. Also, I am not an expert in this area, but I am curious whether the baselines quoted and compared in the paper are sufficient, or are they designed to trivially fail (i.e baselines for active learning combined with separate baselines for selective prediction, which obviously fail when applied to this new problem combining both challenges). If so, then there should be a much more significant effort towards testing and analyzing strong baselines for this new problem. Requested Changes: see above weaknesses on real-world setting where we see this problem setting, new experimental results on this setting rather than artificially paired transfer datasets, and issues regarding baselines Broader Impact Concerns: no concerns ================================================== Review 2: Summary: This paper proposes to tackle the active learning and selective prediction problems together in tandem. They specifically investigate the setting of distribution shift where models trained on the source domain tend to be miscaliberated thus resulting in poor coverage of the selective predictor and resultant poor performance of the joint system. The paper propose a combination of deep ensembling and self-training when leveraging labelled points queried from active learning, resulting in ASPEST which shows strong performance in the settings they investigate. Strengths and Weaknesses: ## Strengths 1. The method proposed by the authors -- ASPESTS -- produces strong results compared to reasonable baselines 2. The paper presents quite thorough experiments and ablations of the settings of interest. ## Weaknesses Broadly, my primary concerns with this paper is that quite a few choices are not well motivated (at least from my read of the paper). There are several choices that I question : 1. Carving out active selective prediction as a niche, separate domain. Specifically, the authors present *active selective prediction* as separate from active learning because the points are chosen not only to improve the model but also the selection scoring function. However, this strikes me as quite a cosmetic difference, since one can always re-define the utility function for active learning to fold in performance on the scoring function too. Thus the claim of **we introduce a new machine learning paradigm** seems overstated. 2. The motivation presented for why active domain adaptation (as a standalone approach) would not cover improvements in the selective predictor is unclear to me. Specifically, the authors mention early in the intro that distribution shift can cause the selection predictor to fail due to miscalibration. It stands to reason that doing active domain adaption would fix the calibration problem (or if it doesn't, the authors provide no evidence of this), thus requiring minimal change to the selective predictor. 3. The authors state in section 3.1 **These two approaches to involve humans have different objectives and thus, their joint optimization to best use the human labeling resources is not straightforward** -- however, it is unclear whether these two objectives are actually in opposition and not complementary. It would be good to either have an empirical or theoretical exploration of the compatibility of the two objectives. 4. Figure 2 was quite hard for me to understand. The distribution of already labelled data is not shown and thus makes it hard to understand why the decision bound changes the way the authors suggest when the marked points are selected. Also, the particular configuration shown (where diversity is the selection metric, and equal number of points are chosen from each cluster "where cluster is a group of points with the same latent label" but some clusters are bigger so one would apriori expect more points to be sampled from that cluster leading to a much different decision boundary change than the authors propose) seems contrived and I am unsure if the setup reflects the vast majority of typical problems. Requested Changes: 1. Clarifications to Figure 2 as requested in above section 2. Positioning of the paper should be reconsidered, else a stronger case should be made for why active domain adaptation approaches (along with an appropriately chosen threshold for selective prediction) cannot be used (or compared to) in the evaluation settings the paper presented. Broader Impact Concerns: N/A ================================================== Review 3: Summary: The work presents ASPEST (Active Selective Prediction using Ensembles and Self-training). This method incorporates active learning with selective prediction to enhance accuracy and coverage in cases where the distribution of test data diverges from that of the training data (distribution shift). ASPEST queries highly informative samples from the shifted target domain, which significantly boosts the model accuracy and coverage breadth. Key to ASPEST's design is the use of ensemble model checkpoints, coupled with self-training techniques that leverage aggregated outputs as pseudo-labels. Strengths and Weaknesses: Strengths: The idea of this integration method looks interesting, a combination of different strategies, each addressing different aspects of the challenge. Self-training helps in adapting the model to new distributions, active learning efficiently expands the model's understanding of the new domain with limited labeled data, and selective prediction maintains prediction reliability in the face of uncertainty. An integrated approach, combining these elements, is often more effective in tackling distribution shifts in real-world scenarios. Weaknesses: 1. This workflow induces too many hyperparameters. Although the authors do sensitive analysis on some hyperparameters, it is still not appropriate to introduce too many hyperparameters in the active learning process, since the validation dataset is insufficient, and the data scenarios vary. The hyperparameters should be self-adaptive. For instance, in the joint training, in previous stages, the labeled data are insufficient, and the ensembles should be less reliable. 2. The use of ensembles and self-training might increase computational requirements. The authors only provide the running time of their methods, not comparison. 3. This work demonstrates effectiveness w.r.t. distribution shift on some specific datasets like MNIST and SVHN, it may not establish the generalizability of ASPEST across a more diverse range of domains and data types. Requested Changes: 1. See the weaknesses part in the previous section. 2. Add a notion table. 3. Figure 1 could not become an overview of the proposed model, I cannot see how it works under the distribution shift data scenarios. 4. The evaluation metrics are a mess, sometimes it is ACC>90, ACC>80, and sometimes ACC>70. 5. Is epochs=20 conduct a sufficient model training? 6. It is better to provide evaluation metrics vs. labeling budget curves for different methods instead of using tables. 7. The proposed method seems cannot give enough distinguishable model performance on standard datasets (without distribution shift problems), can add statistical tests. Broader Impact Concerns: This work uses self-training, there is always a risk of inherent biases in the training data being perpetuated or amplified by the model and result in fairness issues. And such biases can be accumulated by increasing the rounds. ================================================== Metareview: Recommendation: Accept as is Comment: Although not all the reviewers view the problem of "active selective prediction" as novel necessarily, all the reviewers are in agreement with respect to the manuscript - leaning accept. All requested changes were either made or discussed to satisfaction of the reviewers. The extensive experiments clearly show the improved performance of the proposed approach, ASPEST, as compared to baseline methods. The authors made edits to the manuscript to clarify any points of confusion. Hence, the recommendation is to accept the paper as is. ==================================================
# Centroids Matching: An Efficient Continual Learning Approach Operating In The Embedding Space Jary Pomponi *jary.pomponi@uniroma1.it* Department of Information Engineering, Sapienza University of Rome, Italy Simone Scardapane *simone.scardapane@uniroma1.it* Department of Information Engineering, Sapienza University of Rome, Italy Aurelio Uncini *aurelio.uncini@uniroma1.it* Department of Information Engineering, Sapienza University of Rome, Italy Reviewed on OpenReview: *https: // openreview. net/ forum? id= 7gzQltQSwr* ## Abstract Catastrophic forgetting (CF) occurs when a neural network loses the information previously learned while training on a set of samples from a different distribution, i.e., a new task. Existing approaches have achieved remarkable results in mitigating CF, especially in a scenario called task incremental learning. However, this scenario is unrealistic, and limited work has been done to achieve good results in more realistic scenarios. In this paper, we propose a novel regularization method called Centroids Matching, that, inspired by metalearning approaches, fights CF by operating in the feature space produced by the neural network, achieving good results while requiring a small memory footprint. Specifically, the approach classifies the samples directly using the feature vectors produced by the neural network, by matching those vectors with the centroids representing the classes from the current task, or all the tasks up to that point. Centroids Matching is faster than competing baselines, and it can be exploited to efficiently mitigate CF, by preserving the distances between the embedding space produced by the model when past tasks were over, and the one currently produced, leading to a method that achieves high accuracy on all the tasks, without using an external memory when operating on easy scenarios, or using a small one for more realistic ones. Extensive experiments demonstrate that Centroids Matching achieves accuracy gains on multiple datasets and scenarios. ## 1 Introduction An agent which operates in the real world must be able to continuously learn from the environment. Learning from a stream of samples, usually in the form of static datasets, also called tasks, is referred to as Lifelong Learning or Continual Learning (CL). A continual learning scenario comes often with a phenomenon called Catastrophic Forgetting (CF) (McCloskey and Cohen, 1989), that arises when an agent loses the knowledge learned from past samples while extracting information from newer ones. This phenomenon inhibits the correct working of agents that operate in such scenarios, but it can be mitigated, or removed, using methods built for that purpose. A key point is that such methods must present a contained memory footprint, because we can't save all past samples encountered during the training Parisi et al. (2019), and the agents cannot grow indefinitely, consuming all the memory. Thus, the external memory, intended as the collection of all the things saved on the hardware that must be preserved across all the tasks, must be contained. Over the last years, a large amount of research has been done about methods to alleviate the CF phenomenon. Usually, CL techniques are grouped into three categories (regularization-based methods, rehearsal methods, and architectural methods), and a method can belong to one, or more, categories at the same time (Parisi et al., 2019). The methods in the first set are designed in such a way that important parameters of the model, with respect to past tasks, are preserved during the training of newer tasks using any sort of regularization technique, by directly operating over the parameters of the model, or by adding a regularization term to the training loss (Li and Hoiem, 2017; Kirkpatrick et al., 2017; Zenke et al., 2017; Serra et al., 2018; Saha et al., 2020; Chaudhry et al., 2021). Rehearsal-based methods save portions of past tasks and use the information contained in the memory to mitigate CF while training on new tasks (Rebuffi et al., 2017; Chaudhry et al., 2019; van de Ven et al., 2020; Chaudhry et al., 2021; Rosasco et al., 2021); the samples associated to past tasks can also be generated using a generative model, and in that case the methods are called pseudo-rehearsal. Finally, architectural-based methods freeze important parameters or dynamically adjust and expand the neural network's structure, to preserve the knowledge associated to past tasks, while the model learns how to solve the current task (Rusu et al., 2016; Aljundi et al., 2017; Yoon et al., 2017; Veniat et al., 2020; Pomponi et al., 2021). Aside from developing techniques to solve CF, another issue is formalizing scenarios describing how tasks are created, how they arrive, and what information is provided to the model itself (e.g., the task identifier). Usually, a method is designed to solve a subset of all possible CL scenarios (Van de Ven and Tolias, 2019). In this paper, we operate on scenarios in which the identity of a task is always known during the training, but it may not be known during inference phase, and the classes are disjoint (the same class appears in only one task). If we can use the task identity during the inference phase, we have a scenario called *task incremental*, otherwise, the scenario is called *class incremental*; the latter is much harder to deal with, being closer to a real-world scenario Van de Ven and Tolias (2019). The task incremental scenarios have been studied exhaustively, due to the simplicity of the problem, while fewer methods have been proposed to efficiently solve the latter. In this paper, we propose a method that achieves better results on both task and class incremental scenarios. Our proposal, Centroids Matching, is a pure regularization-based method when it comes to fight CF in task incremental problems (which are easier), while it uses an external memory, containing samples from past tasks, when we require to solve class incremental scenarios; when fighting the CF phenomenon in a task incremental scenario, our approach requires no memory, since we force the model to keep its extraction ability by using the current samples and the current model, without the need to store the past model when the learning of a task is over, nor an external memory containing past samples. Our approach differs from the existing literature because it does not train the neural network using a standard training procedure, in which a cross-entropy error is minimized, but it operates directly on the embeddings vectors outputted by the model, by producing an embedding for each point. These vectors are moved to match the centroids of the associated classes, which are calculated using a sub-set of training samples (support set). When fighting the CF phenomenon in a task incremental scenario, our approach requires no memory, since we force the model to keep its extraction ability by using the current samples and the current model, without the need to store the past model when the learning of a task is over, nor an external memory containing past samples. ## 2 Related Works An agent that has the Continual Learning (CL) property is capable of learning from a sequence of tasks (De lange et al., 2021) without forgetting past learned knowledge. When past learned knowledge is lost, and with it also the ability to solve tasks already solved in the past, we have a phenomenon called Catastrophic Forgetting (CF) (French, 1999; McCloskey and Cohen, 1989), which occurs because the information saved in the parameters of the model is overwritten when learning how to solve new tasks, leading to a partial or total forgetting of the information. A CL method should be able of alleviating, or removing, CF while efficiently learning how to solve current tasks. Initial CL works focused on fighting the CF phenomenon on the easiest supervised CL scenario, called task incremental learning, but, recently, we have seen a shift toward class incremental scenario, being closer, and more suitable, to real-world applications; nevertheless, a limited number of proposed approaches focus on that specific scenario (Masana et al., 2020; Belouadah et al., 2021). The main difference between the two is that in the first scenario we can classify only samples in ![2_image_0.png](2_image_0.png) Figure 1: The proposed approach applied on both Task (left) and Class (right) Incremental learning scenarios. The bigger circles are the centroids of the classes, while the smaller ones are samples from the same class of the corresponding centroid. We see that a CIL scenarios is solved by merging the embedding spaces together, into a new space that contains all the classes so far; the merging process is explained in Section 4.2. the context of a task, thus the task identity must be known a priori, while in the latter one the model must discriminate at inference time between all classes seen during the training procedure, without having the task identity. Depending on how a CL method achieves this goal, we can group, following Parisi et al. (2019), the CL methods into three categories: regularization methods, rehearsal methods, and architectural methods. Our approach belongs to the first set when we are dealing with task incremental scenarios, and both the first and the second one when the scenario is a class incremental one. Our approach regularizes the model by constraining the embeddings, but other approaches, based on the same principle, have been proposed over the years. One of the first was proposed in Hou et al. (2019), and it does not work directly on the embeddings of the model, but on the logits produced by it, and uses them to regularize the training by reducing the distance between the current model and the past one, while also correcting biases that arise when training a model to solve a CL scenario (e.g. class imbalances). In Pomponi et al. (2020), the authors proposed a regularization-rehearsal approach that works directly on the embeddings space produced by the model. Given a sample and the task from which the sample comes, the proposed method uses a regularization term that forces the model to reduce the distance between the current embeddings vector and the one obtained when the training on the source task was over; moreover, the approach requires a very small memory to work, but it can only regularize models that operate on task incremental scenarios because it requires tasks spaces to be separated. In Han and Guo (2021) a regularization-rehearsal method which uses the embeddings vectors to regularize the model is proposed. The vectors are used to calculate multiple contrastive losses used as regularization factors; also, a mechanism that overwrites a portion of the embeddings is used, enabling selective forgetting; unfortunately, the approach requires a big external memory in order to achieve competitive results. More CL scenarios exist, such as a stream-supervised scenario, often called Online Incremental Learning, in which the model sees a sample only once, and the idea of using the embeddings to regularise the model has also been exploited in these scenarios. Starting from the same ground idea which inspired our approach, in De Lange and Tuytelaars (2021), the authors proposed a CL approach that operates over a stream of samples, by continuously updating the prototypes extracted using the same stream, by using a novel loss which synchronizes the latent space with the continually evolving prototypes. When a batch is retrieved, it is used to update the model using the proposed loss function and the centroids, using a combination of the current centroids and the embedding vectors associated with each image in the batch. When this process is over, the samples in the batch are used to populate a class-wise memory; the base idea, classifying using prototypes, is similar to our approach, with the difference that the authors used a different loss function that works both on positive and negative samples, and the prototypes are calculated as mobile average while samples are retrieved from the stream, and, in the end, the concept of task is missing in their proposal. Similarly, the authors of Taufique et al. (2022) proposed an approach that works in the context of unsupervised domain adaptation, in which a buffer containing prototypes is used to calculate a contrastive loss against the current batch of samples. In the approach proposed in Kurniawan et al. (2021), which aims to solve online continual learning scenarios, the authors used many loss functions to train the model, and one of them is based on the similarity calculated in the embedding space, which pulls closer the samples belonging to the same class. Other CL methods, that do not use the embeddings to regularize the training, have been proposed over the years. The approaches belonging to the regularization-based set fight CF by forcing the model's parameters, or any output of the agent, which are relevant for past tasks, to be as close as possible to the optimal parameters obtained when these past tasks were over. One of the first methods that use a regularization approach to fight CF is Elastic Weight Consolidation (EWC), proposed in Kirkpatrick et al. (2017), that assigns an importance scalar to each parameter of the model, slowing the change of the parameters that are considered more important to preserve the ability to solve past tasks; in some cases this constraining approach could be too strong, leading to an incapacity of the model to learn how to solve new tasks. Other methods, such as the ones proposed in Saha et al. (2020) and Farajtabar et al. (2020), regularize the model by forcing the gradients to go toward a space of the parameters where the CF is minimized for all the tasks, while the current one is being solved as efficiently as possible, by moving the weights in the space that satisfies all the constraints. Memory-based methods save a small number of samples from each solved task, or generate synthetic samples using generative models, to be used jointly with the current training samples, in order to preserve past learned knowledge. These methods are often called rehearsal methods, or pseudo-rehearsal when a generative model is involved. The most representative method in this set, which is a hybrid rehearsal-regularization approach, is proposed in Lopez-Paz and Ranzato (2017), which uses the samples from the external memory to estimate the gradients associated to past tasks, which are used to modify the gradients associated with the current training samples, to solve, jointly, the current and the past tasks; moreover, this was one of the methods, along with plain rehearsal approach, that can improve the scores obtained on past tasks, supposing that the memory dimension is big enough to be fully representative of past tasks. A more straightforward approach, yet very effective, is to use the external memory to augment the current batch by concatenating a random batch extracted from the memory and the current batch, as proposed, for instance, in Chaudhry et al. (2019); Riemer et al. (2018); Yoon et al. (2021). Being a straightforward approach, many other similar approaches, as well as theoretical studies to understand what CF really is and how to fight it, have been proposed over the years (Rebuffi et al., 2017; Rolnick et al., 2019; Ostapenko et al., 2022). ## 3 Continual Learning Setup We define a supervised CL scenario as a set of N tasks T = {Ti}i=1...N, in which a task can be retrieved only when the training on the current one is over; when a new task is collected, the past ones cannot be retrieved anymore (except for testing purpose). Each task Tiis a set of tuples (x, y), where x is a sample, and y ∈ Yiis the label associated to it, where Yiis the set of classes contained in the task Ti. Also, the tasks are disjoint, meaning that: Ti=1...N Yi = ∅ (a class cannot belong to two different tasks). The goal of a CL method is to help the model to generally perform well on all learned tasks so far, by adapting to new tasks while preserving the previously learned knowledge. A method that solves a task at the expense of another is not desirable, and thus a trade-off must be achieved, by looking at the overall performance. Assuming that the tasks' boundaries are always known and well defined during the whole training procedure, i.e., we always know when a task is over or retrieved, we follow Van de Ven and Tolias (2019) to define two different scenarios, based on how the inference procedure is carried out: - Task Incremental Learning (TIL): in which the task's identity of a sample is given during the inference phase. - Class Incremental Learning (CIL): in which the task's identity of a sample is not given during the inference phase. The difference is minimal, but yet crucial. In fact, we can consider the first one as a more simple and theoretical scenario, which is also the most studied one. Its main limitation is that, to correctly classify a sample, we must know the task from which the sample comes, and usually, this is not the case. In fact, such scenarios are more suitable to develop and test novel methods, before adapting them to an agent that operates on more realistic scenarios. The second scenario is more difficult and the agents suffer CF drastically, because not only the model must be regularized, but the space of the prediction must be extended to include also the upcoming classes, leading to a faster forgetting of past tasks. It must be noted that the scenario definition is untied from the architecture of the neural network involved, which can have any topology, as long as the scenario's rules are followed. Nevertheless, usually, a multi-head strategy is adopted to operate in TIL scenarios, in which a backbone is shared, and, for each task, a smaller neural network, usually called head, is used to classify the samples belonging to that task; each head takes as input the output of the backbone, making the prediction spaces of the tasks well separated. The shared backbone is also used when operating in CIL scenarios, but the classification head is usually just one, whose output neurons are expanded (the newer classes are added during the training) when a new task is collected. ## 4 Centroids Matching (Cm) Framework Our approach is inspired by the Prototypical Networks proposed in Snell et al. (2017), following the idea that there exists an embedding space, also called feature space, in which vectors cluster around the most probable centroid, representing a class, and called *prototype*. Following the approach used in Prototypical Networks, our model does not follow a standard classification approach in which a cross-entropy loss is minimized, but it uses the model to extract a features vector from an input sample, and then it forces the vector to be as close as possible to the correct centroid, representing the class in the embedding space of the task. In the following section, we explain how this approach can be used to easily mitigate CF in multiple CL scenarios. ## 4.1 Til Scenario Following Section 3, suppose the model consists of two separate components: a feature extractor, also called backbone, ψ : R I → R D, where I is the size of an input sample and D is the dimension of the features vector produced by the backbone, and a classifier head fi: R D → R E, one for each task, where E is the dimension of the task specific feature vector. The backbone operates as a generic feature extractor, while each head is a specific model that, given the generic vector of features extracted by the backbone, transforms the vector into a vector of features for that specific task. Given an input sample x and the task i from which the sample comes, the final vector, used for training and testing, is carried out by combining the functions: ei(x) = fi ◦ ψ(x). The backbone remains unique during the whole training, while a new head f is added each time a new task is encountered. Both the backbone and all the heads are updated during the whole training process. When a new task Tiis available, we extract and remove a subset of the training set, named support set and identified as Si, containing labelled training samples that won't be used to train the model. This support set is used to calculate the centroids, one for each class in the task. A centroids, for a given class k, in the space of the task i, is the average of the feature vectors extracted from the samples in the support set, calculated using the corresponding head: $$\mathbf{c}_{i}^{k}={\frac{1}{|S_{i}^{k}|}}\sum_{(\mathbf{x},y)\in S_{i}^{k}}e_{i}(\mathbf{x})$$ ei(x) (1) where S k i is the subset of Si that contains only samples having label k. During the training, these centroids are calculated at each iteration, in order to keep them up to date. Then, given the Euclidean distance function d : RM × RM → R+, and a sample x, our approach produces a distribution over the classes based on the softmax distance between the features produced using ei(x) and the centroids associated to the current task: $\left(1\right)^3$ $$p(y=k|\mathbf{x},i)={\frac{\exp(-d(\mathbf{c}_{i}^{k},e_{i}(\mathbf{x})))}{\sum_{k^{\prime}\in Y_{i}}\exp(-d(\mathbf{c}_{i}^{k^{\prime}},e_{i}(\mathbf{x})))}}$$ , ei(x))) (2) We note that, in this scenario, it makes no sense to calculate the distances between different tasks' heads, since each head produces centroids placed in their own embedding space (see the left side of Fig. 1), without interfering with the others. The loss associated to a sample is then the logarithm of the aforementioned probability function: $$(2)^{\frac{1}{2}}$$ $$L(\mathbf{x},k,i)=-\log p(y=k|\mathbf{x},i)$$ $$\left({\mathfrak{3}}\right)$$ L(x*, k, i*) = − log p(y = k|x, i) (3) If the current task is not the first one, in order to preserve past learned knowledge, we need to regularize the model. When a new task is collected, we clone the current model, both the backbone and all the heads created so far, which we indicate as ei(·), for each task i. Then, while training on the current task, we augment the loss using the distance between the features extracted using the cloned model and the one extracted by the current one, both calculated using the current set of training samples, without the support of an external memory containing past samples. The regularization term is the following: $$R({\bf x},t)=\frac{1}{t}\sum_{i<t}d\left(\overline{e_{i}}({\bf x}),e_{i}({\bf x})\right)\tag{1}$$ $$|\rangle$$ The proposed regularization term works because it relies on the fact that a Prototypical Network can be reinterpreted as a linear model Mensink et al. (2013). Using this simple regularization term, we force the model to preserve the ability to extract the same information that it was able to extract when the previous task was over. Moreover, since the regularization term is calculated only using samples from the current task, no external memory is needed to regularize the model. The overall regularization approach works because the past heads are trained at the same time as the new ones, while leaving the weights of the model unconstrained, as long as the output distance is minimized. Then, the final loss for a task which is not the first one is: $$L_{t i}(\mathbf{x},k,t)=-\log p(y=k|\mathbf{x},t)+\lambda R(\mathbf{x},t)$$ Lti(x*, k, t*) = − log p(y = k|x, t) + λR(x, t) (5) where λ is a scalar used to balance the two terms. When a task is over, the final centroids for the classes in the task are calculated and saved. Thus, the external memory contains, when all the tasks are over, only the centroids for the classes seen during the training, and thus the required memory is negligible. To classify a sample x from a task t, we use the same approach used during the training process, based on the distance between the centroids of that task and the features extracted from the sample x: $$\mathbf{\dot{\theta}}$$ $$y={\underset{k\in Y_{i}}{\operatorname{argmax}}}\ p(y=k|\mathbf{x},t)$$ p(y = k|x, t) (6) This is possible because we always know from which task the sample comes. In the next section, we will show how this can be achieved when the task identity is not known. ## 4.2 Cil Scenario The class incremental scenario is a more difficult if compared to the TIL scenario, because the identity of the task is available only during the training process but not during the inference phase, requiring a different $$(6)$$ approach. Most of the methods fails to overcome CF in this scenario, mainly because a single head classifier is used to classify all the classes, leading to faster CF, because the capacity of a single head is limited. Instead, in our approach, we keep the heads separated as in the TIL scenario, and we train by projecting the embeddings vectors into a shared embedding space, containing all the classes so far, leading to an easier classification phase. As before, we train on the first task t using the loss 5. If the task is not the first one, we also add a projection loss to the training loss, which is used to project all the embedding spaces into a single one. First of all, we use an external memory M, which can contain a fixed number of samples for each task, or a fixed number of samples during the whole training, removing a portion of past images when new ones need to be stored. In our experiment, we use a fixed sized memory, which is resized each time a new task must be saved in the memory. If the current task i is not the first, we augment the current dataset with the samples from the memory. Since the memory is smaller than the training set, we use an oversampling technique when sampling samples from the memory, in a way that a batch always contains samples from past tasks. We define the projected loss, which is a modified version of the equation 2, as: $${\overline{{p}}}(y=k|\mathbf{x},i)={\frac{\exp(-d(p_{i}(\mathbf{c}_{i}^{k}),{\frac{1}{i}}\sum_{j\leq i}p_{i}(\mathbf{x})))}{\sum_{k^{\prime}\in Y_{i}}\exp(-d(p_{i}(\mathbf{c}_{i}^{k^{\prime}}),{\frac{1}{i}}\sum_{j\leq i}p_{i}(\mathbf{x})))}}$$ where Yi =Sj=1*,...,i* Yj contains all the classes up to the current task, and the function pi(·) is a projection function, one for each task, that projects the embeddings, and the centroids, from the task wise embedding space to the shared embedding space. For this reason, the labels y must be scaled accordingly using a simple scalar offset. For a generic task i, the projecting function piis defined as: $$\mathbf{r})$$ $$p_{i}(x)=e_{i}(x)\cdot{\mathrm{Sigmoid}}(s_{i}(e_{i}(x)))+t_{i}(e_{i}(x))$$ pi(x) = ei(x) · Sigmoid(si(ei(x))) + ti(ei(x)) (8) in which the functions si, ti: R E → R E are, respectively, the scaling and the translating function, implemented using two small neural networks, trained along with the backbone and the heads. The final loss for this scenario is defined as: $$\mathbb{h}$$ $$L_{c i}(\mathbf{x},k,t)=-\log{\overline{{p}}}(y=k|\mathbf{x},t)$$ At inference time, if we know the task associated to a sample, we can perform the inference step as in the TIL scenario, otherwise, we classify directly the samples, without inferring the corresponding task: $$\mathbf{\mu}$$ $$y={\underset{k\in Y}{\operatorname{argmax}}}\ {\overline{{p}}}(y=k|\mathbf{x},\mathbf{N})$$ $$\mathbf{\Sigma}$$ p(y = k|x, N) (10) where Y is the set of all the classes seen during the training, and N is the total number of tasks. In this way, all the tasks are projected into the same embedding space, thus the classification of a sample does not require the task identity. ## 5 Experiments 5.1 Experimental Setting Dataset: We conduct extensive experiments on multiple established benchmarks in the continual learning literature, by exploring both TIL as well as the harder CIL. The datasets we use to create the scenarios are: CIFAR10, CIFAR100 (Krizhevsky, 2009), and TinyImageNet (a subset of ImageNet (Deng et al., 2009) that contains 200 classes and smaller images). To create a scenario we follow the established approach, where the classes from a dataset are grouped into N disjoint sets, with N the number of tasks to be created. We use CIFAR10 to build a scenario composed of 5 tasks, each one with 2 classes; using CIFAR100 we create 10 tasks with 10 classes in each one; in the end, the classes in TinyImageNet are grouped into 10 tasks, each one containing 20 classes. Baselines: we test our approach against many continual learning methods: Gradient Episodic Memory (GEM) (Lopez-Paz and Ranzato, 2017), Elastic Weight Consolidation (EWC) (Kirkpatrick et al., 2017), Online EWC (OEWC) (Schwarz et al., 2018), Experience Replay (ER) Chaudhry et al. (2019), SS-IL Ahn et al. (2021), CoPE De Lange and Tuytelaars (2021), despite being introduced for solving stream domain scenarios, under both multi epochs approach (ME) and stream approach (S), and, in the end, Embedding Regularization (EmR) (Pomponi et al., 2020); regarding the latter, it only works on TIL scenarios, and the other results are omitted. We also use two baseline approaches: Naive Training, in which the model is trained without fighting the CF, and Cumulative Training, in which the current training task is created by merging all past tasks as well as the current one. Hyper-parameters: for each method, we searched for the best hyper-parameters, following the results presented in respective papers. For EWC, we used 100 as regularization strength weight for all the scenarios. For GEM we used a memory for each task, composed of 500 samples for CIFAR10 and 1000 for the other experiments. In the EmR memory, we saved 200 samples from each task, while for CoPE we have a memory for each class, and each one can contain up to 300 samples. Lastly, for ER and SS-IL, we used a fixed memory size of 500 for CIFAR100 scenarios and 1000 otherwise. Regarding our approach, the support set contains 100 images from the training set of each task, and we set the penalty weight λ to 0.1 for CIFAR10, 0.75 for CIFAR100 and TinyImageNet; regarding the CIL scenarios, we used a fixed size memory of 500 for each scenario. For both ER and CM, the memory is shared across all the tasks, and it is resized, by discarding images from past tasks, each time a new task must be saved. Models and Training: for each dataset we use ResNet20 (He et al., 2016) architecture, trained using SGD with learning rate set to 0.01 and momentum to 0.9. For CIFAR10-100, we trained the model for 10 epochs on each task, while for TinyImagenet we used 30 epochs; the only exception is SSIL, for which we used 100 epochs for each scenario. For each classification head, we used two linear layers, with the first layer that takes as input the output of the backbone, followed by a ReLU activation function, and then an output layer whose output size depends on the number of classes in the current task. Regarding our proposal, each head is composed of two linear layers, and it projects the output of the backbone into a vector of 128 features (the output of the ResNet model has 64 values). We repeat each experiment 5 times; each time the seed of the experiment is changed in an incremental way (starting from 0). Regarding our proposal, since it is not a rehearsal method when operating in the TIL scenario, after each task we save the statistics of the batch norm layers, which are retrieved when a sample from the corresponding task must be classified. Also, we used the following augmentation schema for the proposed datasets: the images are standardized, randomly flipped with probability 50%, and then a random portion of the image is cropped and resized to match the original size. A scenario, usually, is built by grouping the classes in an incremental way (the first n classes will form the first task, and so on). We use this approach for the first experiment, instead, when the experiment is not the first, each of the N tasks is created using a randomly selected subset of classes. Using this approach, a different scenario is built for each experiment, and more challenging scenarios could be created since the correlation between the classes disappears. Metrics: to evaluate the efficiency of a CL method, we use two different metrics from Díaz-Rodríguez et al. (2018), both calculated on the results obtained on the test set of each task. The first one, called Accuracy, shows the final accuracy obtained across all the test splits of the tasks, while the second one, called Backward Transfer (BWT), measures how much of that past accuracy is lost during the training on upcoming tasks. To calculate the metrics we use a matrix R ∈ R N×N, in which an entry Ri,j is the test accuracy obtained on the test split of the task j when the training on the task i is over. Using the matrix R we calculate the metrics as: $$\mathrm{Accuracy}={\frac{1}{\mathrm{N}}}\sum_{j=1}^{\mathrm{N}}\mathbf{R}_{\mathrm{N},j}\,,$$ RN,j , BWT = $$\mathrm{BWT}={\frac{\sum_{i=2}^{N}\sum_{j=1}^{i-1}(\mathbf{R}_{i,j}-\mathbf{R}_{j,j})}{{\frac{1}{2}}\mathrm{N}(\mathrm{N}-1)}}\,.$$ Both metrics are important to evaluate a CL method, since a low BWT does not imply that the model performs well, especially if we also have a low Accuracy score because, in that case, it means that the Table 1: Mean and standard deviation (in percentage), calculated over 5 experiments, of achieved Accuracy and BWT for each combination of scenario and method; some results are missing because the corresponding method does not work on that specific scenario. The best results for each combination of dataset-scenario are highlighted in bold. | Method | TIL | | CIL | | | | | | | | | | |------------|-------------|------------|--------------------------------------|------------------------------------------------------------|-------------|-----------------------------------|-------------|------------|-------------|------------|-------------|------------| | | CIFAR10 | CIFAR100 | TinyImageNet | CIFAR10 | CIFAR100 | TinyImageNet | | | | | | | | | BWT | Accuracy | BWT | Accuracy | BWT | Accuracy | BWT | Accuracy | BWT | Accuracy | BWT | Accuracy | | Naive | −34.60±7.39 | 67.00±4.98 | −59.63±14.50 26.75±13.20 −61.39±2.15 | 21.84±1.12 | −95.96±0.97 | 18.00±0.77 | −79.64±1.11 | 8.34±0.09 | −60.570.7 | 6.26±0.04 | | | | Cumulative | −2.75±0.99 | 93.83±1.12 | 2.03±3.84 | 75.05±10.71 | 6.33±0.77 | 63.03±1.06 | −2.84±1.59 | 86.42±0.32 | −3.28±0.04 | 59.86±0.45 | −5.88±0.11 | 29.22±0.64 | | EWC | −16.15±7.11 | 77.06±4.47 | −5.11±0.91 | 58.62±0.91 | −5.68±3.56 | 27.41±2.1 | −92.52±2.58 | 17.07±0.89 | −63.54±1.36 | 6.13±0.32 | −43.58±6.70 | 0.5 | | OWC | −15.67±9.70 | 76.07±6.60 | −6.37±2.69 | 59.56±1.61 | −7.60±5.31 | 24.37±19.37 | −90.01±3.12 | 15.76±1.12 | −61.43±2.03 | 5.97±0.94 | −46.23±6.48 | 0.5 | | ER | −2.95±0.67 | 90.56±0.64 | −8.42±0.08 | 70.55±0.79 | −17.15±0.05 | 43.31±0.72 | −50.14±1.81 | 52.60±1.38 | −67.22±0.39 | 25.09±0.22 | −53.39±0.72 | 8.08±0.28 | | GEM | −4.87±1.56 | 90.15±1.19 | −10.58±0.35 | 71.85±0.37 | −57.39±0.59 | 14.08±0.15 | −80.17±1.59 | 22.86±1.41 | −62.71±1.56 | 17.09±0.92 | −53.14±0.85 | 5.55±0.21 | | EmR | −2.30±0.98 | 91.39±1.51 | −2.75±0.32 | 72.03±0.95 | −8.43±1.00 | 46.88±2.03 | − | − | - | - | − | − | | SS-IL | − | − | − | − | − | − | −32.89±2.36 | 37.05±1.73 | −30.01±2.04 | 24.13±1.49 | −22.12±1.5 | 9.59±0.98 | | CoPE (S) | − | − | − | − | − | − | − | 49.14±3.70 | − | 5.25±1.40 | − | 1.43±0.02 | | CoPE (ME) | − | − | − | − | − | − | − | 36.12±1.12 | − | 4.31±1.02 | − | 1.34±0.12 | | CM | −2.09±0.71 | 92.72±1.33 | −5.88±0.90 | 74.76±1.17 −13.45±3.62 47.80±2.93 −18.71±10.84 64.64±12.78 | −62±1.23 | 27.91±0.39 −52.13±0.91 12.04±0.32 | | | | | | | approach regularizes too much the training approach, leaving no space for learning new tasks. In the end, the combination of the metrics is what we need to evaluate. In addition to these metrics, we also take into account the memory used by each method. The memory is calculated as the number of additional scalars, without counting the ones used to store the neural network, that must be kept in memory after the training of a task while waiting for the new one to be collected; the memory used during the training process is not counted as additional, since it can be discarded once the training is over. The formulas used to calculate the approximated required memory are: - EWC: this approach saves a snapshot of the model after each task. The required memory is: N × P. - OEWC: it is similar to the EWC, but it saves only one set of parameters, which is updated after the training on each task. The final memory is P. - Rehearsal approaches (CIL): these methods need an external memory in which a subset from each task is saved, and then used to regularize the training. The required memory depends on the number of images saved, and it is calculated as I×M×N. - EmR: this approach requires not only the images but also the features vector associated with each image (the output of the backbone). The required memory size is: (D + I)×M×N. - CM (TIL): requires only to save, after each task, the centroids of the classes in the tasks; thus, the memory size is E × T. where N is the number of tasks, P is the number of parameters in the neural network, I is the dimension of the input images, D is the dimension of the feature vector extracted by the model, and E is the dimension of the output related to our proposal. Implementation: To perform all the experiments, we used the Avalanche framework, which implements the logic to create tasks and evaluate the CL approaches. Regarding the methods, we implemented in Avalanche EmR and Centroids Matching, while the others are already present in the framework. The code containing all the files necessary to replicate the experiments is available here. ## 5.2 Results Classification results: Table 1 summarizes all the results obtained across the experiments, in terms of Accuracy and BWT. We can see that CM significantly improves the results in all the scenarios. The improvements on TIL scenarios are significant, by achieving an accuracy that is close to the upper bound set by the cumulative strategy. Moreover, the results are better than all the other methods when it comes to CIL scenarios. Surprisingly, the ER approach achieves also good results in all the scenarios, but not as good as the ones achieved by our proposal. The results clearly show the difficulty discrepancy between TIL and ![9_image_1.png](9_image_1.png) (a) How the accuracy score, obtained on CIFAR10 CIL scenario, changes when the number of the samples saved in the memory changes. ![9_image_0.png](9_image_0.png) (b) How the required memory grows when the number of tasks increases. The images have size 3 × 32 × 32. Figure 2: The images show the required memory for each method, as well as how the accuracy changes when the rehearsal memory grows (only for methods that require an external memory containing past samples). Table 2: The time, in terms of seconds, required to train the models on CIFAR10. The standard deviation as well as the scenario in which the times are obtained are shown. | Method | Scenario | Task 1 | Task 2 | Task 3 | Task 4 | Task 5 | |------------|------------|-------------|------------|------------|------------|-------------| | Naive | TIL-CIL | 9.74±0.26 | 10.84±0.27 | 10.40±0.27 | 11.06±0.16 | 10.50±0.33 | | Cumulative | TIL-CIL | 11.05±0.29 | 20.540.28 | 30.90±1.25 | 47.85±1.29 | 55.98±2.32 | | EWC | TIL-CIL | 13.61±0.020 | 17.760.50 | 22.32±0.28 | 28.001.04 | 28.89±1.55 | | OEWC | TIL-CIL | 11.87±0.23 | 16.73±0.18 | 16.42±0.63 | 16.720.61 | 17.29±0.22 | | ER | TIL-CIL | 12.40±0.31 | 34.00±0.72 | 61.17±1.26 | 88.28±0.73 | 113.78±3.62 | | GEM | TIL-CIL | 11.79±0.48 | 26.96±0.36 | 40.07±1.05 | 55.58±1.11 | 70.47±0.50 | | EmR | TIL | 9.88±0.27 | 18.97±1.85 | 43.08±0.05 | 72.49±7.40 | 102.20±0.35 | | SS-IL | CIL | 13.0±0.42 | 38.60±0.70 | 47.23±2.02 | 51.97±1.89 | 64.93±1.93 | | CM | TIL | 24.07±0.43 | 28.62±0.17 | 35.27±0.09 | 41.76±0.07 | 48.90±0.43 | | CM | CIL | 20.07±0.43 | 30.62±0.17 | 45.27±0.12 | 54.76±0.24 | 68.08±0.27 | CIL, because approaches that work well on the first one, drastically fail to overcome the CF in the second one; also, it seems that only methods that use an external memory are capable of achieving good results on CIL, and the sole parameters regularization is not enough to fight CF. Memory comparison: the memory required by CL methods is a crucial aspect, and in this section we study how the accuracy score is correlated to this aspect. Figure 2 shows all the aspects related to the memory size. All the results are obtained using the same training configuration used for the main experiments. The image 2a shows the memory usage, correlated with the achieved accuracy score, required by each method when solving CIFAR10 CIL scenario. Firstly, we see that GEM is not capable of achieving competitive results even when a large subset of samples is saved, while the others achieve good results even with a smaller memory dimension, and this is probably because a large number of samples is required to correctly estimates the gradients which are used to regularize the training. Regarding the other approaches, we see that our proposal achieves better results even when using a smaller memory. Not all the methods require an external memory containing samples from past tasks, and Image 2b shows how the memory required by all the memory changes when the number of tasks grows. We clearly see that, when it comes to solving TIL problems, our proposal requires a smaller memory than all the others. When looking at the results in Table 1 for CIL problems, and combining them with the curves in Image 2b, we can conclude that, despite a large amount of memory requested by some methods, few of them are capable of achieving good results; on the other hand, when solving CIL scenarios our approach becomes a rehearsal one, and the required memory is almost the same if compared to other rehearsal approaches. ![10_image_0.png](10_image_0.png) ![10_image_1.png](10_image_1.png) (a) The embedding space when the first task is over. (b) The embedding space when the third task is over. (c) The embedding space when the last task is over Figure 3: The images show how the embeddings spaces, associated with the first task from CIFAR10 TIL scenario, change while training on new tasks. We can see that, despite the small changes in the shape of the samples, the overall space is preserved during the whole training. The points are projected into a bi-dimensional space using PCA (Hotelling, 1936). Better viewed in colors. ![10_image_6.png](10_image_6.png) ![10_image_3.png](10_image_3.png) ![10_image_4.png](10_image_4.png) ![10_image_2.png](10_image_2.png) ![10_image_5.png](10_image_5.png) (a) The embedding space when the second task is over. (b) The embedding space when the third task is over. (c) The embedding space when the fourth task is over (d) The embedding space when the last task is over Figure 4: The images show how the merged embeddings space obtained on CIFAR10 CIL changes during the training on all the tasks. The images clearly show that new classes are added without interfering with the ones already present in the space. To visualize clearly the clustering space, we used Voronoi diagrams over the 2D projections of the centroids, obtained using PCA (Hotelling, 1936). The samples are omitted for clarity. Better viewed in colors. Training time comparison: the time required to train a model depends on the Cl approach used to fight the CF. Table 2 contains the time, in seconds, required to train an epoch in each of the 5 tasks of TIL CIFAR10 scenario exposed before. We can see that, among the most performing approaches, our proposal is the one that requires the lowest training time: it requires more time than the others during the first task since the extraction of the prototypes from the support set is involved, but then the overall time grows slower than the other approaches. The main difference is the use of the memory in fact when our method is used to solve CIL scenarios, the time required is closer to the other rehearsal approaches. Analysis of the embedding spaces produced by Centroids Matching: in this section we analyze how the regularization approach proposed influences the shape of the embedding space produced by a model. In Figure 3 we see how the embedding space, extracted from a model trained on CIFAR10 TIL scenario, changes while new tasks are learned: the regularization term is capable of keeping the embedding space almost unchanged, and well separable, during the whole training process. Is also interesting to see how our proposal merges the embedding spaces during the training on a CIL scenario, and this aspect is shown in Figure 4. We can see that the classes remain highly separable even in the late stages of the training procedure. The merged space is achieved in an incremental way, by inserting new classes into the existing embedding space, without moving already present centroids. For example, we see that, when passing from the first space to the second one, two new classes are added on the left of the existing embedding space, without interfering with the existing centroids. This is possible because the distance regularization works well, and also because Table 3: The results, in terms of average and standard deviation calculated over 2 runs, obtained on CIFAR10 CIL scenario when varying the merging strategy used, are shown. The results are both in terms of Accuracy and BWT (in the brackets), and both are calculated when training on the last task is over. | Task 1 | Task 2 | Task 3 | Task 4 | Task 5 | Accuracy | | |-----------------|----------------|----------------|----------------|----------------|------------|----------------| | Scale-Translate | 58.90 (−33.99) | 34.35 (−50.75) | 58.60 (−26.25) | 75.05 (−20.30) | 93.60 | 64.10 (−33.99) | | Linear | 43.15 (−54.70) | 51.00 (−35.40) | 46.55 (−45.80) | 63.35 (−24.95) | 89.35 | 58.68 (−40.21) | | Offset | 47.25 (−50.90) | 46.30 (−42.05) | 44.35 (−46.15) | 61.25 (−28.55) | 87.85 | 57.40 (−41.91) | | None | 43.45(−53.90) | 41.70(−46.95) | 42.00(−50.06) | 65.01(−21.74) | 87.80 | 56.01(−41.70) | the approach is capable of adapting the model to the embedding space, by correctly projecting the centroids and the samples of newer tasks. ## 5.3 Ablation Study Comparing merging procedures for CIL scenario. As exposed in Section 4.2, the merging function used to merge the embedding spaces uses a scale plus transaction function. Here, we study how the choice of the merging function pi(·) affects the results. To this end, we implemented different functions: - Scale-Translate: the merging function proposed in Section 4.2. - Linear: a simple linear layer is used to project the embeddings vector into the new space. - Offset: an offset is calculated using a linear layer on the embedding, and it is used to shift the embeddings of a given task. - None: the merging step is performed directly on the embeddings outputted by the model. For each approach, the weights of the merging networks are shared between the centroids and the embeddings of the same task, to avoid adding many parameters. In Table 3 the results are shown. We see that the Scale-translate approach achieves better results, on average, than all the other approaches, probably due to its inherent capacity to transform the embeddings. The only exception is the second task, in which the approach mentioned above loses more accuracy. Also, as expected, the approach None achieves the worst results but, surprisingly, it is capable of achieving a decent average accuracy. How the dimension of the support set affects the training procedure? Being the support set crucial to our proposal, we expect that its dimension affects the overall training procedure. On the other hand, we also expect that, once an upper bound on the number of support samples is stepped over, the results are not affected anymore, since the same centroids could be calculated using fewer samples. Table 4 shows the results obtained while changing the dimension of the support set. We can clearly see that, under a certain threshold, the results are very close. When the threshold is exceeded, we see a decrease in the achieved accuracy score. This could happen because more images are removed from the training set in order to create the support set, and this negatively affects the results, since some patterns could be missing from the training dataset. Different Merging approaches for embeddings and centroids. In the experiments so far we took into account only the merging approach in which the same merging strategy, and the same weights to perform the merging, are used for both embeddings and centroids. In this section, we also explore the approach in which different strategies are applied separately or when the same strategy uses different weights for centroids and embeddings, in order to understand better which approach is the best one when isolated. The results of this study are exposed in Table 5. We can see that the best results, overall, are achieved when the Scale-Translate merging approach is applied to the embeddings. By combining the results with the ones in the Table 3, we can conclude that the best models are achieved when both the centroids and the embeddings are projected using the same Scale-Translate layer. How does λ **affect forgetting?** In this section we analyze how the parameter λ, used to balance the regularization term in 5, affects the obtained results. The results are shown in Table 6, and we can see that setting λ too high leads the training process to fail when the scenario is a CIL one, and inhibits the training | Support set size | | | | | | |--------------------|-------|-------|-------|-------|-------| | 10 | 50 | 100 | 200 | 500 | | | TIL | 90.86 | 90.86 | 91.70 | 89.79 | 90.70 | | CIL | 59.63 | 63.97 | 63.55 | 63.16 | 61.04 | Table 4: The table shows the accuracy, averaged over 2 runs, obtained while changing the number of samples in the support set. The results are calculated using CIFAR10 scenarios; the hyperparameters are the same used in the main experimental section. Table 5: The table shows how combining the merging strategies, used by Centroids Matching, affects the final accuracy obtained on CIFAR10 CIL. | 0.01 | 0.1 | 1 | 10 | 100 | | |---------|----------------|----------------|----------------|----------------|----------------| | C10 TIL | 89.25 (−6.08) | 91.39 (−8.94) | 79.39 (−10.94) | 50.00 (−12.03) | 50.00 (−12.01) | | C10 CIL | 59.75 (−42.75) | 62.32 (−39.51) | 49.57 (−38.82) | 42.19 (−17.70) | 15.95 (−15.95) | Table 6: The results, in terms of average and standard deviation calculated over 2 runs, obtained on CIFAR10 CIL scenario when varying the merging strategy used, are shown. The results are both in terms of Accuracy and BWT (in the brackets), and both are calculated when training on the last task is over. | Embeddings | | | | | | |--------------|-------|--------|-------|-------|-------| | S-T | MLP | Offset | None | | | | Centroids | S-T | 62.40 | 56.92 | 60.91 | 60.67 | | MLP | 62.13 | 56.55 | 59.25 | 62.05 | | | Offset | 62.84 | 60.94 | 58.37 | 61.82 | | | None | 61.69 | 62.05 | 60.67 | 59.05 | | when it comes to TIL scenarios (achieving a small forgetting but a small overall accuracy). Moreover, the more the regularization term grows, the more the results degenerate; the same is true also when Λ is too small, leading to a model that is not able to remember correctly past tasks. In the end, we can conclude that the best results are obtained when the weight parameter is close and smaller than 0, leading to a model with a balanced trade-off between remembering past tasks and training on the current one. ## 6 Conclusions In this paper, we proposed an approach to overcome CF in multiple CL scenarios. Operating on the embedding space produced by the models, our approach is capable of effectively regularising the model, leading to a lower CF, requiring no memory when it comes to solving easy CL scenarios. The approach reveals that operating on a lower level, the embedding space, can lead to better CL approaches while having the possibility to analyze the embedding space to understand how the tasks, and classes within, interact. ## References H. Ahn, J. Kwak, S. Lim, H. Bang, H. Kim, and T. Moon. Ss-il: Separated softmax for incremental learning. In *Proceedings of the IEEE/CVF International Conference on Computer Vision*, pages 844–853, 2021. R. Aljundi, P. Chakravarty, and T. Tuytelaars. Expert gate: Lifelong learning with a network of experts. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3366–3375, 2017. E. Belouadah, A. Popescu, and I. Kanellos. A comprehensive study of class incremental learning algorithms for visual tasks. *Neural Networks*, 135:38–54, 2021. A. Chaudhry, M. Rohrbach, M. Elhoseiny, T. Ajanthan, P. K. Dokania, P. H. Torr, and M. Ranzato. On tiny episodic memories in continual learning. *arXiv preprint arXiv:1902.10486*, 2019. A. Chaudhry, A. Gordo, P. Dokania, P. Torr, and D. Lopez-Paz. Using hindsight to anchor past knowledge in continual learning. In *Proceedings of the AAAI Conference on Artificial Intelligence*, volume 35, pages 6993–7001, 2021. M. De Lange and T. Tuytelaars. Continual prototype evolution: Learning online from non-stationary data streams. In *Proceedings of the IEEE/CVF International Conference on Computer Vision*, pages 8250–8259, 2021. M. De lange, R. Aljundi, M. Masana, S. Parisot, X. Jia, A. Leonardis, G. Slabaugh, and T. Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. *IEEE Transactions on Pattern Analysis* and Machine Intelligence, 2021. J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In *2009 IEEE Conference on Computer Vision and Pattern Recognition*, pages 248–255, 2009. N. Díaz-Rodríguez, V. Lomonaco, D. Filliat, and D. Maltoni. Don't forget, there is more than forgetting: new metrics for continual learning. *arXiv preprint arXiv:1810.13166*, 2018. M. Farajtabar, N. Azizan, A. Mott, and A. Li. Orthogonal gradient descent for continual learning. In International Conference on Artificial Intelligence and Statistics, pages 3762–3773. PMLR, 2020. R. M. French. Catastrophic forgetting in connectionist networks. *Trends in Cognitive Sciences*, 3(4):128–135, 1999. X. Han and Y. Guo. Contrastive continual learning with feature propagation. *arXiv preprint arXiv:2112.01713*, 2021. K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In *Proceedings of the* IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. H. Hotelling. Relations between two sets of variates. *Biometrika*, 28(3/4):321–377, 1936. ISSN 00063444. S. Hou, X. Pan, C. C. Loy, Z. Wang, and D. Lin. Learning a unified classifier incrementally via rebalancing. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)*, June 2019. J. Kirkpatrick, R. Pascanu, N. Rabinowitz, J. Veness, G. Desjardins, A. A. Rusu, K. Milan, J. Quan, T. Ramalho, A. Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521–3526, 2017. A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009. M. R. Kurniawan, X. Wei, and Y. Gong. Online continual learning via multiple deep metric learning and uncertainty-guided episodic memory replay–3rd place solution for iccv 2021 workshop sslad track 3a continual object classification. *arXiv preprint arXiv:2111.02757*, 2021. Z. Li and D. Hoiem. Learning without forgetting. *IEEE transactions on pattern analysis and machine* intelligence, 40(12):2935–2947, 2017. D. Lopez-Paz and M. Ranzato. Gradient episodic memory for continual learning. *Advances in neural* information processing systems, 30, 2017. M. Masana, X. Liu, B. Twardowski, M. Menta, A. D. Bagdanov, and J. van de Weijer. Class-incremental learning: survey and performance evaluation on image classification. *arXiv preprint arXiv:2010.15277*, 2020. M. McCloskey and N. J. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. volume 24 of *Psychology of Learning and Motivation*, pages 109–165. Academic Press, 1989. T. Mensink, J. Verbeek, F. Perronnin, and G. Csurka. Distance-based image classification: Generalizing to new classes at near-zero cost. *IEEE Transactions on Pattern Analysis and Machine Intelligence*, 35(11): 2624–2637, 2013. doi: 10.1109/TPAMI.2013.83. O. Ostapenko, T. Lesort, P. Rodríguez, M. R. Arefin, A. Douillard, I. Rish, and L. Charlin. Foundational models for continual learning: An empirical study of latent replay. *arXiv preprint arXiv:2205.00329*, 2022. G. I. Parisi, R. Kemker, J. L. Part, C. Kanan, and S. Wermter. Continual lifelong learning with neural networks: A review. *Neural Networks*, 113:54–71, 2019. J. Pomponi, S. Scardapane, V. Lomonaco, and A. Uncini. Efficient continual learning in neural networks with embedding regularization. *Neurocomputing*, 397:139–148, 2020. J. Pomponi, S. Scardapane, and A. Uncini. Structured ensembles: An approach to reduce the memory footprint of ensemble methods. *Neural Networks*, 144:407–418, 2021. ISSN 0893-6080. doi: https: //doi.org/10.1016/j.neunet.2021.09.007. S.-A. Rebuffi, A. Kolesnikov, G. Sperl, and C. H. Lampert. icarl: Incremental classifier and representation learning. In *Proceedings of the IEEE conference on Computer Vision and Pattern Recognition*, pages 2001–2010, 2017. M. Riemer, I. Cases, R. Ajemian, M. Liu, I. Rish, Y. Tu, and G. Tesauro. Learning to learn without forgetting by maximizing transfer and minimizing interference. *arXiv preprint arXiv:1810.11910*, 2018. D. Rolnick, A. Ahuja, J. Schwarz, T. Lillicrap, and G. Wayne. Experience replay for continual learning. Advances in Neural Information Processing Systems, 32, 2019. A. Rosasco, A. Carta, A. Cossu, V. Lomonaco, and D. Bacciu. Distilled replay: Overcoming forgetting through synthetic samples. *arXiv preprint arXiv:2103.15851*, 2021. A. A. Rusu, N. C. Rabinowitz, G. Desjardins, H. Soyer, J. Kirkpatrick, K. Kavukcuoglu, R. Pascanu, and R. Hadsell. Progressive neural networks. *arXiv preprint arXiv:1606.04671*, 2016. G. Saha, I. Garg, and K. Roy. Gradient projection memory for continual learning. In International Conference on Learning Representations, 2020. J. Schwarz, W. Czarnecki, J. Luketina, A. Grabska-Barwinska, Y. W. Teh, R. Pascanu, and R. Hadsell. Progress & compress: A scalable framework for continual learning. In *International Conference on Machine* Learning, pages 4528–4537. PMLR, 2018. J. Serra, D. Suris, M. Miron, and A. Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. In *International Conference on Machine Learning*, pages 4548–4557. PMLR, 2018. J. Snell, K. Swersky, and R. Zemel. Prototypical networks for few-shot learning. *Advances in neural* information processing systems, 30, 2017. A. M. N. Taufique, C. S. Jahan, and A. Savakis. Unsupervised continual learning for gradually varying domains. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition* (CVPR) Workshops, pages 3740–3750, June 2022. G. M. Van de Ven and A. S. Tolias. Three scenarios for continual learning. *arXiv preprint arXiv:1904.07734*, 2019. G. M. van de Ven, H. T. Siegelmann, and A. S. Tolias. Brain-inspired replay for continual learning with artificial neural networks. *Nature communications*, 11(1):1–14, 2020. T. Veniat, L. Denoyer, and M. Ranzato. Efficient continual learning with modular networks and task-driven priors. *arXiv preprint arXiv:2012.12631*, 2020. J. Yoon, E. Yang, J. Lee, and S. J. Hwang. Lifelong learning with dynamically expandable networks. *arXiv* preprint arXiv:1708.01547, 2017. J. Yoon, D. Madaan, E. Yang, and S. J. Hwang. Online coreset selection for rehearsal-based continual learning. arXiv preprint arXiv:2106.01085, 2021. F. Zenke, B. Poole, and S. Ganguli. Continual learning through synaptic intelligence. In D. Precup and Y. W. Teh, editors, *Proceedings of the 34th International Conference on Machine Learning*, volume 70 of Proceedings of Machine Learning Research, pages 3987–3995. PMLR, 06–11 Aug 2017.
Review 1: Summary: **Problem**: This work addresses the problem of continual learning *i.e.* learning a sequence of tasks without forgetting/deteriorating performance on the previous. The work focuses on the standard setting of a sequence of image classification tasks. **Solution**: The paper proposes a solution called "centroid matching" which involves learning and memorizing the centroids of the classes for each task. In addition to this, the training involves novel regularization methods which help in alleviating issues of forgetting. The regularization ensures that previously learned centroids are not perturbed while training on novel tasks. Strengths and Weaknesses: # Writing, Problem Statement, Motivation, Related Work ### Strengths The paper does a thorough job of presenting the problem statement in a concise manner. The introduction explains the continual learning problem and issues of catastrophic forgetting. This work extends beyond the standard "Task Incremental Learning" version of continual learning (known task boundaries and identities) to the "Class Incremental Learning" formulation (unknown task identities for samples). While the text proposes two somewhat different approaches for the two settings, the text clearly presents the distinction while limiting any confusion. ### Weaknesses - Portions of the text are redundant and repetitive. For example, the distinction between task incremental and class incremental learning appears in Sec 1, Sec 2, Sec 3 and Sec 4.2. - While most relevant literature has been cited, I think the discussion on the distinctions between existing work and the proposed work can be elaborated further. For example, Prototypical Networks serves as an important backbone for this work and has been just cited in passing. There also seem to be a lot of similarities to De Lange and Tuytelaars (2021). This work also has been very briefly mentioned. # Approach ### Strengths, Novelty The presented approach is very intuitive to follow. The key component is a novel regularization used in conjunction with Prototypical Networks trained in a continual learning setting. The regularization ensures that the previously learned prototypes (or centroids) are unperturbed. This overall idea is simple, novel and might be of general interest. The proposed approach is also fairly general and can be applied in both the continual learning problem formulations - Task Incremental Learning and Class Incremental Learning. Due to the difference in the two settings the paper proposes slightly modified implementations of the regularization. I believe these ideas provide interesting and useful guidelines for implementing general regularization methods in the continual learning framework. Unlike some previous work on continual learning, the proposed approach also makes efficient use of memory during training. ### Weaknesses, Concerns, Questions - The objective in Eq 4 relies on images from novel tasks for ensuring that the embedding of previously seen images is unperturbed. However, this might not be very effective if the images are from significantly different distributions. - Since the amount of regularization increases with number of additional tasks, it might be the case that the model performs poorly on the later tasks due to over-regularization. This might also mean that the training is sensitive to the order of tasks seen. # Results ### Strengths The proposed work outperform the accuracy of reported existing works on numerous continual learning benchmarks (CIFAR10, CIFAR100, TinyImageNet). Furthermore, the reported accuracy is higher for both formulations of the problem (TIL, CIL). The paper presents a thorough analysis of the different features of the proposed work. The analysis of memory consumption shows that the performance of the proposed work scales better compared to existing work. The memory consumption of the proposed work also increases slower with increasing number of tasks. The results present very interesting visualizations of the learned feature embeddings. The visualizations show that the centroids are indeed unperturbed when training on novel tasks. It also demonstrates that the model learns to cleverly assign novel centroids to minimize conflicts with previously learned centroids. ### Weaknesses - The BWT metric seems to be a better metric for measuring the amount of forgetting. However, the proposed work seems to underperform on this metric while being better on overall accuracy. - To the best of my understanding, De Lange and Tuytelaars (2021) is the closest related work. However, it looks like experimental comparisons to this work has been omitted. Requested Changes: Some suggestions for improving the paper: #### From weaknesses in Approach above - Analysis of sensitivity to the order of tasks might be interesting to add. For example, if the subsets of cifar100 were permuted, does the final overall accuracy stay the same? - Analysis of sensitivity to more significant changes in distribution might be interesting to compare with existing works. For example, training on a subset of cifar10 and then a subset on tinyimagenet and then a subset of cifar100. #### From weaknesses in Results above - Could you add an explanation or experimental analysis for the worse BWT? - Is there a reason that De Lange and Tuytelaars (2021) cannot be included in the comparisons? Broader Impact Concerns: The paper does not include a broader impact section. However, I do not see any obvious ethical concerns in this work. ================================================== Review 2: Summary: The paper studies task incremental and class incremental continual learning where the authors propose to learn and use class centroids for classification. The Centroid Matching (CM) framework uses a held-out set to calculate the centroids during the training and then uses(distribution of) the euclidean distance of the inputs and centroids as the objective. In addition, in the task incremental setting, a regularization term will be used that penalizes new task data for being close to previous tasks' centroids. In contrast, in the class incremental setting, since the classification head is shared, CM uses an episodic memory and projects embeddings into a shared space. The authors then validate the effectiveness of the CM approach in both task and class incremental setup, in addition to some ablation studies. Strengths and Weaknesses: ## Strengths 1. The paper does a great job of explaining the method very clearly. 2. The proposed method performs well under task and class incremental setups. ## Weaknesses 1. **Baselines**: My first concern is about the baselines. I believe there have been several methods proposed in the past two years that perform significantly better than the classic CL methods, such as EWC and GEM. In addition, while CoPE is motivated by streaming settings, I believe a comparison would be nice since the fundamental assumptions in both works are similar. 2. **Computation**: From the paper, it seems like to calculate the regularization term (Eq. (4)), we need both the previous backbone and heads. So I think the runtime is twice as the naive model. However, there are no runtime comparisons between the baselines, and I think it is necessary to compare the runtimes/computation requirements. 3. **Memory Size**: In Sec. 5.1, the authors mention they use different memory sizes for different methods. For instance, for the CIFAR-100 benchmark, GEM uses 1000 examples, ER uses 500 examples, and EmR uses 2000 examples. I think this makes the evaluation confusing. Could the authors explain the rationale behind this choice? Requested Changes: I believe the following changes are crucial (see above for details): 1- Including more recent/related baselines. 2- Providing runtime comparison between different methods. 3- Explain the different memory sizes or use a similar memory size for all methods. Broader Impact Concerns: N/A ================================================== Review 3: Summary: The authors propose a continual learning method that operates in the Class- and Task-Incremental scenarios by learning through centroid matching and inferring via a nearest neighbour scheme. The authors evaluate their proposal on three commonplace CL classification datasets and carry out several ablation studies to better characterise their design decisions and the behaviour of the proposed approach. Strengths and Weaknesses: This work proposes a straightforward and simple approach for continual learning. I found it to be well-written and easy to follow, for which I congratulate the authors. However, I believe that several additional steps need to be taken for the proposal to be clearly outlined and fairly evaluated and for related works to be more accurately represented. I list them in the following: ## Proposal Design - **Distinction w.r.t. CoPE**: the presented approach is quite similar to CoPE, proposed in (De Lange and Tuytelaars, 2021), as also mentioned in the text. Both approaches follow the same idea and basically optimise the same loss, but I reckon there are some differences (i.e.: CoPE proposing a specific heuristic for centroid update vs. CM introducing an architectural solution by having a separate $f_i$ for each task). I strongly recommend expanding the discussion of (De Lange and Tuytelaars, 2021) to let the reader better understand how these two works differ. This needs to be complemented with a thorough experimental analysis, thus also providing a quantitative counterpart to the analysis (more on that below). - **Usage of replay memory**: I find it somewhat convoluted that the authors propose two separate methods for the TIL and CIL settings. In my understanding, the only rationale for this dichotomy is that TIL is significantly easier than CIL, thus not requiring the introduction of a separate memory buffer. Nonetheless, I expect the memory-equipped version of CM to outperform memoryless CM in TIL too. Instead of proposing two practically identical methods, I believe that a clearer exposition could be made by only proposing memory-equipped CM and then investigating the possibility of removing the memory in TIL in a separate ablation study. ## Fair Evaluation - **Better competitors are needed**: the selection of evaluated competitors in section 5.1 is not reflective of the current state of the art in continual learning classification. The only competitor which is not designed for the TIL setting is ER (still, its effectiveness varies considerably depending on implementation details [1, 2]). In a modern paper targeting the CIL setting, I expect the inclusion of several of the following strong recent baseline methods: iCaRL [3], LUCIR [4], GDumb [5], LSIL [6], GSS [7], DER++ [8], SS-IL [9], ER-ACE [10]. As discussed above, I believe that the experimental inclusion of CoPE (De Lange and Tuytelaars, 2021) is also of the utmost importance. - **Number of epochs**: I could not find any information about the number of training epochs, which is a pretty important factor conditioning the results that are obtained in CL classification. This information should be featured clearly in the text. - **Uneven memory in comparisons**: from my understanding, the authors write that the following memory buffers are used: - CIFAR10: GEM uses 500 examples per task (so, 2500 in total?), EmR uses 200 (1000 in total?), ER uses 1000 (in total? per task? this is not clear, CM uses 500 (also, unclear whether this is the total or per-task number). - CIFAR100: GEM uses 1000 examples per task (10000 in total, 1/6 of the overall dataset?), EmR uses 200 (1000 in total?), ER uses 500 (in total? per task?), CM uses 500 (in total? Per task?). - TinyImageNet: GEM uses 1000 examples per task (10000 in total, 1/6 of the overall dataset?), EmR uses 200 (1000 in total?), ER uses 1000 (in total? per task?), CM uses 500 (in total? Per task?). I think that this pieces of information should be provided more clearly; from my understanding, I see a remarkable disparity in the allowance of replay buffer across these methods, which makes the proposed experimental comparison hard to understand. I would recommend using at least the same memory size for all competitors. - **Memory usage**: in line with and beyond the previous point, I agree with what is stated in Sec. 5.1, namely that different competitors employ widely varying working memory for their training and operation. I believe that it would be very useful for the reader if a memory occupation/performance analysis graph were provided for a couple of experimental CIL settings. Such a comparison clearly allows for a direct comparison across all methods. It would also be interesting to highlight the support set memory footpring (which is not needed by the competitors) in this comparison. - **Batch normalisation trick**: is the batch norm trick described in the first paragraph of page 8 also employed for other competitors in TIL benchmarks? If not, I would be very interested in seeing how it affects the performance of e.g. ER, given that the batch norm drift is factor known to affect CL results in a major fashion [11]. ## Exposition of related works - **Improving the characterisation of TIL vs CIL**: the authors suggest that mostly of the experimental evaluation in CL happens in the TIL scenario and "fewer methods have been proposed to efficiently solve [CIL]". I believe that this is no longer reflective of the current state of literature, where CIL is widely understood - as also stated by the authors - to be much more interesting than TIL [12, 7, 13, 14] and a consistent number of baselines targets this setting directly [3, 4, 5, 6, 7, 8, 10]. I would argue that in the last two/three years it is much easier find papers referring to CIL in major conferences than TIL. I would suggest accounting for this fact in the main text and de-emphasising the role of TIL. - **Improving the characterisation of regularisation and rehearsal methods**: in the related works section, I do not agree with some proposed characterisation of regularisation and rehearsal methods. For the former, it is written that they "fight CF by forcing the model's parameters [...] to be as close as possible to the [previous optimum]". This description is not necessarily fitting to methods that regularise the output instead of parameters, such as LwF. Similarly, I do not at all agree with the statement that "the most representative method in [rehearsal methods] is [GEM]". In fact, I would rather characterise it as a somewhat hybrid solution that uses replay examples to compute a regularisation/projection term instead of simply replaying stored data. Furthermore, I do not understand the statement that "[GEM] was the first method that can improve the scores obtained on past tasks": this is not true, as ER (which was originally proposed in the 90s) also fits this description, if one performs few epochs on a given task, then the model is likely not to perfectly fit the data and thus to improve its performance on it upon replay. I recommend adjusting these sentences to better characterise regularisation and rehearsal methods. - **Introduction could use more citations**: as a minor suggestion, I believe that the introduction presents multiple claims which are not supported through citations in literature and thus end up appearing as quite unjustified. I suggest introducing further citations so as to make it possible for the reader to go in depth on specific aspects of CL by themselves. Examples of sections that would need it are "we can't save all past samples encountered during training", "class-incremental [...] is much harder to deal with, being closer to a real-world scenario". ## Misc Minor Points - **Unclear claim in sec. 5.3**: I do not entirely understand the claim made in the first paragraph of sec. 5.3, which states that there exists a critical number of samples beyond which results don't improve since the same centroids are computed with fewer samples. I am not sure that this is immediately evident, could it be experimentally verified that one obtains the same centroids for different sizes of the support set? - **Reordering ablation tables**: I would suggest presenting the Tables 2-5 in the same order they are cited in text. - **Typos**: while reading, I found the following typos: - the spelling of Matthias De Lange's name is inconsistent in citations; - sec. 4.1, two lines above eq. 1: centroids -> centroid - sec. 4.1, one line below eq. 5: the final centroids, for the classes in the task, are calculated -> the final centroids for the classes in the task are calculated - sec. 4.2, in eq.7 $Y_i$ seems to have a different meaning w.r.t. $Y_i$ in eq.2, I would recommend choosing a different symbol - sec. 4.2, in eq.7 it seems that the second operand of d is $p_i(x)$, should it not be $p_i(e_i(x))$? Is it operating on an embedding or on the input? - sec. 4.2, one line above eq.10: corresponding class -> corresponding task - why is there no variance in the results of EWC and OWC on TinyImageNet? [1] Chaudhry, Arslan, et al. "On tiny episodic memories in continual learning." ICML workshop 2019. [2] Buzzega, Pietro, et al. "Rethinking experience replay: a bag of tricks for continual learning." 2020 25th International Conference on Pattern Recognition (ICPR). IEEE, 2021. [3] Rebuffi, Sylvestre-Alvise, et al. "icarl: Incremental classifier and representation learning." Proceedings of the IEEE conference on Computer Vision and Pattern Recognition. 2017. [4] Hou, Saihui, et al. "Learning a unified classifier incrementally via rebalancing." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019. [5] Prabhu, Ameya, Philip HS Torr, and Puneet K. Dokania. "Gdumb: A simple approach that questions our progress in continual learning." European conference on computer vision. Springer, Cham, 2020. [6] Wu, Yue, et al. "Large scale incremental learning." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019. [7] Aljundi, Rahaf, et al. "Gradient based sample selection for online continual learning." Advances in neural information processing systems 32 (2019). [8] Buzzega, Pietro, et al. "Dark experience for general continual learning: a strong, simple baseline." Advances in neural information processing systems 33 (2020): 15920-15930. [9] Ahn, Hongjoon, et al. "Ss-il: Separated softmax for incremental learning." Proceedings of the IEEE/CVF International Conference on Computer Vision. 2021. [10] Caccia, Lucas, et al. "New insights on reducing abrupt representation change in online continual learning." ICLR 2022. [11] Pham, Quang, Chenghao Liu, and Steven Hoi. "Continual normalization: Rethinking batch normalization for online continual learning." ICLR 2022. [12] Farquhar, Sebastian, and Yarin Gal. "Towards robust evaluations of continual learning." ICML workshop 2018. [13] Masana, Marc, et al. "Class-incremental learning: survey and performance evaluation on image classification." arXiv preprint arXiv:2010.15277 (2020). [14] Belouadah, Eden, Adrian Popescu, and Ioannis Kanellos. "A comprehensive study of class incremental learning algorithms for visual tasks." Neural Networks 135 (2021): 38-54. Requested Changes: Summing up from my previous points, I recommend the following revisions (listed by descending importance) - Expanding and enriching the theoretical comparison with CoPE (De Lange and Tuytelaars, 2021); - Introducing CoPE as a full-fledged experimental competitor in this paper; - Introducing better CIL competitors to the experimental section (I recommend choosing among iCaRL, LUCIR, GDumb, LSIL, GSS, DER++, SS-IL, ER-ACE); - Providing the results for memory-equipped CM in TIL and exploring the trade-off of TIL accuracy/memory occupation linked to removing its memory; - Mentioning the secondary role of TIL for current literature and highlighting that a relevant portion of contemporary works refer to CIL instead; - Revising the statements in the related works section concerning regularisation methods and GEM; - Introducing more citations in support of the claims of the introduction; - Further explaining/adding experimental evidence in support of the claim in sec. 5.3; - fixing the typos listed above; - Reordering tables 2-5. Broader Impact Concerns: N/A ================================================== Metareview: Recommendation: Accept with minor revision Comment: This paper proposes a method for mitigate catastrophic forgetting in task-incremental and class-incremental learning settings. The approach builds upon Prototypical Networks, which performs classification using a softmax over distances to prototypes formed by taking the centroid of the embeddings of examples belonging to each class. In the task-incremental learning setting, each task gets a new head, and the model is regularized so that the embeddings of the new examples using the old heads match the embeddings obtained using a frozen clone of the model made before initiating training on the new task. In the class-incremental learning setting, all tasks are additionally projected to a common embedding space where all classes can be discriminated, and a small set of examples from previous tasks are used to ensure that it is possible to separate the classes in the common embedding space. Reviewers noted that, although the proposed approach is similar to CoPE (De Lange and Tuytelaars, 2021), it is novel and performs well, but requested additional baselines. The authors have added these baselines, and all reviewers now recommend acceptance. I am satisfied with the revisions the authors have made over the course of the review process and recommend acceptance. There are a few changes that I believe could further strengthen the paper: - Given the discussion between the authors and Reviewer NcrE of what constitutes a fair CoPE baseline, I feel that the paper should describe the CoPE baseline setup in greater detail than it currently does, and include both the single-epoch and multi-epoch CoPE results that they provided over the course of the response period. - I believe there is a missing log in Eq. 9. Furthermore, the first paragraph of Section 4.2 implies that the loss on the shared embedding space in the CIL setting is applied in addition to the other losses applied in the TIL setting, but these losses do not appear in Eq. 9. It would be helpful to clarify these points. - As Reviewer NcrE privately in their recommendation, there is a red CoPE label in the legend of Figure 2a, but no red bars in the graph. ==================================================
# Complementary Sparsity: Accelerating Sparse Cnns With High Accuracy On General-Purpose Computing Platforms Yijun Tan∗*tanyj1998@gmail.com* SKL of Processors, Institute of Computing Technology, CAS Yunhe Wang†*yunhe.wang@huawei.com* Huawei Noah Ark's Lab Jun Yao†yaojun97@huawei.com Huawei Noah Ark's Lab Kang Zhao∗*zhaokang29@huawei.com* Huawei Noah Ark's Lab Kai Han *kai.han@huawei.com* Huawei Noah Ark's Lab Ting Hu *huting35@huawei.com* Huawei Noah Ark's Lab Hanting Chen *chenhanting@huawei.com* Huawei Noah Ark's Lab Tao Yuan yuantao38@huawei.com Huawei Noah Ark's Lab Reviewed on OpenReview: *https: // openreview. net/ forum? id= g1B4qgOw79* ## Abstract Model sparsity is a promising approach to reducing parameters and FLOPs of convolutional neural networks (CNNs). Compared to unstructured or coarse-grained structured sparsity, fine-grained structured sparsity, e.g., N:M sparse pattern, can achieve better balance between accuracy and efficiency on general computing platforms like CPUs and GPUs. In particular, the 2:4 sparsity can accelerate CNN inference by 2× speed and with negligible accuracy drop. However, N:M sparsity needs to be supported by GPU within specific hardware circuits and hardly achieve significant speedups on common GPUs. To accelerate CNNs with general-purposed computing resources and simultaneously retain the model accuracy as much as possible, this paper proposes complementary sparsity (CS). CS denotes that only one weight can be retained for weights spaced at the same distance. On the one hand, CS features high mask flexibility, which is naturally favorable to high model accuracy. Moreover, we propose a CS-specific sparse training method to improve CS-based CNNs' accuracy under high parameter sparsities (>75%). On the other hand, CS itself is memory-access balanced and robust to pattern hyperparameters, making it an ideal candidate for speeding up CS-based convolution computation on CPUs and common GPUs. We thus propose a CS convolution parallel computing algorithm that adapts to common GPUs without sparse tensor cores. Experimental results show that compared to other sparsity patterns, the proposed CS achieves the optimal trade-off in terms of accu- ∗Equal contribution. †Corresponding author. racy and latency for CPUs and common GPUs, respectively. Codes will be available at https://gitee.com/mindspore/models/tree/master/research/cv/CS. ## 1 Introduction Weight sparsification is a crucial method to compress CNNs. The rationality behind weight sparsification is that there are redundant weights in regular CNNs which tend to generate overlapped features (Hoefler et al., 2021; Ayinde et al., 2019). Thus, removing a certain amount of weights in CNNs has little or manageable impact on CNN's accuracy, while it can significantly lower CNN's number of floating-point operations (FLOPs) during inference. According to the extent of pruning freedom and acceleration affinity, the existent weight sparsification technologies for CNNs can be divided into three categories: unstructured sparsity (US), coarse-grained structured sparsity (CSS), and fine-grained structured sparsity (FSS). US, depicted in Fig. 1(a), also called random sparsity in some studies (Huang et al., 2022), permits pruning weights anywhere inside a weight tensor (Zhu & Gupta, 2017; Gale et al., 2019; Mostafa & Wang, 2019; Evci et al., 2020; Kusupati et al., 2020; Liu et al., 2021; Ma et al., 2021; Peste et al., 2021; Tai et al., 2022; Jaiswal et al., 2022; Park & No, 2022; Chen et al., 2021; Li et al., 2022a). Due to US's highest degree of pruning freedom, the most important weights affecting network quality can always be retained under any sparsity. Hence, unstructurally sparsed networks can preserve a decent accuracy even if sparsity is very high (≥ 90%). However, the nonuniformity of weight distribution makes it nearly impossible to accelerate US-based convolution on general-purpose computing platforms. In contrast, for CSS, e.g., Fig. 1(b)-(d), the pruning granularity is block, channel, or filter -wise (Wen et al., 2016; Li et al., 2016; Gray et al., 2017; Ji et al., 2018; Liu et al., 2017; Tang et al., 2020; Ding et al., 2021; Hou et al., 2022; Liu et al., 2022; Chen et al., 2022; Zhang et al., 2022; He & Xiao, 2023). CSS's patterns are generally with high regularity, which can significantly speedup the network inference. For some of CSS patterns such as filter pruning and channel pruning, i.e., Fig. 1(c) and 1(d), the pruned CNNs can directly operate on the original platforms without any new acceleration algorithm design. Nonetheless, the relatively bigger pruning granularity inevitably entails that many important weights are removed together with unimportant weights. Under the same accuracy, CNNs within CSS own a lower compression ratio compared to that within US patterns. In this study, we focus on FSS since it generally results in better tradeoffs between accuracy and efficiency. We classify a sparsity pattern as FSS if its pruning granularity is vector-wise (Yao et al., 2019; Mishra et al., 2021; Huang et al., 2022; Tan et al., 2022; Meng et al., 2020), e.g., Fig. 1(e)-(h). Compared with US and CSS, FSS possesses both high prunability and decent acceleration affinity. However, the existing FSS patterns more or less have some shortcomings, as shown in Table 1. N:M sparsity, which has been the most popular FSS pattern lately, mainly facilitates inference efficiency on specific hardware, e.g., Amphere architecture within sparse tensor cores (Choquette & Gandhi, 2020). Some work tries to accelerate N:M-base convolution on common GPUs without sparse tensor cores (Yao et al., 2019), but the practical speedup benefits compared to the dense convolution are probably limited, since the dense convolution has been adequately optimized and perfectly supported by current common GPUs. Shfl_BW Huang et al. (2022) and OVW Tan et al. (2022) sparse patterns achieve practical speedups on common GPUs, but CNNs using these two patterns have not reached a satisficatory accuracy so far. In this paper, we propose a complementarily sparsed pattern to better balance the accuracy and inference efficiency of sparse CNNs. **The design principle behind complementary sparsity (CS) is to leverage** the non-conflict strengths of the prior sparse patterns as much as possible while addressing their limitations. Firstly, like N:M sparsity, CS prunes weights inside a vector. Secondly, the positions of the pruned weights and retained weights are complementary. For example, Fig. 1(e) shows a 50% CS. In this subfigure, a vector's shape is 8×1, as marked by the red frame. The 'complementary' means that inside the vector, if the 1st weight is pruned, then the 5th weight has to be retained. This logic is the same for the 2nd and 6th weights, and so forth. Lastly, the size of a minimum vector to form CS is variable, which property is called hyperparameter robustness. The hyperparameter robustness of CS makes the pattern very adaptive to different computing platforms, such as CPUs and GPUs. ![2_image_0.png](2_image_0.png) Figure 1: Visualization of different sparse patterns at the 50% sparsity. (a) Unstructured structured sparsity that allows to discard weights of arbitratry positions. (b)-(d) Coarse-grained structured sparsity. (e)-(h) Fine-grained structured sparsity. In particular, (e) is the proposed complementary sparsity and '2 SELE. 1' represents retaining one from two weights in all the complementary positions. 2 Huawei Proprietary - Restricted Distribution The major contributions of this paper are as follows: - We propose a new sparse pattern—CS, which features both high mask flexibility and high acceleration affinity. CS allows pruning CNNs with less accuracy reduction and accelerating sparse CNNs on both CPUs and common GPUs. - Used in the training phase, a CS-specific sparse training method is proposed to boost CS-based CNNs' accuracy under high sparsities. With the proposed method, CS-based CNNs perform on par with or better than that with N:M sparsity in terms of accuracy. At the 50% sparsity on ImageNet, CS-based ResNet50 achieves 76.37% accuracy with negligible accuracy loss. At the 93.75% sparsity, CS-based ResNet50 achieves 71.07% accuracy with a 5.32% drop, which is better than N:M sparsified ResNet50 which drops 5.8%. - Used in the inference phase, a parallel acceleration algorithm is proposed to speedup the CSbased convolutions on common GPUs. With the acceleration algorithm, CNNs within CS achieves 2.59×~3.07× speedups at the 93.75% sparsity over the dense counterparts supported by cuDNN. Through the algorithm-software co-optimization, the proposed CS reaches better tradeoffs between sparse CNNs' model quality and inference efficiency compared with other fine-grained structured sparse patterns. To be clear, the advantages of our CS over similar works are shown in Table 1. ## 2 Related Work Unstructured sparsity (US) Neural networks within US have been researched for a long time. The winning ticket hypothesis denotes that there always exists a sparse neural network inside a dense network and the subnetwork can be trained to reach the comparable accuracy as the dense one (Frankle & Carbin, 2018). Since the hypothesis was proposed, a surge of studies have focused on developing good pruning methods to form US. Gale et al. (2019); Zhu & Gupta (2017) improve the magnitude-based pruning methods simply by gradually sparsifying and prolonging the training time, respectively. Rather than fully training a dense network before pruning, Mostafa & Wang (2019); Evci et al. (2020); Ma et al. (2021) adopt the | Pattern | Acceleration w/o ASICs | Accu. | |----------------------------|--------------------------|---------| | US | Almost impossible | High | | Block sparsity | Yes | Low | | Filter pruning | Yes | Low | | Channel pruning | Yes | Low | | N:MMishra et al. (2021) | Hard | High | | Shfl_BWHuang et al. (2022) | Yes | Medium | | OVWTan et al. (2022) | Yes | Medium | | CS (Ours) | Yes | High | Table 1: Comparison among different sparse patterns. sparse training to directly generate the unstructured sparse neural networks. These sparse training methods basically contain a common mechanism that periodically prunes and regrows some weights according to some criterion. Furthermore, Peste et al. (2021) alternatively conducts sparse and dense training. In this way, both dense and unstructured sparse neural networks are generated after training. Instead of pruning weights by carefully designed criterion, Kusupati et al. (2020); Tai et al. (2022) learn the sparse masks by differentiation. In particular, the proposed method in Tai et al. (2022) reports the state-of-the-art accuracy of US-based CNNs on the ImageNet dataset. Generally, CNNs within US can not obtain significant speedup gains on CPUs and common GPUs due to the severe memory-access conflict. Coarse-grained structured Sparsity (CSS) Normally, CSS can be enforced along either the input or output axes of a weight tensor. Separately shrinking the output and input axis is called filter and channel pruning, respectively. Pruning a square block in both input and output axes is called block sparsity (Gray et al., 2017). To our knowledge, Wen et al. (2016) is the first to propose filter pruning or channel pruning for CNN compression. In their study, the group LASSO method is directly enforced into weights to induce sparsities among filters or channels. Some studies like Liu et al. (2017); Ding et al. (2021) employ extra indicators to evaluate the filters, e.g., scaling factors in batch normalization layers, or properly placed 1 × 1 convolutions that can be absorbed during inference. Since pruning filters also result in pruning the related channels in the next layers, the proposed method in Li et al. (2016) jointly considers the impact of filter and channel pruning on network accuracy. Rather than developing various hypotheses to measure the importance of filters, Tang et al. (2020) assesses filters by observing the network responses to real data and adversarial samples. Besides, some principles originally used for US have lately been introduced to realize CSS, e.g., Hou et al. (2022); Tai et al. (2022). Despite these efforts, CSS-based CNNs' accuracy is still relatively lower and drops drastically especially when the required sparsity> 70%. Fine-grained structured sparsity (FSS) N:M sparsity is a well-known fine-grained structured sparse pattern where at most N non-zero weights are retained for every continuous M weights (Yao et al., 2019; Mishra et al., 2021; Lu et al., 2023; Zhang et al., 2023). However, N:M sparse pattern needs to be supported by GPUs embedded with sparse tensor cores. On common GPUs, the pattern hardly outperforms dense convolutions supported by cuDNN. To tackle the problem, Shfl_BW and OVW sparsity regard a M × 1 vector as an entirety which is pruned or retained together (Huang et al., 2022; Tan et al., 2022). By this design, the retained weights and the related features during convolution computation can be easily indexed. Thus, Shfl_BW and OVW sparsity can accelerate convolutions on common GPUs to a great extent. However, the relatively large pruning unit of M ×1 still decreases the flexibility (Hubara et al., 2021), which results in reduced model accuracy. In contrast, our CS can help maintain similar or better model accuracy relative to N:M sparsity, as well as achieve the practical speedups of sparse convolutions on common GPUs and CPUs. GPU acceleration for convolutions So far, there are basically four sorts of parallelable algorithms to implement convolutions: direct convolution, Winograd (Chikin & Kryzhanovskiy, 2022), FFT (Wang et al., 2020), explicit general matrix multiplication (GEMM) (Jiang et al., 2022) and implicit GEMM (Zhou et al., 2021b). Among these, GEMM-base convolution algorithms are more performant on GPUs since the modern parallel computing platforms have highly optimized the GEMM operations (Chetlur et al., 2014; Jorda et al., 2019; Li et al., 2022b). However, explicit GEMM-based convolutions need to firstly invoke img2col to change tensors to matrices, which is memory access-intensive and time-consuming. By contrast, implicit GEMMbased convolutions remove the memory access overheads, which is top-performed in most cases. Moreover, Tan et al. (2022) employs the implicit GEMM to accelerate sparse convolutions, which implies the potential of implicit GEMM to speedup other sparse patterns. In this work, the implicit GEMM is also utilized to develop the parallel acceleration algorithm of CS-based convolutions on common GPUs. ## 3 Method 3.1 Complementary Sparsity Formulation For a sparse weight tensor W with the shape of Cout×Cin×Fh×Fw, each filter Wi has the shape Cin×Fh×Fw and is flattened. We use Wi[j] to denote the jth weight in the flattened Wi. S is the sparsity of the weight tensor. Two key parameters are introduced to conveniently describe CS: 1) K. K denotes the amount of the complementary positions from which only one single weight should be selected. For instance, at the 50% sparsity, there should be K = 2 complementary positions for selecting a weight. for the 75% sparsity, there are K = 4 complementary positions from which a weight is selected. 2) M. M represents the address offset with which weights in the complementary positions can mutually be located. Specifically, $$K=\frac{1}{1-S}\tag{1}$$ $$\left(1\right)$$ $$\left(2\right)$$ $$\left({\mathrm{3}}\right)$$ $$\left(4\right)$$ $$M={\frac{L}{K}},L\in\left\{C_{i n}/c,C_{i n}*F_{h}*F_{w}\right\}$$ , L ∈ {Cin*/c, C*in ∗ Fh ∗ Fw} (2) In Equation 2, if L = Cin/c, the typical values of M include 2, 4, 8, 16. Here c only means that Cin should be divisible by M. Then, a sparse weight tensor is regarded as complementarily sparsed as long as for any Wi[j], i ∈ [1, Cout], j ∈ [1, M], $$\|W_{i}[j],W_{i}[j+1*M],...W_{i}[j+(K-1)*M]\|_{0}<K$$ kWi[j], Wi[j + 1 ∗ M]*, ...W*i[j + (K − 1) ∗ M]k0 < K (3) Furthermore, a sparse weight tensor is regarded as strictly conforming to the pattern of CS if and only if $$\|W_{i}[j],W_{i}[j+1*M],...W_{i}[j+(K-1)*M]\|_{0}=1$$ To intuitively understand the definition of CS, Fig. 2 gives some examples strictly obeying the pattern of CS across multiple sparsities. Accordingly, the parameter values, i.e., K and M of each example, are listed in Table 2. Note that K is only related to the specified sparsity S and is independent of the specific weight tensor shapes. Unless otherwise specified, the rest of the paper only discusses the strict CS. | (a) 0.8 -0.1 0.2 1.5 1.2 -1.3-0.4 0.2 0.7 2.0 0.9 -0.5 1.0 0.3 2.1 -1. | 4 | |----------------------------------------------------------------------------|-----| | (b) (c) 0.8 -0.1 0.2 1.5 1.2 -1.3-0.4 0.2 0.7 2.0 0.9 -0.5 1.0 0.3 2.1 -1. | 4 | | 0.8 -0.1 0.2 1.5 1.2 -1.3-0.4 0.2 0.7 2.0 0.9 -0.5 1.0 0.3 2.1 -1.4 | | | (e) (d) 0.8 -0.1 0.2 1.5 1.2 -1.3-0.4 0.2 0.7 2.0 0.9 -0.5 1.0 0.3 2.1 -1. | 4 | | 0.8 -0.1 0.2 1.5 1.2 -1.3-0.4 0.2 0.7 2.0 0.9 -0.5 1.0 0.3 2.1 -1.4 | | Figure 2: Examples of CS at different sparsities. The blue shading of (b)-(e) indicates the selected weights. (a) a dense weight tensor. For convience, the tensor is 2D and with the shape of 1 × 16, i.e., Cout = 1 and Cin ∗ Fh ∗ Fw = 16 (b) The 50% CS of the weight tensor. (c) The 75% CS of the weight tensor. (d) The 87.5% CS of the weight tensor. (e) The 93.75% CS of the weight tensor. 3 Huawei Proprietary - Restricted Distribution | Table 2: | Parameter values of the examples shown in Fig. 2. | | | | |------------|-----------------------------------------------------|----|------------|-----------------| | Sparsity | Encoding | | Encoding | | | (%) | K | M | bit number | results | | 50 | 2 | 8 | 1 | 0,1,1,0,0,0,1,1 | | 75 | 4 | 4 | 2 | 1,2,3,0 | | 87.5 | 8 | 2 | 3 | 7,4 | | 93.75 | 16 | 1 | 4 | 14 | ## 3.2 Cs-Specific Gradual Sparse Training Method The aim of designing a CS-specific sparse training method is to attain universality. That is, the desired training method can improve the accuracy of various CS-based CNNs among different sparsities. With the training method, users do not need to customize training recipes for different CNN structures. Conventionally, training a sparse neural network follows the process of dense training, single-shot pruning, and finetuning. We argue the conventional training process is unfavorable to CS-based CNNs under high sparsities (> 75%) in which case the derived sparse masks from the dense weight tensors tend to be suboptimal. In contrast, we propose a two-phase training scheme: gradual sparse training followed by retraining. As demonstrated in Algorithm 1, assuming that the allowed training iteration amount in each phase is I, the first phase starts training with a dense network and the sparsity of the network discretely steps up every P iterations. The completion of the first phase offers the sparse masks conforming to the pattern of CS and the weights as the initialization of the second phase. The second phase simply uses the same training setups as the first phase to retrain the retained weights in networks selected by the sparse masks. Obviously, the novelty of our training method mainly lies in the first phase. The first phase comprises two features as detailed below. Variable number of steps for gradual sparsification. By empirical observation, we find the higher the required sparsity is, the more steps for gradual sparsification are needed to obtain the better model quality. Hence, to obtain a CS-based CNN at the sparsity S, we set K steps for gradually sparsifying the network. For instances, in case that the target sparsity is 75%, the change of sparsities during training in the first phase is 0% → 25% → 50% → 75%, while for the target sparsity of 87.5%, the change is 0% → 12.5% → 25% → 37.5% → 50% → 62.5% → 75% → 87.5%. To be formulated, for the ith training iteration, the desired sparsity Siis: $$S_{i}={\frac{c e i l i n g\{{\frac{i}{I}}*K\}-1}{K}}$$ K(5) Equation 5 intuitively means that Si performs the piecewise linear growth as training iterations. The position of Equation 5 in the workflow of our training method is shown in Algorithm 1. Note that gradual sparsification only means the amounts of weights participating in the forward passes are gradually and discretely reduced. During backward passes, the gradients of all the weights are computed and every weight is updated no matter which sparsity step a network is at. CS-specific weight reselection. Since all the weights are kept updating in the first training phase, it is beneficial to reselect the weights, i.e., update the sparse masks once in a while. Supposing every F iterations, the sparse masks should be updated. The update process for CS is: 1) Reshape. A weight tensor with the shape Cout × Cin × Fh × Fw is reshaped into G × K × L, where K and L is defined in Equation 1 and 2, respectively. G can be inferred given K and L. 2) Reselection. Along K axis to reselect ki weights with the highest absolute value. k is related to the sparsity step that a network is at, i.e., $$\left(5\right)$$ $$k_{i}=(1-S_{i})*K$$ ki = (1 − Si) ∗ K (6) The positions of the reslected weights in masks are set ones while the other positions are set zeros. 3) Restoration, which means inversely reshape the weight tensor from G× K ×L back to Cout ×Cin ×Fh ×Fw. Fig. 3 shows an example of the CS-specific weight reselection procedure, which mainly visualizes the step 2). Notably, the gradual sparsification is exactly achieved by our weight reselection procedure by properly setting F to make P divisible by F. $\left(6\right)$. Algorithm 1 Workflow of Our Training Method Initialization: Dense weights W Input: Required sparsity S, training iterations I, data D Output: Sparse weights WS Key params: K, sparse mask M, mask updating freq. F 1: ——————-*Gradual Sparse Training Phase*——————- 2: for i = 0;*i < I*;i + + do 3: if i%F **then** 4: Si←Equation 5(*i, I, K*) 5: M ← Weights_Reselect( Si, W ) 6: **end if** 7: Forward(*W, M, D*) 8: Backward(*W, D*) 9: Weights_Update(W) \#Update all weights 10: **end for** 11: ————————–*Retraining Phase*—————————— 12: for i = 0;*i < ite*;i + + do 13: Forward(*W, M, D*) 14: Backward(*W, M, D*) 15: Weights_Update(*W, M*) \#Update selected weights 16: **end for** 17: —————————————————————————— 18: WS ← W * M ![6_image_2.png](6_image_2.png) -1.2 -0.2 1.2 2.0 ![6_image_1.png](6_image_1.png) ![6_image_0.png](6_image_0.png) 0.4 -1.2 -0.3 1.9 1.0 -2.3 0.8 -2.3 -0.9 2.0 0.2 -0.7 -0.6 2.0 0.1 -0.6 -1.2 -0.1 1.2 2.0 0.3 -0.3 -0.1 1.3 1.0 -2.3 0.8 -2.3 4 Huawei Proprietary - Restricted Distribution Figure 3: An example of CS-specific weight reselection. ## 3.3 Acceleration Of Cs-Based Convolution The obtained sparse weight tensors after training are stored in the compressed format. That is, only the nonzero weights and their indices are stored and used for inference. This procedure is formulated by, converting WS to Ws and Idx, where Wsis the non-zero weight tensor with the smaller shapes and Idx is the index tensor. The index of a non-zero weight denotes the weight's position number among K complementary positions, thus the value of an index is constantly less than K. Fig. 4 exemplifies the compression of CS at the 50% sparsity. In this case, the Ws has half of the shape than WS. Although Idx has the same shape as Ws, each index in Idx can be encoded with very low numbers of bits. As shown in Table 2, only at most 4 bits are needed to encode a non-zero weight's index. ![7_image_0.png](7_image_0.png) Index $$\mathbf{\partial}$$ -1.2 -0.2 1.2 2.0 -1.2 -2.3 1.2 1.9 0.4 -1.2 -0.3 1.9 -0.9 2.0 0.4 -2.3 1.0 -2.3 0.8 -2.3 0 1 0 1 -0.9 2.0 0.4 -0.7 1 1 1 0 Figure 4: A diagram of CS compression at the 50% sparsity. 5 Huawei Proprietary - Restricted Distribution After acquiring Ws and Idx, given an input activation X, the output featuremap Y can be computed in parallel. Contrary to the conventional method of feature reuse to speedup sparse convolutions Tan et al. (2022) on common GPUs, we propose a weight reuse-based algorithm. In implicit GEMM-based dense convolutions, each thread is generally in charge of a subblock in Y , e.g., of size 4 ∗ 4. Then, $$Y_{i:i+4,j:j+4}=\sum_{n=0}^{L}W_{i:i+4,n}\otimes X_{n,j:j+4}\tag{1}$$ In Equation 7, L is only equal to Cin ∗ Fh ∗ Fw for GPUs, and ⊗ represents the outer product operation of two vectors. When CS-based convolution is conducted, Equation 7 can be modified into: $$Y_{i:i+4,j:j+4}=\sum_{n=0}^{L*(1-S)}W_{i:i+4,n}\circ X_{f(n,i),j:j+4},$$ $$\mathbf{\Sigma}$$ $$\mathbf{\Sigma}$$ where f(*n, i*) = n + M ∗ Idx[i : i + 4, n] (9) and ◦ in Equation 8 denotes the operation: $$f(n,i)=n+M*I d x[i:i+4,n]$$ $$\mathbb{O}=$$ $$\left[\begin{array}{l}W_{i}*X_{n+M*Idx[i,n],j:j+4}\\ W_{i+1}*X_{n+M*Idx[i+1,n],j:j+4}\\ W_{i+2}*X_{n+M*Idx[i+2,n],j:j+4}\\ W_{i+3}*X_{n+M*Idx[i+3,n],j:j+4}\end{array}\right]\tag{10}$$ Equation 8 makes it possible to compute CS-based convolutions by chunk. For a non-zero weight, there are K related sub-blocks in an input activation that may be indexed during convolution. On common GPUs, by loading all the related K sub-blocks to GPUs' shared memory in advance, Equation 8 can be conducted efficiently. Algorithm 2 shows this parallel acceleration process, where 50% CS-based convolution is taken for example. On CPUs, the direct method is employed to accelerate CS. Due to the instruction limit, CPUs can hardly fetch multiple values far apart from each other. Accordingly, our CS allows different values of M without reducing network accuracy, which is very friendly to CPU operation. During convolutions, CPUs conduct sparse vector products along the Cin axis. In this case, L = Cin/c. ## 4 Experiments 4.1 Datasets, Models And Settings CIFAR100 Krizhevsky et al. (2009) and ImageNet-1k Deng et al. (2009) are two datasets used to test the accuracy of CS-based CNNs. Specifically, on CIFAR100, we evaluate three classical CNNs including VGG-19 Simonyan & Zisserman (2014), ResNet-18 and ResNet-50 He et al. (2016), and two parameterefficient CNNs including MobileNetv2 and SqueezeNet Sandler et al. (2018); Iandola et al. (2016). Since on CIFAR100, low sparsities (≤ 75%) may result in insignificant accuracy differences between CNNs with Algorithm 2 Parallelization for 50% CS-based convolution Input: Idx, W, X Output: Y Key params: *M, L* __Shared__ float4 local_w, local_idx __Shared__ float4 *local*_x[2]*, local*_y 1: ——————————*Parallelism*———————————- 2: **for all** N ∗ OC ∗ OH ∗ OW/16 threads do 3: Subblock(Y) ← SubConv( thread[i], Idx,W, X ) 4: **end for** 5: ———————————*Details*———————————— 6: **function** SubConv(tid, Idx,W, X) 7: for i = 0;*i < L*;i+ = BM do 8: local_*f ilter* ← Subblock(*f ilter*) 9: local_idx ← Subblock(Idx) 10: *local*_x[0] ← Subblock1(X) 11: *local*_x[1] ← Subblock2(X) 12: Syncthreads(); 13: *local*_y = Eq. 8(local_w, local_x, local_idx) 14: **end for** 15: return *local*_y 16: **end function** our CS and with other sparse patterns, we test the three classical CNNs under high sparsities: 87.5% and 93.75%, while for MobileNetv2 and SqueezeNet, accuracy results under the 50% and 75% sparsities are adequately distinguishable for comparison. At each sparsity, each CNN is sparsified by US, filter pruning, N:M, OVW, and CS, respectively. All the sparse CNNs are firstly trained with the same training paradigm: dense training, pruning, and finetuning. This paradigm has been widely used to form various sparse CNNs. For simplicity, the finetuning phase uses the same setting as the dense training phase, which has been verified as reasonable in Mishra et al. (2021). After that, CS-based CNNs are trained with the proposed CS-specific gradual training method for comparison. All the trainings use the common and the same settings. The total training epoch is 400. For the conventional training paradigm, the dense training phase uses 200 epochs and the finetuning phase uses the rest. Similarly, for our CS-specific gradual training method, each training phase equally uses 200 epochs as well. Each experiment is repeated three times and all the experimental results on CIFAR100 are listed in the format of "mean± standard deviation" to reduce the influence of random factors. On ImageNet-1k, CS-based ResNet-50 at different sparsities are trained for comparing with other related works. We use the officially recommended hypermeter settings for our sparse training method zlm (2022). Besides, the speedups of CS-based CNNs over the dense counterparts are measured on an Intel(R) Xeon(R) Gold 6154 CPU and a Tesla V100 GPU without sparse tensor cores, respectively. ## 4.2 Results On Cifar100 Table 3 shows the accuracy of different networks within different sparse patterns on CIFAR100. Firstly, for the three classical CNNs, our CS achieves the best accuracy under high sparsities among all the sparse patterns. Secondly, for MobileNetv2 and SqueezeNet, our CS also outperforms other fine-grained structured sparse pattern at the 75% sparsity. In particular, the accuracy of MobileNetv2 within CS at the 75% sparsity is even higher than that within the unstructured sparsity, i.e., 62.63%>61.7%. Thirdly, the proposed training method significantly improves the accuracy of a series of CS-based CNNs, with the average accuracy increasing from 0.48% to 2.83%. Notably, at the 50% sparsity, all types of sparse patterns lead to lossless accuracy. In this case, we argue the accuracy differences among the patterns and training methods are immaterial. | Spa. | VGG19 | Resnet18 | Resnet50 | Spa. | Mobilenetv2 | SqueezeNet | | |----------------|----------------|------------|------------|----------------|----------------|--------------|----------| | (%) | | (%) | | | | | | | Origin | 70.8 | 74.7 | 72.2 | Origin | 65.3 | 65.1 | | | Unstructured | 71.3±0.1 | 73.3±0.1 | 72.3±0.3 | Unstructured | 66.9±0.1 | 67.7±0.2 | | | | | 50 | | | | | | | 87.5 | Filter pruning | 47.8±0.6 | 59.0±0.2 | 48.4±1.0 | Filter pruning | 65.5±0.5 | 36.4±0.2 | | N:M(1:8) | 70.6±0.1 | 72.9±0.1 | 72.1±0.1 | N:M(2:4) | 66.4±0.3 | 67.2±0.1 | | | OVW | 63.6±0.3 | 64.1±0.7 | 59.2±1.6 | OVW | 61.8±0.3 | 64.0±0.4 | | | CS-C | 70.7±0.2 | 73.0±0.1 | 72.5±0.3 | CS-C | 66.4±0.1 | 67.2±0.1 | | | CS (Ours) | 71.7±0.3 | 73.5±0.1 | 73.1±0.0 | CS (Ours) | 66.7±0.2 | 67.0±0.2 | | | 4 | +1.4 | +0.5 | +0.6 | 4 | +0.2 | -0.2 | | | Unstructured | 69.8±0.1 | 71.5±0.0 | 71.3±0.0 | Unstructured | 61.7±0.1 | 64.5±0.2 | | | 93.75 | | 75 | | | | | | | Filter pruning | 33.2±0.4 | 47.9±0.4 | 40.0±0.6 | Filter pruning | 53.4±1.1 | 15.9±0.2 | | | N:M(1:16) | 68.1±0.3 | 70.4±0.2 | 70.6±0.3 | N:M(1:8) | 58.9±0.4 | 63.4±0.3 | | | OVW | 59.6±0.2 | 60.6±0.3 | 41.0±13.8 | OVW | Failed | 54.6±0.9 | | | CS-C | 68.5±0.2 | 70.5±0.1 | 70.5±0.2 | CS-C | 59.8±0.1 | 63.9±0.3 | | | CS (Ours) | 69.9±0.1 | 72.2±0.3 | 73.0±0.3 | CS (Ours) | 62.6±0.2 | 64.4±0.1 | | | 4 | +1.4 | +1.7 | +2.5 | 4 | +2.8 | +0.5 | | Table 3: Accuracy of sparse CNNs on CIFAR100. 'Spa.' means sparsity. 'CS-C' represents CS-based CNNs formed by the Conventional training paradigm, while 'CS (Ours)' means that formed by the proposed training method. '4' means the difference between 'CS-C' and 'CS (Ours)'. For spatial brevity, all the data are rounded to one significant digit. 20 Huawei Proprietary - Restricted Distribution Apart from Table 3, the experimental results on CIFAR100 using the same network for all sparsity ratios are shown in Figure 5. It is observed that the curves of our CS are generally above the curves of other structured patterns and are overlapped with curves of unstructured sparsity. That observation further demonstrates the superiority of our CS in terms of accuracy across all the sparsity ratios. ![9_image_0.png](9_image_0.png) Figure 5: Accuracy vs. sparsity curves of different CNNs whitin different sparse patterns. (a) VGG19. (b) ResNet18. (c) ResNet50. Notably, on CIFAR100, our CS performs even better than unstructured sparsity due to the relatively small dataset size. Generally, compared to modern DNNs' capacity, CIFAR100 is easy to be overfitted. Thus, within a certain sparsity range, weight sparsification can largely regularize the model capacity and lead to higher accuracy over dense counterparts (Hoefler et al., 2021). Compared to unstructured sparsity, finegrained structured sparsity such as CS and N:M constrains a model more strictly. This constraint generally endows the model favorable regularization on small datasets like CIFAR100 and at low sparsity like 50% and 75%. For example, as shown in Figure 7, at 50% sparsity for VGG19 on CIFAR100, N:M sparsity leads to 73.00% accuracy, which is better than 72.82% of unstructured sparsity. At 75% sparsity, our CS-based VGG19 reaches 72.51% accuracy, while unstructured sparsity-based VGG19 is 72.13%. Under higher sparsity such as 93.75%, despite the rare possibility of overfitting, the accuracy gap between fine-grained structured patterns like '**CS-C**' and 'unstructured' was still narrow due to the small dataset size. Hence, with our proposed training scheme, '**CS(Ours)**' can easily fill the gap to further become on par with or to even surpass 'unstructured'. By contrast, on ImageNet, our CS and other fine-grained sparsity patterns bring constantly lower accuracy than unstructured sparsity regardless of sparsity ratios and network architectures. ## 4.3 Results On Imagenet Table 4 shows the experimental results on ImageNet. Compared with the OVW and Shfl_BW patterns, our CS with the proposed training scheme leads to better accuracy under high sparsities, e.g., 93.75%. For other sparsities, our CS achieves comparable accuracy with the state-of-the-art N:M sparsity. However, the different settings of M in N:M sparsity significantly affect the network accuracy, e.g., Sun et al. (2021). On the contrary, our CS is robust to the pattern hyperparameter setting which will be shown in the ablation study. | | | | | Flops | | | |----------|----------|----------|--------|---------|------|------| | Pattern | Sparsity | Error(%) | Params | | | | | | Ori. | Pruned | Gap | (G) | | | | | | | (M) | | | | | N:M | 2:4 | 77.3 | 77.0 | 0.3 | 13.8 | 2.15 | | OVW | 50% | 76.12 | 75.76 | 0.36 | 13.8 | 2.15 | | CS(Ours) | 50% | 76.39 | 76.37 | 0.02 | 13.8 | 2.15 | | N:M | 1:4 | 77.3 | 75.3 | 2 | 7.93 | 1.17 | | OVW | 70% | 76.12 | 73.35 | 2.77 | 9.14 | 1.37 | | CS(Ours) | 75% | 76.39 | 75.18 | 1.21 | 7.93 | 1.17 | | Shfl_BW | 80% | N/A | 75.94 | N/A | 6.78 | 0.98 | | CS(Ours) | 87.5% | 76.39 | 72.44 | 3.95 | 5.02 | 0.69 | | N:M | 1:16 | 77.3 | 71.5 | 5.8 | 3.52 | 0.44 | | Shfl_BW | 90% | N/A | 73.09 | N/A | 4.43 | 0.59 | | CS(Ours) | 93.75% | 76.39 | 71.07 | 5.32 | 3.52 | 0.44 | Table 4: ResNet50 accuracy comparison among different fine-grained structured sparse patterns on ImageNet. The results of N:M, OVW, and Shfl_BW are from Zhou et al. (2021a), Tan et al. (2022) and Huang et al. (2022), respectively. 'N/A' means the related work does not report the result. Besides, although this work mainly focuses on CNNs, we also give the preliminary results of CS and N:M sparsity on Transformer structures as shown in Table 5. The DeiT-small is used and the training settings of CS-based DeiT-small and N:M-based DeiT-small are identical. That is, our proposed training scheme is not used this time for an absolutely fair comparison. Experimental results show once more that our CS also incurs a comparable accuracy as N:M sparsity on Transformer architectures. Note that at 50% sparsity, both N:M sparsity and CS -based DeiT-small surpass the dense one, so the difference between the two sparse patterns at 50% sparsity is trivial. With the experimental results of CNN and Transformer architectures, we would like to reaffirm that our CS mainly achieves comparable accuracy to N:M sparsity under identical training settings. The role of our proposed training scheme is only to improve a CS-based network's accuracy under high sparsity ratios. For instance, at 93.75%, ResNet50 within CS surpasses that within N:M sparsity by a decent margin, i.e., ~0.5% on ImageNet as shown before in Table 4. In other words, a better acceleration affinity on CPUs and common GPUs under comparable accuracy, is truly our CS's advantage over N:M sparsity. Finally, due to the slow progress in the explainability of DNNs, the model accuracy of CS lacks clear theoretical support. However, we found a metric called mask diversity that may provide some insights (Hubara et al., 2021). The metric is defined as the number of possible masks for a sparse pattern given a sparsity ratio. For example, for a 8 × 8 weight tensor and a 50% sparsity, our CS has 2 32 = 4, 294, 967, 296 possible masks, while other vector-wise sparsity such as OVW can only have 16 8 = 12870 masks, not to mention only 84 = 70 masks that channel pruning can provide. Altogether, CS's high mask flexibility probably promotes the high accuracy of CS-based CNNs. | Sparsity(%) | 50 | 75 | 87.5 | 93.75 | |---------------|-------|-------|--------|---------| | N:M | 77.61 | 73.69 | 67.56 | 60.08 | | CS(Ours) | 77.4 | 73.66 | 67.63 | 60.01 | Table 5: Comparison between CS and N:M sparsity using Top1 accuracy of DeiT-small on ImageNet. The dense DeiT-small is 75.56%. ## 4.4 Ablation Study | F | 50% | 75% | 87.5% | 93.75% | |-----|------------|------------|------------|------------| | 0 | 74.7±0.08 | 74.14±0.63 | 73.44±0.19 | 72.06±0.38 | | 0.5 | 74.78±0.09 | 74.55±0.06 | 73.57±0.27 | 71.9±0.52 | | 1 | 74.68±0.06 | 74.35±0.37 | 73.47±0.6 | 71.62±0.2 | | 2 | 74.71±0.24 | 74.12±0.23 | 73.16±0.37 | 71.19±0.59 | | 4 | 74.85±0.08 | 74.21±0.08 | 72.85±0.23 | 70.85±0.48 | | 8 | 74.93±0.37 | 74.28±0.21 | 72.54±0.61 | 70.47±0.17 | | 10 | 74.66±0.19 | 74.5±0.19 | 73.06±0.17 | 70.14±0.09 | | Sparsity | (M, K) | VGG19 | ResNet18 | ResNet50 | Sparsity | (M, K) | MobileNetv2 | SqueezeNet | |------------|------------|------------|------------|------------|------------|------------|---------------|--------------| | (2,8) | 71.28±0.15 | 73.68±0.32 | 73.46±0.85 | | (2,2) | 66.81±0.14 | 67.19±0.29 | | | 87.5% | | | | 50% | | | | | | (4,8) | 71.46±0.49 | 73.2±0.39 | 73.23±0.65 | | (4,2) | 66.65±0.15 | 67.07±0.04 | | | (8,8) | 71.55±0.39 | 73.47±0.16 | 73.38±0.39 | | (8,2) | N/A | 67.27±0.09 | | | t-test | 0.77 | 0.29 | 0.82 | t-test | 0.18 | 0.57 | | | | (2,16) | 69.62±0.09 | 71.89±0.19 | 72.23±1.4 | | (2,4) | 62.72±0.14 | 64.26±0.07 | | | 93.75% | | | | 75% | | | | | | (4,16) | 69.76±0.19 | 72.22±0.39 | 72.56±0.11 | | (4,4) | N/A | 64.3±0.22 | | | t-test | 0.31 | 0.39 | 0.71 | t-test | N/A | 0.7 | | | Firstly, we investigate the effect of different mask updating frequencies in our training method, i.e., F mentioned in Algorithm 1, on network accuracy. The results are shown in Table 6. In the table, F = 0 means updating the mask once for every iteration, F = 0.5 means that updating frequency is 0.5 epoch, and so on. We find that the higher the required sparsity is, the higher the mask updating frequency should be. For example, at the 50% sparsity, F = 8 is the best, while at 93.75%, F = 0 outperforms others. The F settings in Table 6 is exactly used in training CS-based ResNet50 on ImageNet. Secondly, we investigate a pattern hypermeter of CS: M. Specifically, under the same sparsity decided by K, CS-based CNNs with different settings of M are trained and we conduct pairwise t-test on these CNNs' accuracy. As shown in Table 7, all the p values are larger than 0.05, which indicates that our CS is robust to pattern hyperparameters. The robustness is quite beneficial for acceleration as CPUs and GPUs can employ different values of M to meet the respective constraints in memory access and instruction set. Table 6: ResNet18 on CIFAR100: Impact of F across sparsities. Table 7: Accuracy of CS-based CNNs with different settings of M on CIFAR100 ## 4.5 Results On Speedups On CPU, M is set 2,4,8,16 on demand. On GPUs, we set M as large as possible, i.e., M = Cin ∗Fh ∗Fw/K. We find that the larger M makes indexing more easier on GPU. Fig. 6 shows the normalized speedups on CS. Firstly, three typical convolutions in ResNet50 are used for test speedup. As shown in Fig. 6(a), with batch size equal to 1, CPU achieves 4.27×, 5.46× and 7.7× speedups for the 3rd, 11th, 41th convolutions at the ![12_image_0.png](12_image_0.png) Figure 6: Speedups for CS. (a) CPU speedups for three CS-based convolutions in ResNet50. (b) GPU speedups for three CS-based convolutions in ResNet50. (c) GPU speedups for three CS-based CNNs. 7 Huawei Proprietary - Restricted Distribution ![12_image_1.png](12_image_1.png) 10 Huawei Proprietary - Restricted Distribution Figure 7: ResNet50 on CIFAR100: Normalized accuracy-speedup curves of three fine-grained structured sparse patterns. Note N:M sparsity does not have acceleration gains on common GPUs. 93.75% complementary sparsity, respectively. Similarly, as shown in Fig. 6(b), with batch size equal to 64, GPU respectively achieves 4.02×, 3.33× and 2.52× speedups at 93.75% over dense counterparts supported by cuDNN. Secondly, we also estimate the speedups on network-level by averaging all the convolutions' runtime. GPU achieves 2.75×, 3.07×, and 2.59× speedups for VGG19, ResNet50 and SqueezeNet, respectively. These speedup performances prove the efficiency of the proposed parallel acceleration algorithm. In addition, our CS generally reaches better accuracy-speedup tradeoffs compared with the OVW and Shfl_BW pattern, as shown in Fig. 7. ## 4.6 Results On Practical Inference Performance Table 8 shows the speedup comparison of CS and N:M sparsity on A100 and V100 GPUs, respectively. Note that the speedup data of N:M sparsity are directly cited from A100 materials that are publically available. Although A100 GPUs have a far stronger computing power than previous ones, it is noteworthy that A100 GPUs are quite inflexible as it can only support the acceleration of 2:4 sparsity. Other sparsity ratios, such as 75% (1:4), 87.5% (1:8), and 93.75% (1:16) **can not** incur any speedups on A100. In contrast, our CS supports a wide range of sparsity ratios on common GPUs. | 50% | 75% | 87.5% | 93.75% | | |------------|-------|---------|----------|------| | N:M (A100) | 2 | 0 | 0 | 0 | | CS | | | | | | (V100) | 1.39 | 1.86 | 2.48 | 3.07 | Table 8: ResNet50 speedups comparison at different sparsities on V100 and A100 | Sparsity(%) | Gflops | Times(ms) | Energy cost(J) | |---------------|----------|-------------|------------------| | 50 | 2.15 | 28.98 | 7.25 | | 75 | 1.17 | 21.59 | 5.4 | | 87.5 | 0.69 | 16.24 | 4.06 | | 93.75 | 0.44 | 13.12 | 3.28 | In addition, CS-based ResNet50 inference energy consumptions at different sparsities are shown in Table 9. As the sparsity ratio arises, the reduced FLOPs efficiently convert to the shorter inference time. At the 93.75% sparsity and 64 batch size, CS-based ResNet50 only consumes 3.28J energy for one inference, which is energy-efficient for cloud server scenarios. Table 9: Energy consumption of ResNet50 within CS pattern. batch_*size* = 64 ## 5 Conclusion And Future Work We propose a novel CS to accelerate sparse CNNs on CPUs and common GPUs and retain the network accuracy as much as possible. To our knowledge, we are the first to report the practical speedups on both CPUs and common GPUs for a sparse pattern. Not only does the proposed CS feature high mask flexibility that contributes a lot to sparse CNNs' accuracy, but also the network accuracy is robust to pattern hyperparameters. The robustness enhances CS's adaptability to different computing platforms. we would like to denote that the limitation of our proposed training scheme for CS is that the scheme is hardly viable for massive pretraining data. It is because our training scheme needs to be embedded into the pretraining stage and huge amounts of pretraining data make it actually impossible to replicate the pretraining. Thus, it is difficult for our scheme to be applied in scenarios such as LLMs. However, we argue that the limitation does not disqualify our major contributions for CS and we will handle the limitation in future work. ## 6 Acknowledgement We gratefully acknowledge the support of MindSpore (Hua, 2020), CANN (Compute Architecture for Neural Networks) and Ascend AI Processor used for this research. ## References Huawei, mindspore, 2020. MindSpore.https://www.mindspore.cn/. Image classification reference training scripts, 2022. https://github.com/pytorch/vision/tree/main/ references/classification. Babajide O Ayinde, Tamer Inanc, and Jacek M Zurada. Regularizing deep neural networks by enhancing diversity in feature extraction. *IEEE transactions on neural networks and learning systems*, 30(9):2650– 2661, 2019. Tianlong Chen, Xuxi Chen, Xiaolong Ma, Yanzhi Wang, and Zhangyang Wang. Coarsening the granularity: Towards structurally sparse lottery tickets. In *International Conference on Machine Learning*, pp. 3025– 3039. PMLR, 2022. Tianyi Chen, Bo Ji, Tianyu Ding, Biyi Fang, Guanyi Wang, Zhihui Zhu, Luming Liang, Yixin Shi, Sheng Yi, and Xiao Tu. Only train once: A one-shot neural network training and pruning framework. *Advances* in Neural Information Processing Systems, 34:19637–19651, 2021. Sharan Chetlur, Cliff Woolley, Philippe Vandermersch, Jonathan Cohen, John Tran, Bryan Catanzaro, and Evan Shelhamer. cudnn: Efficient primitives for deep learning. *arXiv preprint arXiv:1410.0759*, 2014. Vladimir Chikin and Vladimir Kryzhanovskiy. Channel balancing for accurate quantization of winograd convolutions. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition*, pp. 12507–12516, 2022. Jack Choquette and Wish Gandhi. Nvidia a100 gpu: Performance & innovation for gpu computing. In 2020 IEEE Hot Chips 32 Symposium (HCS), pp. 1–43. IEEE Computer Society, 2020. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In *2009 IEEE conference on computer vision and pattern recognition*, pp. 248–255. Ieee, 2009. Xiaohan Ding, Tianxiang Hao, Jianchao Tan, Ji Liu, Jungong Han, Yuchen Guo, and Guiguang Ding. Resrep: Lossless cnn pruning via decoupling remembering and forgetting. In *Proceedings of the IEEE/CVF* International Conference on Computer Vision, pp. 4510–4520, 2021. Utku Evci, Trevor Gale, Jacob Menick, Pablo Samuel Castro, and Erich Elsen. Rigging the lottery: Making all tickets winners. In *International Conference on Machine Learning*, pp. 2943–2952. PMLR, 2020. Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. *arXiv preprint arXiv:1803.03635*, 2018. Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. *arXiv preprint* arXiv:1902.09574, 2019. Scott Gray, Alec Radford, and Diederik P Kingma. Gpu kernels for block-sparse weights. *arXiv preprint* arXiv:1711.09224, 3:2, 2017. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. Yang He and Lingao Xiao. Structured pruning for deep convolutional neural networks: A survey. *arXiv* preprint arXiv:2303.00566, 2023. Torsten Hoefler, Dan Alistarh, Tal Ben-Nun, Nikoli Dryden, and Alexandra Peste. Sparsity in deep learning: Pruning and growth for efficient inference and training in neural networks. The Journal of Machine Learning Research, 22(1):10882–11005, 2021. Zejiang Hou, Minghai Qin, Fei Sun, Xiaolong Ma, Kun Yuan, Yi Xu, Yen-Kuang Chen, Rong Jin, Yuan Xie, and Sun-Yuan Kung. Chex: channel exploration for cnn model compression. In *Proceedings of the* IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12287–12298, 2022. Guyue Huang, Haoran Li, Minghai Qin, Fei Sun, Yufei Ding, and Yuan Xie. Shfl-bw: accelerating deep neural network inference with tensor-core aware weight pruning. In *Proceedings of the 59th ACM/IEEE* Design Automation Conference, pp. 1153–1158, 2022. Itay Hubara, Brian Chmiel, Moshe Island, Ron Banner, Joseph Naor, and Daniel Soudry. Accelerated sparse neural training: A provable and efficient method to find n: m transposable masks. *Advances in Neural* Information Processing Systems, 34:21099–21111, 2021. Forrest N Iandola, Song Han, Matthew W Moskewicz, Khalid Ashraf, William J Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and< 0.5 mb model size. *arXiv preprint* arXiv:1602.07360, 2016. Ajay Kumar Jaiswal, Haoyu Ma, Tianlong Chen, Ying Ding, and Zhangyang Wang. Training your sparse neural network better with any mask. In *International Conference on Machine Learning*, pp. 9833–9844. PMLR, 2022. Yu Ji, Ling Liang, Lei Deng, Youyang Zhang, Youhui Zhang, and Yuan Xie. Tetris: Tile-matching the tremendous irregular sparsity. *Advances in Neural Information Processing Systems*, 31, 2018. Jiazhi Jiang, Dan Huang, Jiangsu Du, Yutong Lu, and Xiangke Liao. Optimizing small channel 3d convolution on gpu with tensor core. *Parallel Computing*, 113:102954, 2022. Marc Jorda, Pedro Valero-Lara, and Antonio J Pena. Performance evaluation of cudnn convolution algorithms on nvidia volta gpus. *IEEE Access*, 7:70461–70473, 2019. Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. Aditya Kusupati, Vivek Ramanujan, Raghav Somani, Mitchell Wortsman, Prateek Jain, Sham Kakade, and Ali Farhadi. Soft threshold weight reparameterization for learnable sparsity. In International Conference on Machine Learning, pp. 5544–5555. PMLR, 2020. Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. *arXiv preprint arXiv:1608.08710*, 2016. Qingyuan Li, Bo Zhang, and Xiangxiang Chu. Eapruning: Evolutionary pruning for vision transformers and cnns. *arXiv preprint arXiv:2210.00181*, 2022a. Shigang Li, Kazuki Osawa, and Torsten Hoefler. Efficient quantized sparse matrix operations on tensor cores. *arXiv preprint arXiv:2209.06979*, 2022b. Shiwei Liu, Tianlong Chen, Xiaohan Chen, Zahra Atashgahi, Lu Yin, Huanyu Kou, Li Shen, Mykola Pechenizkiy, Zhangyang Wang, and Decebal Constantin Mocanu. Sparse training via boosting pruning plasticity with neuroregeneration. *Advances in Neural Information Processing Systems*, 34:9908–9922, 2021. Yufan Liu, Jiajiong Cao, Bing Li, Weiming Hu, and Stephen Maybank. Learning to explore distillability and sparsability: a joint framework for model compression. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022. Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In Proceedings of the IEEE international conference on computer vision, pp. 2736–2744, 2017. Yucheng Lu, Shivani Agrawal, Suvinay Subramanian, Oleg Rybakov, Christopher De Sa, and Amir Yazdanbakhsh. Step: Learning n: M structured sparsity masks from scratch with precondition. arXiv preprint arXiv:2302.01172, 2023. Xiaolong Ma, Minghai Qin, Fei Sun, Zejiang Hou, Kun Yuan, Yi Xu, Yanzhi Wang, Yen-Kuang Chen, Rong Jin, and Yuan Xie. Effective model sparsification by scheduled grow-and-prune methods. arXiv preprint arXiv:2106.09857, 2021. Fanxu Meng, Hao Cheng, Ke Li, Huixiang Luo, Xiaowei Guo, Guangming Lu, and Xing Sun. Pruning filter in filter. *Advances in Neural Information Processing Systems*, 33:17629–17640, 2020. Asit Mishra, Jorge Albericio Latorre, Jeff Pool, Darko Stosic, Dusan Stosic, Ganesh Venkatesh, Chong Yu, and Paulius Micikevicius. Accelerating sparse deep neural networks. *arXiv preprint arXiv:2104.08378*, 2021. Hesham Mostafa and Xin Wang. Parameter efficient training of deep convolutional neural networks by dynamic sparse reparameterization. In *International Conference on Machine Learning*, pp. 4646–4655. PMLR, 2019. Jinhyuk Park and Albert No. Prune your model before distill it. In *Computer Vision–ECCV 2022: 17th* European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part XI, pp. 120–136. Springer, 2022. Alexandra Peste, Eugenia Iofinova, Adrian Vladu, and Dan Alistarh. Ac/dc: Alternating compressed/decompressed training of deep neural networks. *Advances in Neural Information Processing Systems*, 34:8557–8570, 2021. M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L. C. Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. *IEEE*, 2018. Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. Wei Sun, Aojun Zhou, Sander Stuijk, Rob Wijnhoven, Andrew O Nelson, Henk Corporaal, et al. Dominosearch: Find layer-wise fine-grained n: M sparse schemes from dense neural networks. *Advances in* neural information processing systems, 34:20721–20732, 2021. Kai Sheng Tai, Taipeng Tian, and Ser-Nam Lim. Spartan: Differentiable sparsity via regularized transportation. *arXiv preprint arXiv:2205.14107*, 2022. Yijun Tan, Kai Han, Kang Zhao, Xianzhi Yu, Zidong Du, Yunji Chen, Yunhe Wang, and Jun Yao. Accelerating sparse convolution with column vector-wise sparsity. In Advances in Neural Information Processing Systems, 2022. Yehui Tang, Yunhe Wang, Yixing Xu, Dacheng Tao, Chunjing Xu, Chao Xu, and Chang Xu. Scop: Scientific control for reliable neural network pruning. *Advances in Neural Information Processing Systems*, 33:10936– 10947, 2020. Qinglin Wang, Dongsheng Li, Xiandong Huang, Siqi Shen, Songzhu Mei, and Jie Liu. Optimizing fftbased convolution on armv8 multi-core cpus. In *Euro-Par 2020: Parallel Processing: 26th International* Conference on Parallel and Distributed Computing, Warsaw, Poland, August 24–28, 2020, Proceedings, pp. 248–262. Springer, 2020. Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. *Advances in neural information processing systems*, 29, 2016. Zhuliang Yao, Shijie Cao, Wencong Xiao, Chen Zhang, and Lanshun Nie. Balanced sparsity for efficient dnn inference on gpu. In *Proceedings of the AAAI Conference on Artificial Intelligence*, volume 33, pp. 5676–5683, 2019. Yuxin Zhang, Mingbao Lin, Chia-Wen Lin, Jie Chen, Yongjian Wu, Yonghong Tian, and Rongrong Ji. Carrying out cnn channel pruning in a white box. IEEE Transactions on Neural Networks and Learning Systems, 2022. Yuxin Zhang, Yiting Luo, Mingbao Lin, Yunshan Zhong, Jingjing Xie, Fei Chao, and Rongrong Ji. Bidirectional masks for efficient n: M sparse training. *arXiv preprint arXiv:2302.06058*, 2023. Aojun Zhou, Yukun Ma, Junnan Zhu, Jianbo Liu, Zhijie Zhang, Kun Yuan, Wenxiu Sun, and Hongsheng Li. Learning n: M fine-grained structured sparse neural networks from scratch. *arXiv preprint* arXiv:2102.04010, 2021a. Yangjie Zhou, Mengtian Yang, Cong Guo, Jingwen Leng, Yun Liang, Quan Chen, Minyi Guo, and Yuhao Zhu. Characterizing and demystifying the implicit convolution algorithm on commercial matrix-multiplication accelerators. In *2021 IEEE International Symposium on Workload Characterization (IISWC)*, pp. 214–225. IEEE, 2021b. Michael Zhu and Suyog Gupta. To prune, or not to prune: exploring the efficacy of pruning for model compression. *arXiv preprint arXiv:1710.01878*, 2017.
Review 1: Summary: The manuscript introduces a novel fine-grained pruning technique termed 'complementary sparsity,' aimed at boosting model accuracy while preserving parallelism for enhanced performance on standard CPUs and GPUs. Through comparisons with existing coarse-grained and fine-grained pruning approaches, the authors demonstrate that their proposed method outperforms others in terms of model accuracy, specifically when tested on CIFAR-100 and ImageNet using VGG19 and ResNet architectures. Additionally, the manuscript includes an exploration of relevant hyperparameters." Strengths and Weaknesses: [Strengths] - The manuscript provides a comprehensive set of metrics, including sparsity levels, model accuracy, computational speed-up, and FLOPs, to evaluate the proposed pruning method. - The inclusion of the well-established N:M sparsity scheme in the experiments lends credibility to the study. - The proposed 'complementary sparsity' technique demonstrates competitive performance across a range of CNN architectures. [Weaknesses] - The manuscript lacks an in-depth analysis to explain why the proposed pruning method yields superior model accuracy. Insights into the relationship between the distribution of significant weights and pruning outcomes are notably missing. - The choice of models for experimentation appears dated. Given that even contemporary CPUs and GPUs—including ARM chips—can efficiently handle models like ResNets, the study should extend its scope to include Transformer-based models or provide theoretical backing to explain its applicability to state-of-the-art architectures. - The claim that the proposed method surpasses unstructured pruning methods in terms of accuracy warrants further justification. Specific details addressing this point are needed to make such a claim credible. - Too many typos. [Overall Remarks] While the proposed method shows promise in maintaining high levels of parallelism, the empirical results are less convincing due to the selection of older models. For the manuscript to make a more compelling case, it should offer detailed analyses that demonstrate the method's viability for cutting-edge architectures. Additionally, the authors should elaborate on why their approach is particularly well-suited for contemporary parallel computing architectures. Requested Changes: Please refer to 'weakness' above Broader Impact Concerns: None ================================================== Review 2: Summary: 1. The paper introduces a novel sparse pattern called CS, optimized for high mask flexibility and computational acceleration, allowing for effective pruning of CNNs with minimal loss in accuracy. 2. It proposes a CS-specific training algorithm that enhances the accuracy of highly sparse CNNs, outperforming traditional N:M sparsity methods, such as 0.48% improvements on ResNet50. 3. It proposes a parallel acceleration algorithm for the inference phase, tailored for CS-based convolutions, achieving up to 3.07x speedup over dense configurations supported by cuDNN at 93.75% sparsity. Strengths and Weaknesses: strength: 1. The complementary sparsity is an interesting new idea of achieving sparsity. 2. Comparisons on CIFAR and Imagenet shows better speedup and accuracy. Weakness 1. It seems that the propose CS requires specific optimization of the GPU kernel. It is thus unclear that when other sparsity patterns are optimized on cuda kernel level on a common GPU, whether the proposed CS sparsity can have better speed. Requested Changes: 1. page 7 we propose a weight resue-based => reuse-based 2. Please also discuss the training overhead of the CS compared with other baseline pruning methods. 3. Add performance of channel pruning and block sparsity to the Figure 6. 4. Although not all GPU supports 2:4 sparsity, it would still be valuable to compare the speed of proposed method with N:M sparsity on GPU with N:M tensor core 5. Please address the concern in weakness above. 6. fixed the overlapped "Sparsity" with column line in table 3 7. table 3, use the same network for all sparsities, so that the insight about trend of accuracy improvements can be obtained. 8. it is surprising that the CS can outperform unstructured sparsity by such a large amount. More explanations and insights are needed. Broader Impact Concerns: No concerns. ================================================== Review 3: Summary: This paper presents a new fine-grained pruning method termed "complementary sparsity". Similar to the more widely-known N:M sparsity, this paper presents a 1:K strided sparsity pattern in CNNs. This means that for a strided group of weights along the channel dimension, every group of weights that are K elements apart, only one can have a value while the rest are set to zero. This feels like a specific case of N:M sparsity, but the authors of the paper point out that an efficient GPU kernel can be written to accelerate the proposed complementary sparsity, while N:M sparsity requires special sparsity support in Ampere GPUs. Strengths and Weaknesses: Strengths: - Fine-grained unstructured sparsity us plentiful in DNNs yet challenging to accelerate, and the proposed method moves towards finer-grained semi-structured sparsity that can be practically accelerated on commodity GPUs. - Both a sparsity algorithm is presented and real hardware speedups are realized through a custom GPU kernel. Weaknesses: - Evaluation is very limited to five somewhat dated CNNs. Evaluations on other DNN topologies (e.g. Transformers) and other tasks (e.g. speech, language, generative) would better demonstrate the efficacy of a new supposedly-general pruning approach. - I have some concerns about whether the accuracy comparisons are fair. A special training method was applied for the proposed complementary sparsity method. What about all the baselines? How were they trained? Hyperparameters, epochs, etc? Do you use the same gradual pruning approach for the baselines? - Improvements vs. baselines are somewhat limited. - No comparisons to N:M sparsity for which the support exists on current GPUs. I realize that authors wanted to present a method without dedicated/additional GPU support, but a comparison would've been informative. - [Minor] No energy/power measurements. Would be interesting to see if there are energy implications. - Are you releasing your code? Requested Changes: Addressing the weaknesses above would make the paper much better in my opinion. Specifically: - More experiments and demonstrating generality to different models, tasks, datasets. - A clarification of the training regime and ensuring a fair comparison. - Comparison to N:M sparsity from a perf/watt perspective. Broader Impact Concerns: None ================================================== Metareview: Recommendation: Accept with minor revision Comment: This paper explores fine-grained structural pruning of deep learning models. The technique, referred to as “complementary sparsity”, build upon the N:M sparsity, but with constrained mask patterns, which is shown to have comparable accuracy performance as N:M sparsity, also enables a parallel accelerating algorithm that can be adapted to common GPUS without sparse tensor cores. The proposed methods are evaluated on a few popular CNN models and CIFAR/ImageNet datasets, demonstrating competitive accuracy and speedup. Overall, the paper is reasonably well-written. The concept of complementary sparsity is quite straightforward and offers clear advantage on terms of acceleration, without requiring special hardware, enabling its implementation on standard GPUs. The custom GPU kernel implementation and the results demonstrate the hardware speedup. The training algorithm for pruning may not be novel but demonstrates accuracy level comparable to N:M sparsity method. The reviewers have raised two primary concerns: 1). The evaluation is limited to a small number of relatively older CNN models. While the accuracy performance is evaluated on both CIFAR and ImageNet dataset, the speedup evaluation is primarily on CIFAR100 dataset. 2). Lack of speedup comparison with N:M sparsity. During rebuttal, the authors presented additional data and clarifications, to some extend addressing these concerns. In particular, the authors provide accuracy performance on small transformer models and speedup comparison with block sparsity and N:M sparsity. To summarize, this paper is reasonably solid albeit with some reservations. Two reviewers recommend accept, while one reviewer leaning rejection. Considering the proposed sparsity patten is interesting and potential benefits offered by customer kernels for users lacking access to specialized hardware, I am inclined towards acceptance. However, certain modifications are warranted. In particular, the new data and explanations that presented in the rebuttal should be incorporated in the final version with comprehensive explanation. The authors are expected to fulfill their promise of releasing the code and the kernel implementation. Additionally, the authors should fix typos and figure label issues thoroughly. ==================================================
# Robust Stochastic Optimization Via Gradient Quantile Clipping Anonymous authors May 9, 2024 ## Abstract We introduce a clipping strategy for Stochastic Gradient Descent (SGD) which uses quantiles of the gradient norm as clipping thresholds. We prove that this new strategy provides a robust and efficient optimization algorithm for smooth objectives (convex or non-convex), that tolerates heavy-tailed samples (including infinite variance) and a fraction of outliers in the data stream akin to Huber contamination. Our mathematical analysis leverages the connection between constant step size SGD and Markov chains and handles the bias introduced by clipping in an original way. For strongly convex objectives, we prove that the iteration converges to a concentrated distribution and derive high probability bounds on the final estimation error. In the non-convex case, we prove that the limit distribution is localized on a neighborhood with low gradient. We propose an implementation of this algorithm using rolling quantiles which leads to a highly efficient optimization procedure with strong robustness properties, as confirmed by our numerical experiments. Keywords. robust methods, stochastic optimization, heavy-tailed data, outliers, generalization error ## 1 Introduction Stochastic gradient descent (SGD) [72] is the core optimization algorithm at the origin of most stochastic optimization procedures [46, 23, 44]. SGD and its variants are ubiquitously employed in machine learning in order to train most models [47, 7, 48, 79, 13, 55]. The convergence properties of SGD are therefore subjects of major interest. The first guarantees [62, 30] hold under strong statistical assumptions which require data to follow light-tailed sub-Gaussian distributions and provide error bounds in expectation. With the recent resurgence of interest for robust statistics [37, 25, 49, 70], variants of SGD based on clipping are shown to be robust to heavy-tailed gradients [31, 81], where the gradient samples are only required to have a finite variance. The latter requirement has been further weakened to the existence of a q-th moment for some q > 1 in [77, 65]. In this paper, we go further and show that another variant of clipped SGD with proper thresholds is robust both to heavy tails and outliers in the data stream. Robust statistics appeared in the 60s with the pioneering works of Huber, Tukey and others [82, 41, 39, 76, 32]. More recently, the field found new momentum thanks to a series of works about robust scalar mean estimation [18, 1, 43, 53] and the more challenging multidimensional case [35, 19, 52, 59, 22, 24, 50, 27]. These paved the way to the elaboration of a host of robust learning algorithms [34, 70, 49, 51, 66] which have to date overwhelmingly focused on the batch learning setting. We consider the setting of streaming stochastic optimization [12, 14, 57], which raises an additional difficulty coming from the fact that algorithms can see each sample only once and must operate under an O(d) memory and complexity constraint for d-dimensional optimization 1 problems. A limited number of papers [81, 60, 28] propose theoretical guarantees for robust algorithms learning from streaming data. This work introduces such an algorithm that learns from data on the fly and is robust both to heavy tails and outliers, with minimal computational overhead and sound theoretical guarantees. We consider the problem of minimizing a smooth objective $$\operatorname*{min}_{\theta\in\mathbb{R}^{d}}{\mathcal{L}}(\theta):=\mathbb{E}_{\zeta}[\ell(\theta,\zeta)]$$ $$(1)$$ ✓2Rd L(✓) := E⇣ [`(✓, ⇣)] (1) using observations G(✓, ⇣t) of the unknown gradient rL(✓), based on samples (⇣t)t0 received sequentially that include corruptions with probability ⌘ < 1/2. Formulation (1) is common to numerous machine learning problems where ` is a loss function evaluating the fit of a model with parameters ✓ on a sample ⇣, the expectation E is w.r.t the unknown uncorrupted sample distribution. We introduce quantile-clipped SGD (QC-SGD) which uses the iteration $$\theta_{t+1}=\theta_{t}-\alpha_{\theta_{t}}\beta G(\theta_{t},\zeta_{t})\ \ \ \mbox{with}\ \ \alpha_{\theta_{t}}=\min\left(1,\frac{\tau_{\theta_{t}}}{\|G(\theta_{t},\zeta_{t})\|}\right),\tag{2}$$ where > 0 is a constant step size and ↵✓t is the clipping factor with threshold chosen as the p-th quantile ⌧✓t = Qp(kGe(✓t, ⇣t)k) with Ge(✓t, ⇣t) an uncorrupted sample of rL(✓t) and p 2 (0, 1) (details will follow). Quantiles are a natural choice of clipping threshold which allows to handle heavy tails [75, 11] and corrupted data. For instance, the trimmed mean offers a robust and computationally efficient estimator of a scalar expectation [53]. Since the quantile Qp(kGe(✓t, ⇣t)k) is non-observable, we introduce a method based on rolling quantiles in Section 5 which keeps the procedure O(d) both memory and complexity-wise. Contributions. Our main contributions are as follows: - For small enough ⌘ and well-chosen p, we show that, whenever the optimization objective is smooth and strongly convex, QC-SGD converges *geometrically* to a limit distribution such that the deviation around the optimum achieves the *optimal* dependence on ⌘. - In the non-corrupted case ⌘ = 0 and with a strongly convex objective, we prove that a coordinated choice of and p ensures that the limit distribution is sub-Gaussian with constant of order O( p). In the corrupted case ⌘ > 0, the limit distribution is sub-exponential. - For a smooth objective (non-convex) whose gradient satisfies an identifiability condition, we prove that the total variation distance between QC-SGD iterates and its limit distribution vanishes sub-linearly. In this case, the limit distribution is such that the deviation of the objective gradient is optimally controlled in terms of ⌘. - Finally, we provide experiments to demonstrate that QC-SGD can be easily implemented by estimating Qp(kGe(✓t, ⇣t)k) with rolling quantiles. In particular, we show that the iteration is indeed robust to heavy tails and corruption on multiple stochastic optimization tasks. Our theoretical results are derived thanks to a modelling through Markov chains and hold under an Lq assumption on the gradient distribution with q > 1. Related works. Convergence in distribution of the Markov chain generated by constant step size SGD, relatively to the Wasserstein metric, was first established in [29]. Another geometric convergence result was derived in [86] for non-convex, non-smooth, but quadratically growing objectives, where a convergence statement relatively to a weighted total variation distance is given and a CLT is established. These papers do not consider robustness to heavy tails or outliers. Early works proposed stochastic optimization and parameter estimation algorithms which are robust to a wide class of noise of distributions [56, 67, 68, 71, 80, 21, 20, 61], where asymptotic convergence guarantees are stated for large sample sizes. Initial evidence of the robustness of clipped SGD to heavy tails was given by [87] who obtained results in expectation. Subsequent works derived high-confidence sub-Gaussian performance bounds under a finite variance assumption [31, 81] and later under an Lq assumption [77, 65] with q > 1. A similar SGD clipping scheme to (2) is presented in [78], however, in contrast to our work, they do not consider the robust setting and focus on experimental study while we also provide theoretical guarantees. Robust versions of Stochastic Mirror Descent (SMD) are introduced in [60, 45]. For a proper choice of the mirror map, SMD is shown to handle infinite variance gradients without any explicit clipping [85]. Finally, [28] studY heavy-tailed and outlier robust streaming estimation algorithms of the expectation and covariance. On this basis, robust algorithms for linear and logistic regression are derived. However, the involved filtering procedure is hard to implement in practice and no numerical evaluation of the considered approach is proposed. Agenda. In Section 2 we set notations, state the assumptions required by our theoretical results and provide some necessary background on continuous state Markov chains. In Section 3, we state our results for strongly convex objectives including geometric ergodicity of QC-SGD (Theorem 1), characterizations of the limit distribution and deviation bounds on the final estimate. In Section 4, we remove the convexity assumption and obtain a weaker ergodicity result (Theorem 2) and characterize the limit distribution in terms of the deviations of the objective gradient. Finally, we present a rolling quantile procedure in Section 5 and demonstrate its performance through a few numerical experiments on synthetic and real data. ## 2 Preliminaries The model parameter space is Rd endowed with the Euclidean norm k · k, B(Rd) is the Borel -algebra of Rd and we denote by M1(Rd) the set of probability measures over Rd. We assume throughout the paper that the objective L is smooth. Assumption 1. The objective L is L-Lipschitz-smooth, *namely* $${\mathcal{L}}(\theta^{\prime})\leq{\mathcal{L}}(\theta)+\langle\nabla{\mathcal{L}}(\theta),\theta^{\prime}-\theta\rangle+{\frac{L}{2}}\|\theta-\theta^{\prime}\|^{2}$$ with L < +1 *for all* ✓, ✓0 2 Rd. The results from Section 3 below use the following Assumption 2. The objective L is µ-strongly convex, *namely* $\bullet$ (cf) $\bullet$ (cf. $$\mathbf{\partial}\mathbf{\partial},\mathbf{\partial}\mathbf{\partial}=\mathbf{\partial}$$ $\phi$. L(✓0) L(✓) + hrL(✓), ✓0 ✓i + µ2 k✓ ✓0k2 with µ > 0 *for all* ✓, ✓0 2 Rd. An immediate consequence of Assumption 2 is the existence of a unique minimizer ✓? = argmin✓2Rd L(✓). The next assumption formalizes our corruption model. Assumption 3 (⌘-corruption). The gradients (G(✓t, ⇣t))t0 *used in Iteration* (2) *are sampled as* G(✓t, ⇣t) = UtGq(✓t) + (1 Ut)Ge(✓t, ⇣t) where Ut are i.i.d Bernoulli random variables with parameter ⌘ < 1/2, Gq(✓t) ⇠ DO(✓t) with DO(✓t) *an arbitrary distribution and* Ge(✓t, ⇣t) ⇠ DI(✓t) *follows the true gradient distribution and is independent from the past given* ✓t. $$-\;\theta^{\prime}||^{2}$$ Assumption 3 is an online analog of the Huber contamination model [38, 41] where corruptions occur with probability ⌘ and where the distribution of corrupted samples is not fixed and may depend on the current iterate ✓t. The next assumption requires the true gradient distribution to be unbiased and diffuse. Assumption 4. For all ✓, non-corrupted gradient samples Ge(✓, ⇣) ⇠ DI(✓) *are such that* $$\mathcal{T}(\theta,\zeta)\sim\mathcal{D}_{\mathcal{I}}(\theta)\;a r e\;s u c h$$ $$\widetilde{G}(\theta,\zeta)=\nabla{\mathcal{L}}(\theta)+\varepsilon_{\theta},$$ $$({\mathfrak{I}})$$ Ge(✓, ⇣) = rL(✓) + "✓, (3) where "✓ *is a centered noise* E["✓|✓]=0 *with distribution* ⌫✓,1 + (1 )⌫✓,2 where > 0 and ⌫✓,1, ⌫✓,2 are distributions over Rd such that ⌫✓,1 admits a density h✓ w.r.t. the Lebesgue measure satisfying $$\operatorname*{inf}_{\|\omega\|\leq R}h_{\theta}(\omega)>\varkappa(R)>0$$ for all R > 0, where {(·) *is independent of* ✓. Assumption 4 imposes a weak constraint, since it is satisfied, for example, as soon as the noise "✓ admits a density w.r.t. Lebesgue's measure. Our last assumption formalizes the requirement of a finite moment for the gradient error. Assumption 5. There is q > 1 such that for Ge(✓, ⇣) ⇠ DI(✓), *we have* $$\mathbf{r},\,\zeta\,\}\sim\mathcal{L}_{\mathcal{I}}$$ $$\mathbb{E}\big{[}\|\varepsilon_{\theta}\|^{q}\mid\theta\big{]}^{1/q}=\mathbb{E}\big{[}\|\widetilde{G}(\theta,\zeta)-\nabla\mathcal{L}(\theta)\|^{q}\mid\theta\big{]}^{1/q}\leq A_{q}\|\theta-\theta^{\star}\|+B_{q}\tag{4}$$ for all ✓ 2 Rd, where Aq, Bq > 0. When L is not strongly convex, *we further assume that* Aq = 0. The bound (4) captures the case of arbitrarily high noise magnitude through the dependence on k✓ ✓?k. This is consistent with common strongly convex optimization problems such as least squares regression. For non-strongly convex L, we require Aq = 0 since ✓? may not exist. Definition 1. If X is a real random variable, we say that X is K-sub-Gaussian for K > 0 if $$\mathbb{E}\exp(\lambda^{2}X^{2})\leq e^{\lambda^{2}K^{2}}\quad f o r\quad|\lambda|\leq1/K.$$ $$({\boldsymbol{S}})$$ $$\begin{array}{r l}{{}}&{{}}\\ {{}}&{{}}\end{array}\begin{array}{r l}{{}}&{{}}\\ {{}}&{{}}\\ {{}}&{{}}\end{array}\begin{array}{r l}{{}}&{{}}\\ {{}}&{{}}\\ {{}}&{{}}\end{array}\begin{array}{r l}{{}}&{{}}\\ {{}}&{{}}\\ {{}}&{{}}\end{array}$$ E exp(2X2) e2K2for || 1/K. (5) We say that X is K-sub-exponential for K > 0 if $$\mathbb{E}\exp(\lambda|X|)\leq\exp(\lambda K)$$ E exp(|X|) exp(K) for all 0 1/K. (6) The convergence results presented in this paper use the following formalism of continuous state Markov chains. Given a step size > 0 and a quantile p 2 (0, 1), we denote by P,p the Markov transition kernel governing the Markov chain (✓t)t0 generated by QC-SGD, so that $$(6)$$ $$\mathbb{P}(\theta_{t+1}\in A\,|\,\theta_{t})=P_{\beta,p}(\theta_{t},A)$$ for t 0 and A 2 B(Rd). The transition kernel P,p acts on probability distributions ⌫ 2 M1(Rd) through the mapping ⌫ ! ⌫P,p which is defined, for all A 2 B(Rd), by ⌫P,p(A) = RA P,p(✓, A)d⌫(✓) = P(✓t+1 2 A | ✓t ⇠ ⌫). For n 1, we similarly define the multi-step transition kernel P n,p which is such that P n,p(✓t, A) = P(✓t+n 2 A | ✓t) and acts on probability distributions ⌫ 2 M1(Rd) through ⌫P n,p = (⌫P,p)P n1 ,p . Finally, we define the total variation (TV) norm of a signed measure ⌫ as $$2\|\nu\|_{\mathrm{TV}}=\operatorname*{sup}_{f:|f|\leq1}\int f(\theta)\nu(d\theta)=\operatorname*{sup}_{A\in{\mathcal{B}}(\mathbb{R}^{d})}\nu(A)-\operatorname*{inf}_{A\in{\mathcal{B}}(\mathbb{R}^{d})}\nu(A).$$ In particular, we recover the TV *distance* between ⌫1, ⌫2 2 M1(Rd) as dTV(⌫1, ⌫2) = k⌫1 ⌫2kTV. ## 3 Strongly Convex Objectives We are ready to state our convergence result for the stochastic optimization of a strongly convex objective using QC-SGD with ⌘-corrupted samples. Theorem 1 (Geometric ergodicity). *Let Assumptions 1-5 hold and assume there is a quantile* p 2 [⌘, 1 ⌘] *such that* $$\kappa:=(1-\eta)p\mu-\eta L-(1-p)^{-\frac{1}{q}}A_{q}(1-p(1-\eta))>0.$$ Then, for a step size *satisfying* $$\beta<\frac{1}{4}\frac{\kappa}{\mu^{2}+6L^{2}+16\eta^{-\frac{2}{q}}A_{q}^{2}},\tag{8}$$ $$(7)$$ $\operatorname{ad}\,\operatorname{at}\theta$ . the Markov chain (✓t)t0 generated by QC-SGD with parameters and p converges geometrically to a unique invariant measure ⇡,p: for any initial ✓0 2 Rd, there is ⇢ < 1 and M < 1 *such that* after T *iterations* $$\left\|\delta_{\theta_{0}}P_{\beta,p}^{T}-\pi_{\beta,p}\right\|_{\mathrm{TV}}\leq M\rho^{T}\big(1+\|\theta_{0}-\theta^{\star}\|^{2}\big),$$ where ✓0 *is the Dirac measure located at* ✓0. The proof of Theorem 1 is given in Appendix D.2 and relies on the geometric ergodicity result of [58, Chapter 15] for Markov chains with a geometric drift property. A similar result for quadratically growing objectives was established by [86] and convergence w.r.t. Wasserstein's metric was shown in [29] assuming uniform gradient co-coercivity. However, robustness was not considered in these works. The restriction p 2 [⌘, 1 ⌘] comes from the consideration that other quantiles are not estimable in the event of ⌘-corruption. Condition (7) is best interpreted for the choice p = 1 ⌘ in which case it translates into ⌘11/q O(µ/(L + Aq)) implying that it is verified for ⌘ small enough within a limit fixed by the problem conditioning. A similar condition with q = 2 appears in [28, Theorem E.9] which uses a finite variance assumption. The constants M and ⇢ controlling the geometric convergence speed in Theorem 1 depend on the parameters , p and the initial ✓0. Among choices fulfilling the convergence conditions, it is straightforward that greater step size and ✓0 closer to ✓? lead to faster convergence. However, the dependence in p is more intricate and should be evaluated through the resulting value of . We provide a more detailed discussion about the value of ⇢ in Appendix C. The choice p = 1 ⌘ appears to be ideal since it leads to optimal deviation of the invariant distribution around the optimum ✓? which is the essence of our next statement. Proposition 1. *Assume the same as in Theorem 1 and condition* (7) *with the choice* p = 1 ⌘. For step size *satisfying* (8), q 2*, and additionally*: $$\beta\leq\eta^{2-2/q}/\kappa,$$ $$(9)$$ ⌘22/q/, (9) $$\cdot\,\theta\sim\tau$$ for ✓ ⇠ ⇡,1⌘*, we have the following upper bound:* $$\mathbb{E}\|\theta-\theta^{\star}\|^{2}\leq\left(\frac{6\eta^{1-1/q}B_{q}}{\kappa}\right)^{2}.$$ Proposition 1 is proven in Appendix D.3. An analogous result holds for q 2 (1, 2) but requires a different proof and can be found in Appendix D.4. Proposition 1 may be compared to [86, Theorem 3.1] which shows that the asymptotic estimation error can be reduced arbitrarily using a small step size. However, this is impossible in our case since we consider corrupted gradients. The performance of Proposition 1 is best discussed in the specific context of linear regression where gradients are given as G(✓,(*X, Y* )) = X(X>✓ Y ) for samples *X, Y* 2 Rd ⇥ R such that Y = X>✓? + ✏ with ✏ a centered noise. In this case, a finite moment of order k for the data implies order k/2 for the gradient corresponding to an ⌘12/k rate in Proposition 1. Since Assumption 5 does not include independence of the noise ✏ from X, this corresponds to the negatively correlated moments assumption of [2] being unsatisfied. Consequently, Proposition 1 is information-theoretically optimal in ⌘ based on [2, Corollary 4.2]. Nonetheless, the poor dimension dependence through Bq may still be improved. If the gradient is sub-Gaussian with constant K, we would have Bq . Kpq for q 1 (see [84] for a reference), in which case, the choice q = log(1/⌘) recovers the optimal rate in ⌘ plog(1/⌘) for the Gaussian case. We now turn to showing strong concentration properties for the invariant distribution ⇡,p. For this purpose, we restrict the optimization to a bounded and convex set ⇥ ⇢ Rd and replace Iteration (2) by the projected iteration $$\theta_{t+1}=\Pi_{\Theta}\big(\theta_{t}-\alpha_{\theta_{t}}\beta G(\theta_{t},\zeta_{t})\big),$$ $$(10)$$ , (10) where ⇧⇥ is the projection onto ⇥. Assuming that the latter contains the optimum ✓? 2 ⇥, one can check that the previous results continue to hold thanks to the inequality $$\|\Pi_{\Theta}(\theta)-\theta^{\star}\|=\|\Pi_{\Theta}(\theta)-\Pi_{\Theta}(\theta^{\star})\|\leq\|\theta-\theta^{\star}\|,$$ which results from the convexity of ⇥. The restriction of the optimization to a bounded set allows us to uniformly bound the clipping threshold ⌧✓, which is indispensable for the following result. Proposition 2. In the setting of Theorem 1, *consider projected QC-SGD* (10) *and let* ⌧ = sup✓2⇥ ⌧✓, D = diam(⇥) the diameter of ⇥ and Bq = AqD + Bq. - *Consider the non-corrupted case* ⌘ = 0 and set the quantile p *such that* p 1(µ) q 2(q1) . Then, for ✓ ⇠ ⇡,p, the variable k✓ ✓?k *is sub-Gaussian in the sense of Definition 1 with* constant $$K=4\sqrt{\frac{2\beta(\overline{{{B}}}_{q}^{2}+\overline{{{\tau}}}^{2})}{p\mu}}.$$ - Consider the corrupted case ⌘ > 0, and set the quantile p 2 [⌘, 1 ⌘] *such that Inequality* (7) holds. Then, for ✓ ⇠ ⇡,p, the variable k✓ ✓?k *is sub-exponential in the sense of* Definition 1 with constant $$K=\frac{\overline{{{7\tau}}}+(1-p)^{1-1/q}\overline{{{B}}}_{q}}{p\mu}.$$ The proof can be found in Appendix D.5. The strong concentration properties given by Proposition 2 for the invariant distribution appear to be new. Still, the previous result remains asymptotic in nature. High confidence deviation bounds for an iterate ✓t can be derived by leveraging the convergence in Total Variation distance given by Theorem 1 leading to the following result. Corollary 1. In the setting of Proposition 2, *in the absence of corruption* ⌘ = 0, after T *iterations*, for > 0, *we have* $$\mathbb{P}\bigg(\left\|\theta_{T}-\theta^{\star}\right\|>4\sqrt{\overline{{B}}_{q}^{2}+\overline{{\tau}}^{2}}\sqrt{\frac{2\beta\log(e/\delta)}{p\mu}}\bigg)\leq\delta+\rho^{T}M\big(1+\|\theta_{0}-\theta^{\star}\|^{2}\big).$$ Choosing a smaller step size in Corollary 1 allows to improve the deviation bound. However, this comes at the cost of weaker confidence because of slower convergence due to a greater ⇢. See Appendix C for a discussion including a possible compromise. Corollary 1 may be compared to the results of [31, 81, 77, 65] which correspond to ⇡ 1/T and have a similar dependence on the dimension through the gradient variance. Although their approach is also based on gradient clipping, they use different thresholds and proof methods. In the presence of corruption, the invariant distribution is not sub-Gaussian. This can be seen by considering the following toy Markov chain: $$X_{t+1}=\begin{cases}\alpha X_{t}+\xi&\text{w.p.}\quad1-\eta\\ X_{t}+\tau&\text{w.p.}\quad\eta\end{cases}$$ where ↵ < 1, ⌧ > 0 are constants and ⇠ is a positive random noise. Using similar methods to the proof of Theorem 1, one can show that (Xt)t0 converges (for any initial X0) to an invariant distribution whose moments can be shown to grow linearly, indicating a sub-exponential distribution and excluding a sub-Gaussian one. We provide additional details for the underlying argument in Appendix D.6. For the corrupted case, the sub-exponential property stated in Proposition 2 holds with a constant K of order ⌧/µ, which is not satisfactory and leaves little room for improvement due to the inevitable bias introduced by corruption. Therefore, we propose the following procedure in order to obtain a high confidence estimate, similarly to Corollary 1. Algorithm 1: Aggregation of cycling iterates Input: Step size > 0, quantile index p 2 (0, 1), initial parameter ✓0 2 ⇥, horizon T and number of concurrent iterates N 1. Optimize multiple parameters ✓ (1) t *,...,* ✓ (N) t starting from a common ✓0 = ✓ (n) 0 for n 2 JNK =: {1*,...,N*} and T steps t = 0*,...,T* using the following cycling iteration:; $$\theta_{t+1}^{(n)}\!=\!\begin{cases}\theta_{t}^{(n)}\!-\!\alpha_{\theta_{t}^{(n)}}\beta G\big(\theta_{t}^{(n)},\zeta_{t}\big)&\mathrm{if}\ t\!\equiv\!n\!-\!1\ \mathrm{mod}\ N,\\ \theta_{t}^{(n)}&\mathrm{otherwise}.\end{cases}$$ $\mathbf{r}\;i,j\in\left[\!\left[N\right]\!\right]$.; $$(11)$$ Compute rij = ✓ (i) T ✓ (j) T for *i, j* 2 JNK.; For j 2JNK, let r(j)2RN+ be the vector rj,: :=[rj,1,...,rj,N ] sorted in non decreasing order.; Compute the aggregated estimator as ✓b = ✓ (bi) T with bi = argmini2JNK r (i) N/2.; return ✓b Algorithm 1 uses ideas from [37] (see also [59, 45]) and combines a collection of *weak* estimators (only satisfying L2 bounds) into a strong one with sub-exponential deviation. The aggregated estimator ✓bsatisfies the high probability bound given in the next result. Corollary 2. Assume the same as in Theorem 1 and Proposition 1. Consider ✓b given by Algorithm 1, *with the assumption that the gradient sample sets used for each* ✓ (n) Tn2JNK *in Equation* (11) *are independent. For* > 0, if N 16 log(1/) and T *satisfies* $\dashv$ T N log(15M(1 + k✓0 ✓?k2))/ log(1/⇢), then, with probability at least 1 , *we have* $$f(1+\|\theta$$ $$0=\theta^{\star}$$ $\square$ $$\left\|\widehat{\theta}-\theta^{\star}\right\|\leq\frac{27\eta^{1-\frac{1}{q}}\overline{{B}}_{q}}{\kappa}.$$ . (12) $$(12)^{\frac{1}{2}}$$ We obtain a high confidence version of the bound in expectation previously stated in Proposition 1. As argued before, the above bound depends optimally on ⌘. Similar bounds to (12) are obtained for q = 2 in [28] for streaming mean estimation, linear and logistic regression. Their results enjoy better dimension dependence but are less general than ours. In addition, the implementation of the associated algorithm is not straightforward whereas our method is quite easy to use (see Section 5). ## 4 Smooth Objectives In this section, we drop Assumption 2 and consider the optimization of possibly non-convex objectives. Consequently, the existence of a unique optimum ✓? and the quadratic growth of the objective are no longer guaranteed. This motivates us to use a uniform version of Assumption 5 with Aq = 0 since the gradient is no longer assumed coercive and its deviation moments can be taken as bounded. In this context, we obtain the following weaker (compared to Theorem 1) ergodicity result for QC-SGD. Theorem 2 (Ergodicity). *Let Assumptions 1, 3, 4 and 5 hold with* Aq = 0 (*uniformly bounded* moments) and positive objective L. Let (✓t)t0 be the Markov chain generated by QC-SGD with step size and quantile p 2 [⌘, 1 ⌘]. Assume that p and are such that 3p(1 ⌘)/4 > L + ⌘ and that the subset of Rd *given by* $$\left\{\theta:\frac{1}{2}\|\nabla\mathcal{L}(\theta)\|^{2}\leq\frac{B_{\theta}^{2}\big{(}(1-p)^{-\frac{2}{3}}(L\beta+2n^{2})+2\eta^{2-\frac{2}{3}}\big{)}}{p(1-\eta)(3p(1-\eta)/4-L\beta-\eta)}\right\}$$ _is bounded. Then, for any initial $\theta_{0}\in\mathbb{R}^{d}$, there exists $M<+\infty$ such that after $T$ iterations,_ $$\|\delta_{\theta_{0}}P_{\beta,p}^{T}-\pi_{\beta,p}\|_{\mathrm{TV}}\leq\frac{M}{T},$$ _where $\pi_{\beta,p}$ is a unique invariant measure and where $\delta_{\theta_{0}}$ is the Dirac measure located at $\theta_{0}$._ $$(13)$$ $$(14)$$ The proof is given in Appendix D.9 and uses ergodicity results from [58, Chapter 13]. Theorem 2 provides convergence conditions for an SGD Markov chain on a smooth objective in a robust setting. We are unaware of anterior results of this kind in the literature. Condition (13) requires that the true gradient exceeds the estimation error at least outside of a bounded set. If this does not hold, the gradient would be dominated by the estimation error, leaving no hope for the iteration to converge. Observe that, for no corruption (⌘ = 0), the condition is always fulfilled for some and p. Note also that without strong convexity (Assumption 2), convergence occurs at a slower sublinear rate which is consistent with the optimization rate expected for a smooth objective (see [15, Theorem 3.3]). As previously, we complement Theorem 1 with a characterization of the invariant distribution. Proposition 3. *Under the conditions of Theorem 2, assume that the choice* p = 1 ⌘ is such that the set (13) is bounded. For step size ⌘2/L, the stationary measure ✓ ⇠ ⇡,1⌘ *satisfies* $$\mathbb{E}\big{\|}\nabla\mathcal{L}(\theta)\big{\|}^{2}\leq\frac{5\eta^{2-\frac{2}{q}}B_{q}^{2}}{p(1-\eta)\big{(}3p(1-\eta)/4-L\beta-\eta\big{)}}.\tag{15}$$ **Proposition 2**: _A **is a $\lambda$-function such that $\mathcal{D}$ is a $\lambda$-function._ The statement of Proposition 3 is clearly less informative than Propositions 1 and 2 since it only pertains to the gradient rather than, for example, the excess risk. This is due to the weaker assumptions that do not allow to relate these quantities. Still, the purpose remains to find a critical point and is achieved up to O(⌘11/q) precision according to this result. Due to corruption, the estimation error on the gradient cannot be reduced beyond ⌦(⌘11/q) [69, 36, 26]. Therefore, one may draw a parallel with a corrupted mean estimation task, in which case, the previous rate is, in fact, information-theoretically optimal. ## 5 Implementation And Numerical Experiments The use of the generally unknown quantile Qp(kGe(✓t, ⇣t)k) in QC-SGD constitutes the main obstacle to its implementation. For strongly convex objectives, one may use a proxy such as ak✓t ✓refk + b with positive *a, b* and ✓ref 2 Rd an approximation of ✓? serving as reference point. This choice is consistent with Assumptions 1 and 5, see Lemma 2 in Appendix D. In the Algorithm 2: Rolling QC-SGD Input: Step size > 0, quantile index p 2 (0, 1), initial parameter ✓0 2 Rd, ⌧unif > 0, buffer B of size S and horizon T. Fill B with S 1 values equal to ⌧unif. for t = 0 *...T* 1 do Draw a sample G(✓t, ⇣t) and add kG(✓t, ⇣t)k to B. Qbp bpSc rank element of B. ✓t+1 ✓t clip(G(✓t, ⇣t), Qbp) Delete the oldest value in B. end return ✓T non-strongly convex case, a constant threshold can be used since the gradient is a priori uniformly bounded, implying the same for the quantiles of its deviations. In practice, we propose a simpler and more direct approach: we use a rolling quantile procedure, described in Algorithm 2. The latter stores the values (kG(✓tj , ⇣tj )k)1jS in a buffer of size S 2 N⇤ and replaces Qp(kGe(✓t, ⇣t)k) in QC-SGD by an estimate Qbp which is the bpSc-th order statistic in the buffer. Note that only the norms of previous gradients are stored in the buffer, limiting the memory overhead to O(S). The computational cost of Qbp can also be kept to O(S) per iteration thanks to a bookkeeping procedure (see Appendix B). We implement this procedure for a few tasks and compare its performance with relevant baselines. We do not include a comparison with [28] whose procedure has no implementation we are aware of and is difficult to use in practice due to its dependence on a number of unknown constants. Our experiments on synthetic data consider an infinite horizon, dimension d = 128, and a constant step size for all methods. Linear regression. We consider least-squares linear regression and compare RQC-SGD with Huber's estimator [40] and clipped SGD (designated as CClip()) with three clipping levels max pd for 2 {0.8, 1.0, 1.2} where max is a fixed data scaling factor. These thresholds provide a rough estimate of the gradient norm. We generate covariates X and labels Y both heavy-tailed and corrupted. Corruption in the data stream is generated according to Assumption 3 with outliers represented either by aberrant values or *fake* samples Y = X>✓fake + ✏ using a false parameter ✓fake, see Appendix B for further details on data generation and fine tuning of the Huber parameter. All methods are run with constant step size and averaged results over 100 runs are displayed on Figure 1 (top row). As anticipated, Huber's loss function is not robust to corrupted covariates. In contrast, using gradient clipping allows convergence to meaningful estimates. Although this holds true for a constant threshold, Figure 1 shows it may considerably slow the convergence if started away from the optimum. In addition, the clipping level also affects the final estimation precision and requires tuning. Both of the previous issues are well addressed by RQC-SGD whose adaptive clipping level allows fast progress of the optimization and accurate convergence towards a small neighborhood of the optimum. Figure 1: Evolution of k✓t ✓?k on the tasks of linear regression (top row) and logistic regression ![9_image_0.png](9_image_0.png) (bottom row) averaged over 100 runs at increasing corruption levels (error bars represent half the standard deviation). Estimators based on Huber's loss are strongly affected by data corruption. SGD with constant clipping thresholds is robust but slow to converge for linear regression and requires tuning for better final precision. RQC-SGD combines fast convergence with good final precision thanks to its adaptive clipping strategy. Logistic regression. We test the same methods on logistic regression. Huber's baseline is represented by the modified Huber loss (also known as quadratic SVM [88]). We generate data similarly to the previous task except for the labels which follow Y ⇠ Bernoulli((X>✓?)) with the sigmoid function. Corrupted labels are either uninformative, flipped or obtained with a fake ✓fake (see details in Appendix B). Results are displayed on the bottom row of Figure 1. As previously, Huber's estimator performs poorly with corruption. However, constant clipping appears to be better suited when the gradient is bounded, so that the optimization is less affected by its underestimation. We observe, nonetheless, that a higher clipping level may lead to poor convergence properties, even at a low corruption rate. Note also that the constant levels we use are based on prior knowledge about the data distribution and would have to be fine tuned in practice. Meanwhile, the latter issue is well addressed by quantile clipping. Finally, notice that no algorithm truly approaches the true solution for this task. This reflects the difficulty of improving upon Proposition 3 which only states convergence to a neighborhood where the objective gradient is comparable to the estimation error in magnitude. Classification with shallow networks. Finally, we evaluate the performance on the task of training a single hidden layer neural network classifier on some real datasets which corresponds to a non-convex optimization problem. To handle multiclass data, we use the cross entropy loss and replace Huber's baseline with plain SGD for simplicity. We define constant clipping baselines using thresholds given by the quantiles of order p = 0.25, 0.5, and 0.75 of the norms of a batch of gradients at the beginning of the optimisation. Due to the greater sensitivity to corruption observed in this case, we set ⌘ = 0.02 and use p = 0.9 for RQC-SGD. We train all methods with one sample per iteration using equal step sizes and evaluate them through the test loss. We provide further results and experimental details in Appendix B. Results are displayed on Figure 2. Unsurprisingly, standard SGD is not robust to corrupted samples and, while using a constant Figure 2: Evolution of the test loss (y-axis) against iteration t (x-axis) for the training of a single ![10_image_0.png](10_image_0.png) hidden layer network on different real world classification datasets (average over 20 runs). We observe more consistent and stable objective decrease for RQC-SGD whereas constant clipping baselines are slower and may fail to converge. clipping level helps keep the optimisation on track, the experiments show that careful tuning may sometimes be necessary to prevent divergence. On the other hand, the adaptive clipping levels used by RQC-SGD allow to make the iteration faster and more resilient to corruption. This leads to an optimization path with a more consistent decrease of the objective. Moreover, we also observe that RQC-SGD allows for a better control of the asymptotic variance of the optimized parameter compared to constant clipping. ## 6 Conclusion We introduced a new clipping strategy for SGD and proved that it defines a stochastic optimization procedure which is robust to both heavy tails and outliers in the data stream. We also provided an efficient rolling quantile procedure to implement it and demonstrated its performance through numerical experiments on synthetic and real data. Future research directions include improving the dimension dependence in our bounds, possibly by using sample rejection rules or by considering stochastic mirror descent [63, 5] clipped with respect to a non Euclidean norm. This may also procure robustness to higher corruption rates. Another interesting research track is the precise quantification of the geometric convergence speed of the Markov chain generated by constant step size SGD on a strongly convex objective. ## References [1] Noga Alon, Yossi Matias, and Mario Szegedy. The space complexity of approximating the frequency moments. In Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, pages 20–29, 1996. [2] Ainesh Bakshi and Adarsh Prasad. Robust linear regression: Optimal rates in polynomial time. In *Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing*, pages 102–115, 2021. [3] Martyna Bator. Dataset for Sensorless Drive Diagnosis. UCI Machine Learning Repository, 2015. DOI: https://doi.org/10.24432/C5VP5F. [4] Peter H Baxendale. Renewal theory and computable convergence rates for geometrically ergodic Markov chains. *The Annals of Applied Probability*, 15(1B):700–738, 2005. [5] Amir Beck and Marc Teboulle. Mirror descent and nonlinear projected subgradient methods for convex optimization. *Operations Research Letters*, 31(3):167–175, 2003. [6] Witold Bednorz. The Kendall's Theorem and its Application to the Geometric Ergodicity of Markov Chains. *arXiv preprint arXiv:1301.1481*, 2013. [7] Albert Benveniste, Michel Metivier, and Pierre Priouret. ´ Adaptive Algorithms and Stochastic Approximations, volume 22. Springer Science & Business Media, 2012. [8] Kenneth S Berenhaut and Robert Lund. Geometric renewal convergence rates from hazard rates. *Journal of Applied Probability*, 38(1):180–194, 2001. [9] Jock Blackard. Covertype. UCI Machine Learning Repository, 1998. DOI: https://doi.org/10.24432/C50K5N. [10] Joseph K Blitzstein and Jessica Hwang. *Introduction to probability*. Crc Press, 2019. [11] D. A. Bloch. A note on the estimation of the location parameter of the cauchy distribution. Journal of the American Statistical Association, 61:852–855, 1966. [12] Leon Bottou and Yann Cun. Large scale online learning. In S. Thrun, L. Saul, and ´ B. Scholkopf, editors, ¨ *Advances in Neural Information Processing Systems*, volume 16. MIT Press, 2003. [13] Leon Bottou, Frank E Curtis, and Jorge Nocedal. Optimization methods for large-scale ´ machine learning. *SIAM review*, 60(2):223–311, 2018. [14] Leon Bottou and Yann Lecun. On-line learning for very large data sets. ´ Applied Stochastic Models in Business and Industry, 21:137 - 151, 03 2005. [15] Sebastien Bubeck. Convex optimization: Algorithms and complexity. ´ Foundations and Trends® in Machine Learning, 8(3-4):231–357, 2015. [16] Herve Cardot, Peggy C ´ enac, and Antoine Godichon-Baggioni. Online estimation of the ge- ´ ometric median in Hilbert spaces: Nonasymptotic confidence balls. *The Annals of Statistics*, 45(2):591 - 614, 2017. [17] Herve Cardot, Peggy C ´ enac, and Pierre-Andr ´ e Zitt. Efficient and fast estimation of the geo- ´ metric median in Hilbert spaces with an averaged stochastic gradient algorithm. *Bernoulli*, 19(1):18 - 43, 2013. [18] Olivier Catoni. Challenging the empirical mean and empirical variance: A deviation study. Annales de l'Institut Henri Poincare, Probabilit ´ *es et Statistiques* ´ , 48(4):1148 - 1185, 2012. [19] Olivier Catoni and Ilaria Giulini. Dimension-free pac-bayesian bounds for the estimation of the mean of a random vector. *arXiv preprint arXiv:1802.04308*, 2018. [20] Han-fu Chen and AI-JUN Gao. Robustness analysis for stochastic approximation algorithms. Stochastics and Stochastic Reports, 26(1):3–20, 1989. [21] Han-Fu Chen, Lei Guo, and Ai-Jun Gao. Convergence and robustness of the robbins-monro algorithm truncated at randomly varying bounds. *Stochastic Processes and their Applications*, 27:217–231, 1987. [22] Yeshwanth Cherapanamjeri, Nicolas Flammarion, and Peter L. Bartlett. Fast mean estimation with sub-gaussian rates. In *Conference on Learning Theory*, pages 786–806. PMLR, 2019. [23] Aaron Defazio, Francis Bach, and Simon Lacoste-Julien. Saga: A fast incremental gradient method with support for non-strongly convex composite objectives. Advances in Neural Information Processing Systems, 27, 2014. [24] Jules Depersin and Guillaume Lecue. Robust sub-Gaussian estimation of a mean vector in ´ nearly linear time. *The Annals of Statistics*, 50(1):511–536, 2022. [25] Ilias Diakonikolas, Gautam Kamath, Daniel Kane, Jerry Li, Ankur Moitra, and Alistair Stewart. Robust estimators in high-dimensions without the computational intractability. SIAM Journal on Computing, 48(2):742–864, 2019. [26] Ilias Diakonikolas and Daniel M Kane. Recent advances in algorithmic high-dimensional robust statistics. *arXiv preprint arXiv:1911.05911*, 2019. [27] Ilias Diakonikolas, Daniel M Kane, and Ankit Pensia. Outlier robust mean estimation with subgaussian rates via stability. *Advances in Neural Information Processing Systems*, 33:1830–1840, 2020. [28] Ilias Diakonikolas, Daniel M Kane, Ankit Pensia, and Thanasis Pittas. Streaming algorithms for high-dimensional robust statistics. In *International Conference on Machine Learning*, pages 5061–5117. PMLR, 2022. [29] Aymeric Dieuleveut, Alain Durmus, and Francis Bach. Bridging the gap between constant step size stochastic gradient descent and Markov chains. *The Annals of Statistics*, 48(3):1348 - 1382, 2020. [30] Saeed Ghadimi and Guanghui Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. *SIAM Journal on Optimization*, 23(4):2341–2368, 2013. [31] Eduard Gorbunov, Marina Danilova, and Alexander Gasnikov. Stochastic optimization with heavy-tailed noise via accelerated gradient clipping. *Advances in Neural Information Processing Systems*, 33:15042–15053, 2020. [32] Frank R Hampel. A general qualitative definition of robustness. *The Annals of Mathematical* Statistics, 42(6):1887–1896, 1971. [33] Abdelhakim Hannousse and Salima Yahiouche. Web page phishing detection. Mendeley Data, 2, 2020. [34] Matthew Holland and Kazushi Ikeda. Better generalization with less data using robust gradient descent. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, *Proceedings of the* 36th International Conference on Machine Learning, volume 97 of *Proceedings of Machine* Learning Research, pages 2761–2770. PMLR, 09–15 Jun 2019. [35] Samuel B. Hopkins. Mean estimation with sub-Gaussian rates in polynomial time. The Annals of Statistics, 48(2):1193–1213, 2020. [36] Samuel B Hopkins and Jerry Li. Mixture models, robustness, and sum of squares proofs. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, pages 1021–1034, 2018. [37] Daniel Hsu and Sivan Sabato. Loss minimization and parameter estimation with heavy tails. The Journal of Machine Learning Research, 17(1):543–582, 2016. [38] Peter J Huber. A robust version of the probability ratio test. The Annals of Mathematical Statistics, pages 1753–1758, 1965. [39] Peter J Huber. The 1972 wald lecture robust statistics: A review. The Annals of Mathematical Statistics, 43(4):1041–1067, 1972. [40] Peter J. Huber. Robust Regression: Asymptotics, Conjectures and Monte Carlo. *The Annals* of Statistics, 1(5):799 - 821, 1973. [41] Peter J Huber. Robust estimation of a location parameter. Breakthroughs in statistics: Methodology and distribution, pages 492–518, 1992. [42] Daniel C Jerison. Quantitative convergence rates for reversible Markov chains via strong random times. *arXiv preprint arXiv:1908.06459*, 2019. [43] Mark R Jerrum, Leslie G Valiant, and Vijay V Vazirani. Random generation of combinatorial structures from a uniform distribution. *Theoretical Computer Science*, 43:169–188, 1986. [44] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. *Advances in Neural Information Processing Systems*, 26, 2013. [45] Anatoli Juditsky, Andrei Kulunchakov, and Hlib Tsyntseus. Sparse recovery by reduced variance stochastic approximation. *Information and Inference: A Journal of the IMA*, 12(2):851– 896, 2023. [46] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. *International* Conference on Learning Representations, 12 2014. [47] Harold J. Kushner and G. George Yin. Stochastic Approximation and Recursive Algorithms and Applications, volume 35. Springer New York, NY, 2003. [48] Guanghui Lan. *First-Order and Stochastic Optimization Methods for Machine Learning*, volume 1. Springer, 2020. [49] Guillaume Lecue and Matthieu Lerasle. Robust machine learning by median-of-means: The- ´ ory and practice. *The Annals of Statistics*, 48, 11 2017. [50] Zhixian Lei, Kyle Luh, Prayaag Venkat, and Fred Zhang. A fast spectral algorithm for mean estimation with sub-Gaussian rates. In *Conference on Learning Theory*, pages 2598–2612. PMLR, 2020. [51] Liu Liu, Yanyao Shen, Tianyang Li, and Constantine Caramanis. High dimensional robust sparse regression. In *International Conference on Artificial Intelligence and Statistics*, pages 411–421. PMLR, 2020. [52] Gabor Lugosi and Shahar Mendelson. Sub-gaussian estimators of the mean of a random ´ vector. *The Annals of Statistics*, 47(2):783–794, 2019. [53] Gabor Lugosi and Shahar Mendelson. Robust multivariate mean estimation: The optimality ´ of trimmed mean. *The Annals of Statistics*, 49(1):393 - 410, 2021. [54] Robert B Lund, Sean P Meyn, and Richard L Tweedie. Computable exponential convergence rates for stochastically ordered Markov processes. *The Annals of Applied Probability*, 6(1):218–237, 1996. [55] Siyuan Ma, Raef Bassily, and Mikhail Belkin. The power of interpolation: Understanding the effectiveness of SGD in modern over-parametrized learning. In *International Conference* on Machine Learning, pages 3325–3334. PMLR, 2018. [56] Rainer Martin and Carl Masreliez. Robust estimation via stochastic approximation. *IEEE* Transactions on Information Theory, 21(3):263–271, 1975. [57] H Brendan McMahan, Gary Holt, David Sculley, Michael Young, Dietmar Ebner, Julian Grady, Lan Nie, Todd Phillips, Eugene Davydov, Daniel Golovin, et al. Ad click prediction: a view from the trenches. In *Proceedings of the 19th ACM SIGKDD international conference* on Knowledge discovery and data mining, pages 1222–1230, 2013. [58] Sean P Meyn and Richard L Tweedie. *Markov Chains and Stochastic Stability*. Springer London, 1993. [59] Stanislav Minsker. Geometric median and robust estimation in Banach spaces. *Bernoulli*, 21(4):2308 - 2335, 2015. [60] Alexander V Nazin, Arkadi S Nemirovsky, Alexandre B Tsybakov, and Anatoli B Juditsky. Algorithms of robust stochastic optimization based on mirror descent method. *Automation* and Remote Control, 80:1607–1627, 2019. [61] Alexander V Nazin, Boris T Polyak, and Alexandre B Tsybakov. Optimal and robust kernel algorithms for passive stochastic approximation. *IEEE Transactions on Information Theory*, 38(5):1577–1583, 1992. [62] Arkadi Nemirovski, Anatoli Juditsky, Guanghui Lan, and Alexander Shapiro. Robust stochastic approximation approach to stochastic programming. *SIAM Journal on Optimization*, 19(4):1574–1609, 2009. [63] Arkadij Semenovic Nemirovskij and David Borisovich Yudin. ˇ Problem Complexity and Method Efficiency in Optimization. A Wiley-Interscience publication. Wiley, 1983. [64] Yurii Nesterov. *Introductory Lectures on Convex Optimization: A Basic Course*. Springer Publishing Company, Incorporated, 1 edition, 2014. [65] Ta Duy Nguyen, Thien Hang Nguyen, Alina Ene, and Huy Le Nguyen. High probability convergence of clipped-SGD under heavy-tailed noise. *arXiv preprint arXiv:2302.05437*, 2023. [66] Ankit Pensia, Varun Jog, and Po-Ling Loh. Robust regression with covariate filtering: Heavy tails and adversarial contamination. *arXiv preprint arXiv:2009.12976*, 2020. [67] Boris Teodorovich Polyak and Yakov Zalmanovich Tsypkin. Adaptive estimation algorithms: convergence, optimality, stability. *Automation and Remote Control*, 40(3):378–389, 1979. [68] Boris Teodorovich Polyak and Yakov Zalmanovich Tsypkin. Robust pseudogradient adaptation algorithms. *Automation and Remote Control*, 41(10):1404–1409, 1981. [69] Adarsh Prasad, Sivaraman Balakrishnan, and Pradeep Ravikumar. A robust univariate mean estimator is all you need. In *International Conference on Artificial Intelligence and Statistics*, pages 4034–4044. PMLR, 2020. [70] Adarsh Prasad, Arun Sai Suggala, Sivaraman Balakrishnan, and Pradeep Ravikumar. Robust estimation via robust gradient estimation. *Journal of the Royal Statistical Society: Series B* (Statistical Methodology), 82, 2018. [71] E Price and V VandeLinde. Robust estimation using the robbins-monro stochastic approximation algorithm. *IEEE Transactions on Information Theory*, 25(6):698–704, 1979. [72] Herbert Robbins and Sutton Monro. A stochastic approximation method. *The Annals of* Mathematical Statistics, pages 400–407, 1951. [73] Gareth O Roberts and Richard L Tweedie. Rates of convergence of stochastically monotone and continuous time Markov models. *Journal of Applied Probability*, 37(2):359–373, 2000. [74] Byron Roe. MiniBooNE particle identification. UCI Machine Learning Repository, 2010. DOI: https://doi.org/10.24432/C5QC87. [75] Thomas J. Rothenberg, Franklin M. Fisher, and C. B. Tilanus. A note on estimation from a cauchy sample. *Journal of the American Statistical Association*, 59(306):460–463, 1964. [76] Peter J Rousseeuw and Mia Hubert. Robust statistics for outlier detection. *Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery*, 1(1):73–79, 2011. [77] Abdurakhmon Sadiev, Marina Danilova, Eduard Gorbunov, Samuel Horvath, Gauthier Gidel, ´ Pavel Dvurechensky, Alexander Gasnikov, and Peter Richtarik. High-probability bounds for ´ stochastic optimization and variational inequalities: the case of unbounded variance. In International Conference on Machine Learning, pages 29563–29648. PMLR, 2023. [78] Prem Seetharaman, Gordon Wichern, Bryan Pardo, and Jonathan Le Roux. Autoclip: Adaptive gradient clipping for source separation networks. In *2020 IEEE 30th International Workshop on Machine Learning for Signal Processing (MLSP)*, pages 1–6. IEEE, 2020. [79] Shai Shalev-Shwartz, Yoram Singer, and Nathan Srebro. Pegasos: Primal estimated subgradient solver for svm. In Proceedings of the 24th International Conference on Machine Learning, pages 807–814, 2007. [80] Srdjan S Stankovic and Branko D Kova ´ cevi ˇ c. Analysis of robust stochastic approximation ´ algorithms for process identification. *Automatica*, 22(4):483–488, 1986. [81] Che-Ping Tsai, Adarsh Prasad, Sivaraman Balakrishnan, and Pradeep Ravikumar. Heavytailed streaming statistical estimation. In *International Conference on Artificial Intelligence* and Statistics, pages 1251–1282. PMLR, 2022. [82] John Wilder Tukey. A survey of sampling from contaminated distributions. Contributions to Probability and Statistics, pages 448–485, 1960. [83] Andrew V Uzilov, Joshua M Keegan, and David H Mathews. Detection of non-coding rnas on the basis of predicted secondary structure formation free energy change. *BMC bioinformatics*, 7(1):1–30, 2006. [84] Roman Vershynin. *High-Dimensional Probability: An Introduction with Applications in* Data Science, volume 47. Cambridge university press, 2018. [85] Nuri Mert Vural, Lu Yu, Krishna Balasubramanian, Stanislav Volgushev, and Murat A Erdogdu. Mirror descent strikes again: Optimal stochastic convex optimization under infinite noise variance. In *Conference on Learning Theory*, pages 65–102. PMLR, 2022. [86] Lu Yu, Krishnakumar Balasubramanian, Stanislav Volgushev, and Murat A Erdogdu. An analysis of constant step size SGD in the non-convex regime: Asymptotic normality and bias. *Advances in Neural Information Processing Systems*, 34:4234–4248, 2021. [87] Jingzhao Zhang, Sai Praneeth Karimireddy, Andreas Veit, Seungyeon Kim, Sashank Reddi, Sanjiv Kumar, and Suvrit Sra. Why are adaptive methods good for attention models? *Advances in Neural Information Processing Systems*, 33:15383–15393, 2020. [88] Tong Zhang. Solving large scale linear prediction problems using stochastic gradient descent algorithms. In Proceedings of the Twenty-First International Conference on Machine Learning, page 116, 2004.
Review 1: Summary: The work proposes a new variant of clipped SGD with the choice of clipping threshold based on quantiles of stochastic gradients. The convergence of this algorithm in distribution is studied for strongly convex and non-convex problems. Numerical results complement the study. Strengths and Weaknesses: **Strengths:** Theoretical claims in this paper look solid. The proofs in the appendix are easy to follow except for some minor issues described below. **Weaknesses:** The proposed quantile clipping is an interesting algorithm. However, the motivation for its use (compared to the standard clipping) remains unclear to me. I could not find any theoretical justification, how does it compare in theory to standard clipped SGD? Main issue: Quantiles are not computable (since the distribution is unknown) and can be hard to estimate under heavy tailed noise. Authors say in introduction that QC-SGD can be implemented using rolling quantiles, but when it comes to section 5 it turns out that Algorithm 2 is actually a different algorithm. There is no proof that it implements exactly the rule (2) that is analyzed in theory. Requested Changes: 1. [62] and [30] do not require sub-Gaussian assumption. 2. Before [85], NY in [63] already showed how to handle heavy tailed noise by changing the mirror map. 3. "initial evidence of the robustness of clipped SGD to heavy tails was given by [87]". 4. Part 1 of Lemma 2 controls the bias of uncorrupted stochastic gradients and looks standard for for gradient clipping analysis. Perhaps adding some references would be appropriate. Same applies to Lemma 1 if it appeared in prior work. 5. Why the definition of the transition kernel is different on page 4 and on page 24. The most confusing thing for me is that on page 4 and in the discussion on 25, the transition kernel has the event A as an argument, but in the definition on page 24, it does not have it. 6. To make the paper self-contained it's better to add some formulations from [58], for instance, in the end of the proof of Theorem 1 on page 26, some condition (iii) from [58] is referenced but not stated. Definition of petit set is not given, is it even relevant for the proof? 7. How does (25) imply the result of Theorem 1? Where the measure $\pi_{\beta, p}$ is defined? 8. A better title for section 4 is perhaps "Non-convex objectives" because results of section 3 are also for smooth functions. Broader Impact Concerns: n/a ================================================== Review 2: Summary: The paper addresses the problem of stochastic optimization under a modified heavy tails assumption on gradient estimates, with potential probabilistic corruptions of the samples. The authors propose a method based on SGD with a clipping threshold selected according to the quantiles of stochastic gradient norms. They provide several theoretical results on the convergence of the iterates' "distribution" and the deviation of the stationary measure samples from the optimum for both strongly convex and non-convex cases. Finally, a more practical algorithm variation is introduced and tested on various synthetic and small machine learning problems. Strengths and Weaknesses: ## Strengths - The paper tackles a relatively unexplored problem. - It introduces “in distribution” convergence, which appears novel for this family of methods. - The authors provide rigorous theoretical analysis. - Extensive numerical experiments comparing the performance to baselines are presented. ## Weaknesses - The introduction section lacks practical motivation. Why are the results important and interesting in the specific context of streaming stochastic optimization with heavy tails and outliers? - The paper's presentation and theoretical results are not very clear. Next, I structure my comments and questions according to the sections. ### Section 2 In my opinion, Assumptions 3-5 need a more detailed discussion. How realistic are these assumptions? Are they introduced for the first time, or are they standard in the literature? Are there any other analogs or alternatives? Are these conditions technical and introduced to make the proof work, or do they naturally hold in some applications that motivate the work? This section seems to lack references to prior works that may have relied on some of the assumptions. Assumption 4 seems unusual in representing the error’s distribution as a linear combination. What is \(\theta\)? Is it a parametrization of the density? - What do the subscripts $\mathcal{I}$ and $\mathcal{O}$ for $\mathcal{D}$ denote or refer to? - It is unclear why Assumptions 4 and 5 are separated, as both seem to impose conditions on the stochastic gradient error. - The part on the total variation (TV) norm lacks references. Perhaps I am not an expert in this area. What is $f$ in the integral definition, and what are the necessary assumptions on it? Why was this particular measure chosen? ### Section 3 - Can the result of Theorem 1 hold for an arbitrary quantile, or does it need to be specifically chosen based on the generally unknown corruption rate $\eta$? - The conditions on $\kappa$ and step size $\beta$ are unclear and hard to interpret. The bound on the corruption rate $\eta$ seems very restrictive concerning the condition number of the problem $\mu/L$, as the latter can be extremely small. - How restrictive is the condition (7)? How does it compare to LMC/SGD without clipping? In general, it seems the paper could benefit from more comparisons like this. - The discussion after Proposition 1 mentions “poor dimension dependence through $B_q$”. Why is it poor, and why is this the case? It mentions the choice $q=\log(1/\eta)$. Why do you have a choice of $q$ if it is part of the assumption? The restriction on the set $\Theta$ is quite restrictive. - Why are the concentration properties given by Proposition 2 called “strong”? - The formatting of Algorithm 1 could be improved. It is not very clear. I suggest adding a verbal description. What does the notation $r^{(i)}_{N/2}$ mean? Maybe I missed the definition. There is an extra break in the input description. - The end of Section 3 mentions that > [28] results enjoy better dimension dependence but are less general than ours. How much more general is this analysis compared to prior works? ### Section 4 Why does Theorem 2 require the objective to be positive? Condition (13) looks quite obscure and hard to interpret. Can it be simplified? ### Section 5 The statement that > In the non-strongly convex case, a constant threshold can be used since the gradient is a priori uniformly bounded Does not seem correct, as a non-strongly convex quadratic function may not have a bounded gradient. How does Algorithm 2 compare to adaptive clipping [1]? The *linear regression* paragraph states that > These thresholds provide a rough estimate of the gradient norm. The "gradient norm" computed at which point? ### Minor Comments - The template used is different from the official one suggested by TMLR. - The table of contents in the PDF is absent. The links (to equations and references) starting from the second page are not working properly. Combined with the split into the main paper and supplementary material, this makes the paper very inconvenient to read and review. I recommend attaching the full paper as supplementary material on OpenReview. ___ [1] Andrew, Galen, et al. "Differentially private learning with adaptive clipping." Advances in Neural Information Processing Systems 34 (2021). Requested Changes: 1. Elaborate on the realism and literature precedent of Assumptions 3-5 to justify their inclusion. 2. Correct the PDF's non-functional links, absence of a table of contents, and alignment with TMLR formatting guidelines. 3. Improve the presentation and clarity by addressing the weaknesses comments. Broader Impact Concerns: No, for this work ================================================== Review 3: Summary: This paper introduces a gradient quantile clipping strategy for SGD (QC-SGD) in the setting of streaming stochastic optimization with data corruption. The contributions include: 1. Gives the result of convergence in distribution of the Markov Chain by SGD with constant step size: For both strongly convex and non-convex objective, with well chosen clipping quantile $p$, QC-SGD allows to combine both fast convergence and optimal dependence on corruption parameter $\eta$. 2. Proposes a rolling quantile procedure for the quantile estimation and confirm its robustness by numerical experiments on three stochastic optimization tasks. Strengths and Weaknesses: Strengths: 1. The paper introduces gradient quantile clipping at the first time to the best of my knowledge, and provide sound theoretical guarantee for it robustness to corruptions in the data stream. 2. The paper also provide a rolling quantile procedure for simple implementation and shows its performance through numerical experiments. Weaknesses: 1. It is mentioned in this paper several times that another work [28] (which also proposes algorithms for data corruption robust streaming estimation) is difficult to implement and compare, could the authors provide more detailed reasons about this? 2. The high probability bound given in Corollary 2 is still weaker than the results in [28] due to stronger dimension dependence, could the authors provide potential improvement on current procedure (Algorithm 1)? And could the general results be further improved for specific linear and logistic regression to achieve the similar bounds with [28]? 3. The authors' main argument that the proposed algorithm is better than [28] is that it is easy to implement without dependence on a number of unknown constants. However, it is still not clear to me how to choose $p$ in the implementation of specific tasks, which is an essential parameter for the convergence of the proposed algorithm as stated in Theorem 1 and Theorem 2. Requested Changes: 1. Add more comparisons with [28] as above. 2. Add some details about how to choose $p$. Broader Impact Concerns: No broader impact is discussed. ==================================================
# Dr-Dsgd: A Distributionally Robust Decentralized Learning Algorithm Over Graphs Chaouki Ben Issaid *chaouki.benissaid@oulu.fi* Centre for Wireless Communications University of Oulu, Finland Anis Elgabli *anis.elgabli@oulu.fi* Centre for Wireless Communications University of Oulu, Finland Mehdi Bennis *mehdi.bennis@oulu.fi* Centre for Wireless Communications University of Oulu, Finland Reviewed on OpenReview: *https: // openreview. net/ forum? id= VcXNAr5Rur* ## Abstract In this paper, we propose to solve a regularized distributionally robust learning problem in the decentralized setting, taking into account the data distribution shift. By adding a Kullback-Liebler regularization function to the robust min-max optimization problem, the learning problem can be reduced to a modified robust minimization problem and solved efficiently. Leveraging the newly formulated optimization problem, we propose a robust version of Decentralized Stochastic Gradient Descent (DSGD), coined Distributionally Robust Decentralized Stochastic Gradient Descent (DR-DSGD). Under some mild assumptions and provided that the regularization parameter is larger than one, we theoretically prove that DR-DSGD achieves a convergence rate of O 1/ √KT + K/T, where K is the number of devices and T is the number of iterations. Simulation results show that our proposed algorithm can improve the worst distribution test accuracy by up to 10%. Moreover, DR-DSGD is more communication-efficient than DSGD since it requires fewer communication rounds (up to 20 times less) to achieve the same worst distribution test accuracy target. Furthermore, the conducted experiments reveal that DR-DSGD results in a fairer performance across devices in terms of test accuracy. ## 1 Introduction Federated learning (FL) is a learning framework that allows the training of a model across multiple devices under the orchestration of a parameter server (PS). Unlike the traditional way of training ML models, where the individual data of the devices are shared with the PS, FL hides the raw data, so it can significantly reduce the communication cost. When combined with a privacy-preservation mechanism, it further ensures privacy. Training using FedAvg presents several challenges that need to be tackled. It often fails to address the data heterogeneity issue. Though many enhanced variants of federated averaging (FedAvg) (Li et al., 2020b; Liang et al., 2019; Karimireddy et al., 2020b;a; Wang et al., 2020; Mitra et al., 2021; Horváth et al., 2022) were proposed to solve this issue in the mean risk minimization setting, local data distributions might differ greatly from the average distribution. Therefore, a considerable drop in the global model performance on local data is seen, suggesting that the mean risk minimization may not be the right objective. Another major issue in FL is fairness. In many cases, the resultant learning models are biased or unfair in the sense that they discriminate against certain device groups (Hardt et al., 2016). Finally, FL relies on the existence of a PS to collect and distribute model parameters, which is not always feasible or even accessible to devices that are located far away. Even though several FL algorithms (Kairouz et al., 2021; Yang et al., 2019; Li et al., 2020a) have been proposed for the distributed learning problem, FedAvg-style methods (McMahan et al., 2017; Li et al., 2020b; Wang et al., 2020) remain the state-of-the-art algorithm. Specifically, FedAvg entails performing one or multiple local iterations at each device before communicating with the PS, which in turn performs periodic averaging. However, because FedAvg is based on the empirical risk minimization (ERM) to solve the distributed learning problem, i.e. FedAvg minimizes the empirical distribution of the local losses, its performance deteriorates when the local data are distributed non-identically across devices. While the ERM formulation assumes that all local data come from the same distribution, local data distributions might significantly diverge from the average distribution. As a result, even though the global model has a good average test accuracy, its performance locally drops when the local data are heterogeneous. In fact, increasing the diversity of local data distributions has been shown to reduce the generalization ability of the global model derived by solving the distributed learning problem using FedAvg (Li et al., 2020e;c; Zhao et al., 2018). While there are many definitions of robustness, the focus of our work is on distributionally robustness, that is, being robust to the distribution shift of the local data distributions. We consider a distributionally robust learning perspective by seeking the best solution for the worst-case distribution. Another key focus of this work is to investigate the fairness of the performance across the different devices participating in the learning. Fairness aims to reduce the difference in performance on the local datasets to ensure that the model performance is uniform across the devices participating in the learning process. In the FL context, achieving fair performance among devices is a critical challenge. In fact, existing techniques in FL, such as FedAvg (McMahan et al., 2017) lead to non-uniform performance across the network, especially for large networks, since they favour or hurt the model performance on certain devices. While the average performance is high, these techniques do not ensure a uniform performance across devices. PS-based learning (star topology) incurs a significant bottleneck in terms of communication latency, scalability, bandwidth, and fault tolerance. Decentralized topologies circumvent these limitations and hence have significantly greater scalability to larger datasets and systems. In fact, while the communication cost increases with the number of devices in the PS-based topology, it is generally constant (in a ring or torus topology), or a slowly increasing function in the number of devices since decentralizing learning only requires on-device computation and local communication with neighboring devices without the need of a PS. Several works investigated the decentralizing learning problem (Yuan et al., 2016; Zeng & Yin, 2018; Wang et al., 2019; Wei & Ozdaglar, 2012; Shi et al., 2014; Ben Issaid et al., 2021; Duchi et al., 2011); however, while interesting none of these works has considered solving the decentralized learning problem in a distributionally robust manner. Summary of Contributions. The main contributions of this paper are summarized as follows - We propose a **distributionally robust learning algorithm**, dubbed Distributionally Robust Decentralized Stochastic Gradient Descent (DR-DSGD), that solves the learning problem in a decentralized manner while being robust to data distribution shift. To the best of our knowledge, our framework is the first to solve the regularized distributionally robust optimization problem in a decentralized topology. - Under some mild assumptions and provided that the regularization parameter is larger than one, we prove that DR-DSGD achieves a fast convergence rate of O √ 1 KT + K T , where K is the number of devices and T is the number of iterations, as shown in Corollary 1. Note that, unlike existing FL frameworks that rely on the **unbiasedness** of the stochastic gradients, our analysis is more challenging and different from the traditional analyses for decentralized SGD since it involves **biased** stochastic gradients stemming from the compositional nature of the reformulated loss function. - We demonstrate the robustness of our approach compared to vanilla decentralized SGD via numerical simulations. It is shown that DR-DSGD leads to an improvement of up to 10% in the worst distribution test accuracy while achieving a reduction of up to 20 times less in terms of communication rounds. - Furthermore, we show by simulations that DR-DSGD leads to a fairer performance across devices in terms of test accuracy. In fact, our proposed algorithm reduces the variance of test accuracies across all devices by up to 60% while maintaining the same average accuracy. Paper Organization. The remainder of this paper is organized as follows. In Section 3, we briefly describe the problem formulation and show the difference between the ERM and distributionally robust optimization (DRO) formulation. Then, we present our proposed framework, *DR-DSGD*, for solving the decentralized learning problem in a distributionally robust manner in Section 4. In Section 5, we prove the convergence of DR-DSGD theoretically under some mild conditions. Section 6 validates the performance of DR-DSGD by simulations and shows the robustness of our proposed approach compared to DSGD. Finally, the paper concludes with some final remarks in Section 7. The details of the proofs of our results are deferred to the appendices. ## 2 Related Works Robust Federated Learning. Recent robust FL algorithms (Mohri et al., 2019; Reisizadeh et al., 2020; Deng et al., 2020; Hamer et al., 2020) have been proposed for the learning problem in the PS-based topology. Instead of minimizing the loss with respect to the average distribution among the data distributions from local clients, the authors in (Mohri et al., 2019) proposed agnostic federated learning (AFL), which optimizes the global model for a target distribution formed by any mixture of the devices' distributions. Specifically, AFL casts the FL problem into a min-max optimization problem and finds the worst loss over all possible convex combinations of the devices' distributions. Reisizadeh et al. (2020) proposed FedRobust, a variant of local stochastic gradient descent ascent (SGDA), aiming to learn a model for the worst-case affine shift by assuming that a device's data distribution is an affine transformation of a global one. However, FedRobust requires each client to have enough data to estimate the local worst-case shift; otherwise, the global model performance on the worst distribution deteriorates. The authors in (Deng et al., 2020) proposed a distributionally robust federated averaging (DRFA) algorithm with reduced communication. Instead of using the ERM formulation, the authors adopt a DRO objective by formulating a distributed learning problem to minimize a distributionally robust empirical loss, while periodically averaging the local models as done in FedAvg (McMahan et al., 2017). Using the Bregman Divergence as the loss function, the authors in (Hamer et al., 2020) proposed FedBoost, a communication-efficient FL algorithm based on learning the optimal mixture weights on an ensemble of pre-trained models by communicating only a subset of the models to any device. The work of (Pillutla et al., 2019) tackles the problem of robustness to corrupted updates by applying robust aggregation based on the geometric median. Robustness to data and model poisoning attacks was also investigated by (Li et al., 2021b). DRO has been applied in multi-regional power systems to improve reliability by considering the uncertainty of wind power distributions and constructing a multi-objective function that maintains a trade-off between the operational cost and risk (Li & Yang, 2020; Hu et al., 2021). However, none of these works provides any convergence guarantees. Furthermore, our analysis is different from these works since it involves biased stochastic gradients. Fairness in Federated Learning. Recently, there has been a growing interest in developing FL algorithms that guarantee fairness across devices (Mohri et al., 2019; Li et al., 2020d; 2021a). Inspired by works in fair resource allocation for wireless networks, the authors in (Li et al., 2020d) proposed q-FFL, an FL algorithm that addresses fairness issues by minimizing an average reweighted loss parameterized by q. The proposed algorithm assigns larger weights to devices with higher losses to achieve a uniform performance across devices. Tilted empirical risk minimization (TERM), proposed in (Li et al., 2021a), has a similar goal as q-FFL, i.e. to achieve fairer accuracy distributions among devices while ensuring similar average performance. Decentralized Learning. Decentralized optimization finds applications in various areas including wireless sensor networks (Mihaylov et al., 2009; Avci et al., 2018; Soret et al., 2021), networked multi-agent systems (Inalhan et al., 2002; Ren et al., 2007; Johansson, 2008), as well as the area of smart grid implementations (Kekatos & Giannakis, 2012). Several popular algorithms based on gradient descent (Yuan et al., 2016; Zeng & Yin, 2018; Wang et al., 2019), alternating direction method of multipliers (ADMM) (Wei & Ozdaglar, 2012; Shi et al., 2014; Ben Issaid et al., 2021), or dual averaging (Duchi et al., 2011) have been proposed to tackle the decentralized learning problem. ## 3 Notations & Problem Formulation 3.1 Notations Throughout the whole paper, we use bold font for vectors and matrices. The notation ∇f stands for the gradient of the function f, and E[·] denotes the expectation operator. The symbols *∥ · ∥*, and *∥ · ∥*F denote the ℓ2-norm of a vector, and the Frobenius norm of a matrix, respectively. For a positive integer number n, we write [n] ≜ {1, 2*, . . . , n*}. The set of vectors of size K with all entries being positive is denoted by R K + . The notations 0 and 1 denote a vector with all entries equal to zero, or one, respectively (its size is to be understood from the context). Furthermore, we define the matrices: I the identity matrix and J = 1 K 11T. For a square matrix A, Tr(A) is the trace of A, i.e. the sum of elements on the main diagonal. Finally, for the limiting behavior of functions, f = O(g) means that f is bounded above up to a constant factor by g, asymptotically. ## 3.2 Problem Formulation We consider a connected network consisting of a set V of K devices. Each device i ∈ [K] has its data distribution Di supported on domain Ξi:= (Xi, Yi). The connectivity among devices is represented as an undirected connected communication graph G having the set *E ⊆ V × V* of edges, as illustrated in Fig. 1. The set of neighbors of device i is defined as Ni = {j|(i, j) *∈ E}* whose cardinality is |Ni| = di. Note that (i, j) ∈ E if and only if devices i and j are connected by a communication link; in other words, these devices can exchange information directly. All devices collaborate to solve the optimization problem given by $$\operatorname*{min}_{\mathbf{\Theta}\in\mathbb{R}^{d}}\sum_{i=1}^{K}{\frac{n_{i}}{n}}f_{i}(\mathbf{\Theta})\quad{\mathrm{where}}\quad f_{i}(\mathbf{\Theta})=\mathbb{E}_{\xi_{i}\sim\mathcal{D}_{i}}[\ell(\mathbf{\Theta};\xi_{i})],$$ where ξi:= (xi, yi) denotes the set of features xi and labels yi of device i. The function ℓ(Θ, ξi) is the cost of predicting yi from xi, where Θ denotes the model parameters, e.g., the weights/biases of a neural network. Here, ni denotes the number of training examples drawn from Di and n =PK i=1 niis the total number of examples. Without loss of generality, we assume in the remainder that all devices have the same number of samples, and therefore ni/n = 1/K, ∀i ∈ [K]. In this case, problem (1) writes as $$\operatorname*{min}_{\Theta\in\mathbb{R}^{d}}{\frac{1}{K}}\sum_{i=1}^{K}f_{i}(\Theta).$$ $$(1)$$ $$\left(2\right)$$ fi(Θ). (2) One way to solve (1) in a decentralized way is to use vanilla decentralized SGD (DSGD) (Yuan et al., 2016). As shown in Algorithm 1, each device in DSGD performs two steps: (i) a local stochastic gradient Algorithm 1 Vanilla Decentralized SGD (DSGD) 1: for t in 0, . . . , T − 1 do *in parallel for all devices* i ∈ [K] 2: Sample a mini-batch of size {ξ t j } B j=1, compute gradient gi(θ t i ) := 1B PB j=1 ∇ℓ(θ t i , ξt j ) 3: θ t+ 12 i:= θ t i − ηgi(θ t i ) 4: Send θ t+ 12 ito neighbors 5: θ t+1 i:= PK j=1 Wijθ t+ 12 j 6: **end for** ![4_image_0.png](4_image_0.png) Figure 1: Illustration of a graph topology (K = 8) and the interactions between the devices (D1 − D8). update (Line 3) using the learning rate η, and (ii) a consensus operation in which it averages its model with its neighbors' models (Lines 4-5) using the weights of the connectivity (mixing) matrix of the network W = [Wij ] ∈ R K×K. The mixing matrix W is often assumed to be a symmetric (W = WT) and doubly stochastic (W1 = 1, 1 TW = 1 T) matrix, such that Wij ∈ [0, 1], and if (i, j) ∈ E / , then Wij = 0. Assuming W to be symmetric and doubly stochastic is crucial to ensure that the devices achieve consensus in terms of converging to the same stationary point. While formulating problem (2), we assume that the target distribution is given by $$\overline{{{\mathcal{D}}}}=\frac{1}{K}\sum_{i=1}^{K}{\mathcal{D}}_{i}.$$ $$\text{(3)}$$. However, the heterogeneity of local data owned by the devices involved in the learning presents a significant challenge in the FL setting. In fact, models resulting from solving (2) lack robustness to distribution shifts and are vulnerable to adversarial attacks (Bhagoji et al., 2019). This is mainly due to the fact that the target distribution may be significantly different from D in practice. ## 4 Proposed Solution Our aim is to learn a global model Θ from heterogeneous data coming from these possibly non-identical data distributions of the devices in a decentralized manner. To account for heterogeneous data distribution across devices, the authors in (Mohri et al., 2019) proposed agnostic FL, where the target distribution is given by $${\cal D}_{\mathbf{\lambda}}=\sum_{i=1}^{K}\lambda_{i}{\cal D}_{i},\tag{1}$$ $$\mathbf{\Sigma}$$ where the weighting vector λ belongs to the K-dimensional simplex, ∆ = {λ = (λ1*, . . . , λ*K) T ∈ R K + : PK i=1 λi = 1}. Note that this target distribution is more general than D and it reduces to D when λi = 1/K, ∀i ∈ [K]. Unlike D which gives equal weight to all distributions {Di} K i=1 during training, Dλ is rather a mixture of devices' distributions, where the unknown mixture weight λ is learned during training and not known a priori. In this case, the distributionally robust empirical loss problem is given by the following min-max optimization problem $$\operatorname*{min}_{\Theta\in\mathbb{R}^{d}}\operatorname*{max}_{\lambda\in\Delta}\sum_{i=1}^{K}\lambda_{i}f_{i}(\Theta).$$ $\left(5\right)$. λifi(Θ). (5) Algorithm 2 Distributionally Robust Decentralized SGD (DR-DSGD) 1: for t in 0, . . . , T − 1 do *in parallel for all devices* i ∈ [K] 2: Sample a mini-batch of size {ξ t j } B j=1, compute the gradient gi(θ t i ) := 1B PB j=1 ∇ℓ(θ t i , ξt j ) and h(θ t i ; µ) := exp 1B PB j=1 ℓ(θ t i , ξt j )/µ 3: θ t+ 12 i:= θ t i − η × hi(θ t i ;µ) µ× gi(θ t i ) 4: Send θ t+ 12 ito neighbors $53\frac{1}{2}$ 6: . 5: θ t+1 i:= PK j=1 Wijθ t+ 12 j 6: **end for** Although several distributed algorithms (Mohri et al., 2019; Reisizadeh et al., 2020; Deng et al., 2020; Hamer et al., 2020) have been proposed for (5), solving it in a decentralized fashion (in the absence of a PS) is a challenging task. Interestingly, when introducing a regularization term in (5) and by appropriately choosing the regularization function, the min-max optimization problem can be reduced to a robust minimization problem that can be solved in a decentralized manner, as shown later on. Specifically, the regularized version of problem (5) can be written as follows $$\operatorname*{min}_{\Theta\in\mathbb{R}^{d}}\operatorname*{max}_{\lambda\in\Delta}\sum_{i=1}^{K}\lambda_{i}f_{i}(\Theta)-\mu\phi(\lambda,1/K),$$ $$(6)$$ where µ > 0 is a regularization parameter, and ϕ(λ, 1/K) is a divergence measure between {λi} K i=1 and the uniform probability that assigns the same weight 1/K to every device's distribution. The function ϕ can be seen as a penalty that ensures that the weight λiis not far away from 1/K. Note that µ → 0 gives the distributionally robust problem (5) while when µ → ∞, we recover the standard empirical risk minimization problem (2). Although different choices of the ϕ-divergence can be considered in (6), the robust optimization community has been particularly interested in the Kullback–Leibler (KL) divergence owing to its simplified formulation (Esfahani & Kuhn, 2018). In fact, when we consider the KL divergence, i.e. ϕ(λ, 1/K) = PK i=1 λilog(λiK), then by exactly maximizing over λ ∈ ∆, the min-max problem, given in (6), is shown to be equivalent to (Huang et al., 2021, Lemma 1) $$\operatorname*{min}_{\Theta\in\mathbb{R}^{d}}\mu\log\left({\frac{1}{K}}\sum_{i=1}^{K}\exp\left(f_{i}(\Theta)/\mu\right)\right).$$ Since log(·) is a monotonically increasing function, then instead of solving (7), we simply solve the following problem $$\operatorname*{min}_{\Theta\in\mathbb{R}^{d}}F(\Theta)\triangleq{\frac{1}{K}}\sum_{i=1}^{K}F_{i}(\Theta),$$ $$\left(7\right)$$ $$({\mathfrak{s}})$$ Fi(Θ), (8) where Fi(Θ) = exp fi(Θ)/µ, ∀i ∈ [K]. Remark 1. Note that problem (6) is equivalent to problem (5) as µ → 0*. The proximity of the solutions* of (6) to (5) in the **convex** *case is discussed in Appendix A.2. In the remainder of this work, we focus* on solving the regularized distributional robust optimization problem (Mohri et al., 2019; Deng et al., 2020) given in (6). Although any decentralized learning algorithm can be used to solve (8), the focus of this paper is to propose a distributionally robust implementation of DSGD. Our framework, coined Distributionally Robust Decentralized SGD (DR-DSGD), follows similar steps as DSGD with the main difference in the local update step $$\mathbf{\theta}_{i}^{t+1}=\sum_{i=1}^{K}W_{i j}\left(\mathbf{\theta}_{i}^{t}-{\frac{\eta}{\mu}}h(\mathbf{\theta}_{i}^{t};\mu)\mathbf{g}_{i}(\mathbf{\theta}_{i}^{t})\right),$$ , (9) $\left(9\right)$. where h(θ t i ; µ) := exp 1B PB j=1 ℓ(θ t i , ξt j )/µand B is the mini-batch size {ξ t j } B j=1. Introducing the term h(θ t i ; µ)/µ in line 3 of Algorithm 2 makes the algorithm more robust to the heterogeneous setting and ensures fairness across devices, as will be shown in the numerical simulations section. ## 5 Convergence Analysis This section provides a theoretical analysis of the convergence rate of the DR-DSGD algorithm. Before stating the main results of the paper, we make the following assumptions. Assumption 1. (Smoothness) There exist constants LF and L1, such that ∀θ1, θ2 ∈ R d, we have $\|\nabla F(\mathbf{\theta_{1}})-\nabla F(\mathbf{\theta_{2}})\|\leq L_{F}\|\mathbf{\theta_{1}}-\mathbf{\theta_{2}}\|,$ $\mathbb{E}[\|\mathbf{g_{i}}(\mathbf{\theta_{1}})-\mathbf{g_{i}}(\mathbf{\theta_{2}})\|]\leq L_{1}\|\mathbf{\theta_{1}}-\mathbf{\theta_{2}}\|.$ Assumption 2. (Gradient Boundedness) The gradient of fi(·) is bounded, i.e. there exits G1 such that ∀θ ∈ R d, we have $$\begin{array}{l}{(10)}\\ {(11)}\end{array}$$ $$\|\nabla f_{i}(\theta)\|\leq G_{1}.$$ $$(12)$$ $$\begin{array}{l}{(13)}\\ {(14)}\end{array}$$ ∥∇fi(θ)∥ ≤ G1. (12) Assumption 3. (Variance Boundedness) The variances of stochastic gradient gi(·) and the function li(·, ξ) are bounded, i.e. there exit positive scalars σ1 and σ2 such that ∀θ ∈ R d, we have $$\mathbb{E}\left[|\ell(\mathbf{\theta},\xi_{i})-f_{i}(\mathbf{\theta})|^{2}\right]\leq\sigma_{1}^{2},\tag{1}$$ $$\mathbb{E}\left[\|\mathbf{g}_{i}(\mathbf{\theta})-\nabla f_{i}(\mathbf{\theta})\|^{2}\right]\leq\sigma_{2}^{2}.$$ Assumption 4. (Function Boundedness) The function F(·) is lower bounded, i.e. Finf = inf θ∈Rd F(θ) such that Finf > −∞ and the functions ℓ(·, ξi) are bounded, i.e. there exists M > 0 such that ∀θ ∈ R d, we have $$\mathbb{E}\left[|\ell(\theta,\xi_{i})|\right]\leq M.$$ $$(15)$$ E [|ℓ(*θ, ξ*i)|] ≤ M. (15) Assumption 5. (Spectral Norm) The spectral norm, defined as ρ = ∥E-WTW− J∥, is assumed to be less than 1. Assumptions 1-5 are key assumptions that are often used in the context of distributed and compositional optimization (Wang et al., 2016; 2017; Li et al., 2020e; Huang et al., 2021). Note that (15) can be fulfilled by imposing loss clipping (Xu et al., 2006; Wu & Liu, 2007; Yang et al., 2010) to most commonly-used loss functions. Furthermore, although the categorical cross-entropy function is not bounded upwards, it will only take on large values if the predictions are wrong. In fact, under some mild assumptions, the categorical crossentropy will be around the entropy of a M-class uniform distribution, which is log(M) (refer to Appendix A.1 for a more in-depth discussion). Considering a relatively moderate number of classes, e.g., M = 100, we get log(M) < 5. Thus, the cross-entropy will generally be relatively small in practice, and the assumption will hold in practice. Remark 2. *It is worth mentioning that since the exponential function is convex, and non-decreasing function, then* {exp(fi(·))} K i=1 *is convex when* {fi(·)} K i=1 *is convex. In this case, the convergence of the proposed* method follows directly from existing results in the literature (Yuan et al., 2016). In the remainder of this section, we focus on the non-convex setting and we start by introducing the following matrices $$\mathbf{\theta}^{t}=\left[\mathbf{\theta}_{1}^{t},\ldots,\mathbf{\theta}_{K}^{t}\right],$$ $$\nabla\mathbf{F}^{t}=\left[\nabla\mathbf{F}_{1}(\mathbf{\theta}_{1}^{t}),\ldots,\nabla\mathbf{F}_{K}(\mathbf{\theta}_{K}^{t})\right],$$ $$\mathbf{U}^{t}=\frac{1}{\mu}\left[h(\mathbf{\theta}_{1}^{t};\mu)\mathbf{g}_{1}(\mathbf{\theta}_{1}^{t}),\ldots,h(\mathbf{\theta}_{K}^{t};\mu)\mathbf{g}_{K}(\mathbf{\theta}_{K}^{t})\right].\tag{1}$$ 7 Remark 3. In the non-convex case, the convergence analysis is more challenging than in the case of DSGD. In fact, due to the compositional nature of the local loss functions, the stochastic gradients are biased, i.e. $$\mathbb{E}\left[\exp\left(\ell(\mathbf{\theta}_{i}^{t},\xi_{i}^{t})/\mu\right)\mathbf{g}_{i}(\mathbf{\theta}_{i}^{t})\right]\neq\exp\left(f_{i}(\mathbf{\theta}_{i}^{t})/\mu\right)\nabla f_{i}(\mathbf{\theta}_{i}^{t}).$$ ). (19) To proceed with the analysis, we start by writing the matrix form of the update rule (9) as $$(19)$$ θ t+1 =θ $$=\left(\theta^{t}-\eta U^{t}\right)W.$$ $$\mathbf{v}=\mathbf{v}$$ tW. (20) Multiplying both sides of the update rule (20) by 1/K, we get $$(20)$$ $$\bar{\theta}^{t+1}=\bar{\theta}^{t}-\frac{\eta}{K}U^{t}{\bf1},$$ $$(21)$$ $$(22)$$ $$\square$$ t1, (21) where θ¯tis the averaged iterate across devices defined as θ¯t =1K PK i=1 θ t i . Now, we are in a position to introduce our first Lemma. Lemma 1. *For any matrix* A ∈ R d×K*, we have* $$\mathbb{E}\left[\|\mathbf{A}\left(\mathbf{W}^{n}-\mathbf{J}\right)\|_{F}^{2}\right]\leq\rho^{n}\|\mathbf{A}\|_{F}^{2}.\tag{1}$$ F . (22) Proof. The details of the proof can be found in Appendix A.4. The following lemma provides some of the inequalities that we need for the proof of the main result. Lemma 2. *From Assumption 4, we have that* (a) There exists a constant L2(µ) *such that* ∀y1, y2 ∈ Y*, we have* $$t\;\forall y_{1},y_{2}\in$$ $$\mathbb{E}[|\exp\left(y_{1}\right)-\exp\left(y_{2}\right)|]\leq L_{2}(\mu)|y_{1}-y_{2}|,\tag{1}$$ where Y ≜ {y = ℓ(θ, ξi)/µ *such that* θ ∈ R d} is the range of functions {ℓ(θ, ξi)/µ}. (b) There exists a constant G2(µ) *such that* ∀θ ∈ R d*, we have* $$(23)$$ $$\mathbb{E}[|\exp(\ell(\theta,\xi_{i})/\mu)|]\leq G_{2}(\mu).$$ $$(24)$$ $$(25)$$ $\square$ E[| exp(ℓ(θ, ξi)/µ)|] ≤ G2(µ). (24) (c) There exists a constant σ3(µ) *such that* ∀θ ∈ R d*, we have* $$\mathbb{E}\left[|\exp(\ell(\mathbf{\theta},\xi_{i})/\mu)-\exp(f_{i}(\mathbf{\theta})/\mu)|^{2}\right]\leq(\sigma_{3}(\mu))^{2}.$$ Proof. The details of the proof can be found in Appendix A.5. Using Lemmas 1 and 2, we can now state Lemma 3, which gives an upper bound on the discrepancies among the local models. Lemma 3. Let η *satisfy* ηLµ < µ(1− √ρ) 4Gµ √ρ . Provided that all local models are initiated at the same point, the discrepancies among the local models E-∥θ t(I−J)∥ 2 F *can be upper bounded by* $$\frac{1}{KT}\sum_{t=1}^{T}\mathbb{E}\left[\|\mathbf{\theta}^{t}(\mathbf{I}-\mathbf{J})\|_{F}^{2}\right]\leq\frac{2\eta^{2}\rho G_{\mu}^{2}[8\sigma_{\mu}^{2}(L_{\mu}^{2}+1)+G_{\mu}^{2}]}{\mu^{2}(1-\gamma_{\mu})(1-\sqrt{\rho})^{2}},\tag{26}$$ where σµ = max{σ1, σ2, σ3(µ)}, Gµ = max{G1, G2(µ)}, Lµ = max{LF , L1, L2(µ)}*, and* γµ = 16η 2ρL2µG2µ µ2(1− √ρ) 2 . Proof. The proof is deferred to Appendix A.6. In a nutshell, the proof uses the update rule of DR-DSGD, given in (20), the special property of the mixing matrix, and Lemma 1. Next, we present the main theorem that states the convergence of our proposed algorithm. Theorem 1. Let η *satisfy* ηLµ < min{ µ(1− √ρ) 8Gµ √ρ , 1} and provided that all local models are initiated at the same point, then the averaged gradient norm is upper bounded as follows $$\frac{1}{T}\sum_{t=1}^{T}\mathbb{E}\left[\|\nabla F(\mathbf{\theta}^{i})\|^{2}\right]\leq\frac{2(F(\mathbf{\theta}^{1})-F_{in,f})}{\eta T}+\frac{2G_{\mu}^{2}\sigma_{\mu}^{2}(L_{\mu}^{2}+\mu^{2})}{\mu^{4}B}+\frac{16\eta\eta^{2}L_{\mu}^{2}G_{\mu}^{2}(G_{\mu}^{2}+\mu^{2})[8\sigma_{\mu}^{2}(L_{\mu}^{2}+1)+G_{\mu}^{2}]}{3\mu^{8}(1-\sqrt{\rho})^{2}}.\tag{27}$$ Appendix A.7. $$\square$$ Proof. The proof of Theorem 1 is detailed in Appendix A.7. The first term of the right-hand side of (27) is neither affected by the graph parameters nor by the regularization parameter µ and it exhibits a linear speedup in T. This term exists also in the convergence analysis of DSGD (Wang et al., 2019; Lian et al., 2017). The graph topology affects the third term via the value of the spectral norm ρ. In fact, a smaller value of ρ makes the third term smaller. Finally, the regularization parameter µ has an impact on both the second and third terms. A weakness of the derived bound is that as µ gets smaller, both the second and third terms grow larger. In the limit case, when µ → 0, both terms grow to infinity. In the next corollary, we limit ourselves to the case when µ ≥ 1 and show that under this setting DR-DSGD is guaranteed to converge. Remark 4. *Our analysis is still valid in the case where the mixing matrix changes at every iteration. Similar* theoretical guarantees hold provided that the matrices {Wt} T t=1 *are independent and identically distributed* and their spectral norm ρ t < 1. When µ ≥ 1, it can be seen from the proof of Lemma 2, that we can find constants, L2, G2, and σ3, that do not depend on µ. In this case, (27) can be written as $\tau$ input in $\hat{\mathbf{\theta}}$, in the case, ($\hat{\mathbf{\theta}}$) can be written as $$\frac{1}{T}\sum_{t=1}^{T}\mathbb{E}\left[||\nabla F(\hat{\mathbf{\theta}}^{\prime})||^{2}\right]\leq\frac{2(F(\hat{\mathbf{\theta}}^{\prime})-F_{nn}f)}{\eta T}+\frac{2G^{2}\sigma^{2}(L^{2}+1)}{B}+\frac{16\eta\eta^{2}L^{2}G^{2}(G^{2}+1)[8\sigma^{2}(L^{2}+1)+G_{2}]}{3(1-\sqrt{\rho})^{2}}.\tag{28}$$ $$(29)$$ Furthermore, if the learning rate η and the mini-batch size B are chosen properly, we obtain the following corollary. Corollary 1. If µ ≥ 1 *and if we choose* η =1 2L+ √ T /K and B = √KT*, then we have* $${\frac{1}{T}}\sum_{t=1}^{T}\mathbb{E}\left[\|\nabla F({\bar{\mathbf{\theta}}}^{t})\|^{2}\right]={\mathcal{O}}\left({\frac{1}{\sqrt{K T}}}+{\frac{K}{T}}\right).$$ We show empirically in the next section that considering a regularization parameter such that µ ≥ 1 still leads to significant gains in terms of the worst distribution test accuracy and improves fairness across devices compared to DSGD. ## 6 Experiments In this section, we validate our theoretical results and show the communication-efficiency, robustness and fairness of our proposed approach, DR-DSGD, compared to its non-robust counterpart DSGD. ## 6.1 Simulation Settings For our experiments, we consider the image classification task using two main datasets: Fashion MNIST (Xiao et al., 2017) and CIFAR10 (Krizhevsky et al., 2009). We implement DR-DSGD and DSGD algorithms using PyTorch. For Fashion MNIST, we use an MLP model with ReLU activations having two hidden layers with 128 and 64 neurons, respectively. For the CIFAR10 dataset, we use a CNN model composed of ![9_image_0.png](9_image_0.png) Figure 2: Performance comparison between DR-DSGD and DSGD in terms of: (a) average test accuracy, (b) worst test accuracy, and (c) STDEV of test accuracy for Fashion MNIST dataset. ![9_image_1.png](9_image_1.png) Figure 3: Performance comparison between DR-DSGD and DSGD in terms of: (a) average test accuracy, (b) worst test accuracy, and (c) STDEV of test accuracy for CIFAR10 dataset. three convolutional layers followed by two fully connected layers, each having 500 neurons. For each dataset, we distribute the data across the K devices in a pathological non-IID way, as in (McMahan et al., 2017), to mimic an actual decentralized learning setup. More specifically, we first order the samples according to the labels and divide data into shards of equal sizes. Finally, we assign each device the same number of chunks. This will ensure a pathological non-IID partitioning of the data, as most devices will only have access to certain classes and not all of them. Unless explicitly stated, we choose the learning rate η =pK/T and the mini-batch size B = √KT. For the graph generation, we generate randomly a network consisting of K devices with a connectivity ratio p using the networkx package (Hagberg et al., 2008). The parameter p measures the sparsity of the graph. While smaller values of p lead to a sparser graph, the generated graph becomes denser as p approaches 1. We use the Metropolis weights to construct the mixing matrix W as follow $$W_{i j}=\left\{\begin{array}{l l}{{1/\left(1+\operatorname*{max}\{d_{i},d_{j}\}\right),}}&{{\mathrm{if~}(j,i)\in\mathcal{E},}}\\ {{0,}}&{{\mathrm{if~}(j,i)\notin\mathcal{E}\mathrm{~and~}j\neq i,}}\\ {{1-\sum_{l\in\mathcal{N}_{i}}W_{i l},}}&{{\mathrm{if~}j=i,}}\end{array}\right.$$ Unless otherwise stated, the graphs used in our experiments are of the Erdős-Rényi type. ## 6.2 Robustness & Communication-Efficiency In this section, we consider K = 10 devices and µ = 6. For Fashion MNIST, we consider a value of p = 0.3 while we take p = 0.5 for CIFAR10. For each experiment, we report both the average test accuracy, the worst distribution test accuracy, and their corresponding one standard error shaded area based on five runs. The worst distribution test accuracy is defined as the worst of all test accuracies. The performance comparison between DR-DSGD and DSGD for Fashion MNIST and CIFAR10 dataset is reported in Figs. 2 and 3, respectively. Both experiments show that while DR-DSGD achieves almost the same average test ![10_image_0.png](10_image_0.png) Figure 4: Performance comparison between DR-DSGD and DSGD in terms of worst test accuracy distribution for: (a) Fashion MNIST and (b) CIFAR10 datasets. accuracy as DSGD, it significantly outperforms DSGD in terms of the worst distribution test accuracy. For the gap between both algorithms, the improvement, in terms of the worst distribution test accuracy, is of the order of 7% for Fashion MNIST and 10% for CIFAR10 datasets, respectively. This is mainly due to the fact that while the ERM objective sacrifices the worst-case performance for the average one, DRO aims to lower the variance while maintaining good average performance across the different devices. Not only our proposed algorithm achieves better performance than DSGD, but it is also more communication-efficient. In fact, for the same metric requirement, DR-DSGD requires fewer communication rounds than DSGD. Since our approach exponentially increases the weight of high training loss devices, it converges much faster than DSGD. For instance, in the experiment using the Fashion MNIST dataset, DR-DSGD requires 10× fewer iterations than DSGD to achieve 70% worst distribution test accuracy. Finally, in each experiment, we plot the standard deviation (STDEV) of the different devices' test accuracies for both algorithms. We can see from both Figs. 2(c) and 3(c) that DR-DSGD has a smaller STDEV compared to DSGD, which reflects that DR-DSGD promotes more fairness among the devices. ## 6.3 Fairness From this section on, we consider K = 25. To investigate the fairness of the performance across the devices, we run the experiments on Fashion MNIST and CIFAR10 datasets reporting the final test accuracy on each device in the case when µ = 9. In Figs. 4(a) and 4(b), we plot the worst test accuracy distribution across devices. We note that DR-DSGD results in a more concentrated distribution in both experiments, hence a fairer test accuracy distribution with lower variance. For instance, DR-DSGD reduces the variance of accuracies across all devices by 60% on average for the Fashion MNIST experiment while keeping almost the same average accuracy. ## 6.4 Tradeoff Between Fairness & Average Test Accuracy In this section, we show how µ controls the trade-off between fairness and average test accuracy. To this end, we report, in Table 1, the average, and worst 10% test accuracy, as well as the STDEV based on five runs for T = 300 and for different values of µ for both datasets. As expected, higher values of µ give more weight to the regularization term; hence driving the values of λi closer to the average weight 1/K. Therefore, as µ increases, the average test accuracy increases but the worst (10%) test accuracy decreases. Conversely, the worst test accuracy increases as the value of µ decreases at the cost of a drop in the average test accuracy. Furthermore, the STDEV decreases for smaller values of µ ensuring a fairer performance across devices. Dataset µAverage Worst 10% **STDEV** (%) (%) FMNIST µ = 2 71.5 ± 1.3 **49.1** ± 2.4 **11.4** ± 0.3 µ = 3 72.3 ± 1.1 48.8 ± 3 11.8 ± 1.5 µ = 5 **73.4** ± 2.4 44.5 ± 4.4 13.4 ± 2.1 CIFAR10 µ = 2 57.2 ± 2.4 **50.9** ± 1.5 **10.3** ± 0.6 µ = 3 59.83 ± 1.6 48.9 ± 1.8 10.9 ± 0.4 µ = 5 61 ± 1.4 44.9 ± 1.9 11.2 ± 1.3 Table 1: Statistics of the test accuracy distribution for different values of µ. ![11_image_1.png](11_image_1.png) ![11_image_0.png](11_image_0.png) Figure 5: Performance comparison between DR-DSGD and DSGD in terms of worst test accuracy distribution for different values of p for: (a) Fashion MNIST and (b) CIFAR10 datasets. ## 6.5 Impact Of Graph Topology In this section, we start by inspecting the effect of the graph sparsity on the performance of DR-DSGD and DSGD in terms of the worst distribution test accuracy by considering different connectivity ratios p ∈ {0.3, 0.45, 0.6} and for µ = 6. The results are reported in Fig 5 for both datasets for µ = 6. We can see that as the graph becomes denser, i.e. as p increases, the performance of both algorithms improves in terms of the worst test distribution. Nonetheless, it is clear that DR-DSGD outperforms DSGD for three different values of p for both datasets. Next, we explore the performance of both algorithms on several other types of graph-types, specifically geometric (Fig. 6(a)), ring (Fig. 6(b)) and grid graphs (Fig. 6(c)). The first row represents the graph topology, while the second represents the worst distribution test accuracy as a function of the number of communication rounds for Fashion MNIST. We can see that DR-DSGD outperforms DSGD for the three graphs considered in Fig. 6 by achieving a higher worst distribution test accuracy. Furthermore, we note that both algorithms converge faster as the graph becomes denser. For instance, both algorithms require fewer communication rounds when the graph topology is geometric (Fig. 6(a)) compared to the ring graph (Fig. 6(b)). ## 6.6 Limitations In this section, we highlight some of the limitations of our approach, while outlining several potential directions for future work. - **Solving the unregularized distributionally robust problem:** Instead of solving (5), we propose DR-DSGD to solve its regularized form given in (5). This is mainly motivated by the fact that solving the min-max problem in (5) in a decentralized fashion is a challenging task. A weakness of ![12_image_0.png](12_image_0.png) Figure 6: Performance comparison between DR-DSGD and DSGD in terms of worst test accuracy for: (a) geometric graph, (b) ring graph, and (c) grid graph for Fashion MNIST dataset. the convergence analysis is that the derived convergence rate is obtained only for values of µ larger than one. For µ → 0, the bound, derived in Theorem 1, grows to infinity. - **Relaxing some of the assumptions:** As pointed out in (Khaled et al., 2020), the bounded gradient assumption has been criticised in the FL literature. Adopting a more reasonable assumption is left for future work. ## 7 Conclusion This paper proposes a distributionally robust decentralized algorithm, DR-DSGD, that builds upon the decentralized stochastic gradient descent (DSGD) algorithm. The proposed framework is the first to solve the distributionally robust learning problem over graphs. Simulation results indicate that our proposed algorithm is more robust across heterogeneous data distributions while being more communication-efficient than its non-robust counterpart, DSGD. Furthermore, the proposed approach ensures fairer performance across all devices compared to DSGD. ## Broader Impact Statement This paper proposes a distributionally-robust decentralized learning algorithm. Our approach minimizes the maximum loss among the worst-case distributions across devices' data. As a result, even if the data distribution across devices is significantly heterogeneous, DR-DSGD guarantees a notion of fairness across devices. More specifically, the proposed algorithm ensures that the trained model has almost similar performance for all devices, rather than just performing well on a few of them while doing poorly on other devices. ## Acknowledgments This work was supported in part by the Academy of Finland 6G Flagship under grant No. 318927, in part by project SMARTER, in part by projects EU-ICT IntellIoT under grant No. 957218, EUCHISTERA LearningEdge, CONNECT, Infotech-NOOR, and NEGEIN. We would like also to thank the anonymous reviewers for their insightful comments that led to improving the manuscript. ## References Onur Avci, Osama Abdeljaber, Serkan Kiranyaz, Mohammed Hussein, and Daniel J Inman. Wireless and real-time structural damage detection: A novel decentralized method for wireless sensor networks. Journal of Sound and Vibration, 424:158–172, 2018. Chaouki Ben Issaid, Anis Elgabli, Jihong Park, Mehdi Bennis, and Mérouane Debbah. Communication efficient decentralized learning over bipartite graphs. *IEEE Transactions on Wireless Communications*, pp. 1–1, 2021. doi: 10.1109/TWC.2021.3126859. Arjun Nitin Bhagoji, Supriyo Chakraborty, Prateek Mittal, and Seraphin Calo. Analyzing federated learning through an adversarial lens. In *International Conference on Machine Learning*, pp. 634–643. PMLR, 2019. Yuyang Deng, Mohammad Mahdi Kamani, and Mehrdad Mahdavi. Distributionally robust federated averaging. In *Advances in Neural Information Processing Systems*, volume 33, pp. 15111–15122, 2020. John Duchi, Peter Glynn, and Hongseok Namkoong. Statistics of robust optimization: A generalized empirical likelihood approach. *arXiv preprint arXiv:1610.03425*, 2016. John C Duchi, Alekh Agarwal, and Martin J Wainwright. Dual averaging for distributed optimization: Convergence analysis and network scaling. *IEEE Transactions on Automatic control*, 57(3):592–606, 2011. Peyman Mohajerin Esfahani and Daniel Kuhn. Data-driven distributionally robust optimization using the Wasserstein metric: Performance guarantees and tractable reformulations. *Mathematical Programming*, 171(1):115–166, 2018. Aric A. Hagberg, Daniel A. Schult, and Pieter J. Swart. Exploring network structure, dynamics, and function using NetworkX. In *Proceedings of the 7th Python in Science Conference*, pp. 11 - 15, Pasadena, CA USA, 2008. Jenny Hamer, Mehryar Mohri, and Ananda Theertha Suresh. FedBoost: A communication-efficient algorithm for federated learning. In *Proceedings of the 37th International Conference on Machine Learning*, volume 119, pp. 3973–3983, 2020. Moritz Hardt, Eric Price, and Nati Srebro. Equality of opportunity in supervised learning. Advances in neural information processing systems, 29, 2016. Samuel Horváth, Maziar Sanjabi, Lin Xiao, Peter Richtárik, and Michael Rabbat. Fedshuffle: Recipes for better use of local work in federated learning. *arXiv preprint arXiv:2204.13169*, 2022. Fan Hu, Wen Xiong, Renbo Wu, Yongzhao Lao, Yunlong Li, Zhigang Li, and Jinyu Yu. Decentralized distributionally robust dispatch of multi-regional power systems considering the correlated variable wind power. In *2021 Power System and Green Energy Conference (PSGEC)*, pp. 491–496, 2021. Feihu Huang, Junyi Li, and Heng Huang. Compositional federated learning: Applications in distributionally robust averaging and meta learning. *arXiv preprint arXiv:2106.11264*, 2021. Gokhan Inalhan, Dusan M Stipanovic, and Claire J Tomlin. Decentralized optimization, with application to multiple aircraft coordination. In Proceedings of the 41st IEEE Conference on Decision and Control, 2002., volume 1, pp. 1147–1155. IEEE, 2002. Björn Johansson. *On distributed optimization in networked systems*. PhD thesis, KTH, 2008. Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Kallista Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. Foundations and Trends® *in Machine Learning*, 14(1–2):1–210, 2021. Sai Praneeth Karimireddy, Martin Jaggi, Satyen Kale, Mehryar Mohri, Sashank J Reddi, Sebastian U Stich, and Ananda Theertha Suresh. Mime: Mimicking centralized stochastic algorithms in federated learning. arXiv preprint arXiv:2008.03606, 2020a. Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank Reddi, Sebastian Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for federated learning. In *International* Conference on Machine Learning, pp. 5132–5143. PMLR, 2020b. Vassilis Kekatos and Georgios B Giannakis. Distributed robust power system state estimation. *IEEE* Transactions on Power Systems, 28(2):1617–1626, 2012. Ahmed Khaled, Konstantin Mishchenko, and Peter Richtárik. Tighter theory for local sgd on identical and heterogeneous data. In *International Conference on Artificial Intelligence and Statistics*, pp. 4519–4529. PMLR, 2020. Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, 2009. Peng Li and Ming Yang. Decentralized distributionally robust coordinated dispatch of multi-area power systems considering voltage security. In *2020 IEEE/IAS Industrial and Commercial Power System Asia* (I CPS Asia), pp. 863–868, 2020. Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. *IEEE Signal Processing Magazine*, 37(3):50–60, 2020a. Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. *Proceedings of Machine Learning and Systems*, 2:429–450, 2020b. Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. In *Proceedings of Machine Learning and Systems*, volume 2, pp. 429–450, 2020c. Tian Li, Maziar Sanjabi, Ahmad Beirami, and Virginia Smith. Fair resource allocation in federated learning. In *International Conference on Learning Representations (ICLR)*, 2020d. Tian Li, Ahmad Beirami, Maziar Sanjabi, and Virginia Smith. Tilted empirical risk minimization. In International Conference on Learning Representations (ICLR), 2021a. Tian Li, Shengyuan Hu, Ahmad Beirami, and Virginia Smith. Ditto: Fair and robust federated learning through personalization. In *International Conference on Machine Learning*, pp. 6357–6368. PMLR, 2021b. Xiang Li, Kaixuan Huang, Wenhao Yang, Shusen Wang, and Zhihua Zhang. On the convergence of FedAvg on non-IID data. In *International Conference on Learning Representations*, 2020e. Xiangru Lian, Ce Zhang, Huan Zhang, Cho-Jui Hsieh, Wei Zhang, and Ji Liu. Can decentralized algorithms outperform centralized algorithms? a case study for decentralized parallel stochastic gradient descent. Advances in Neural Information Processing Systems, 30, 2017. Xianfeng Liang, Shuheng Shen, Jingchang Liu, Zhen Pan, Enhong Chen, and Yifei Cheng. Variance reduced local sgd with lower communication complexity. *arXiv preprint arXiv:1912.12844*, 2019. Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In *Artificial intelligence and* statistics, pp. 1273–1282, 2017. Mihail Mihaylov, Karl Tuyls, and Ann Nowé. Decentralized learning in wireless sensor networks. In *International Workshop on Adaptive and Learning Agents*, pp. 60–73. Springer, 2009. Aritra Mitra, Rayana Jaafar, George J. Pappas, and Hamed Hassani. Linear convergence in federated learning: Tackling client heterogeneity and sparse gradients. In *Advances in Neural Information Processing* Systems, volume 34, pp. 14606–14619, 2021. Mehryar Mohri, Gary Sivek, and Ananda Theertha Suresh. Agnostic federated learning. In *Proceedings of* the 36th International Conference on Machine Learning, volume 97, pp. 4615–4625, 2019. Hongseok Namkoong and John C Duchi. Stochastic gradient methods for distributionally robust optimization with f-divergences. *Advances in neural information processing systems*, 29, 2016. Krishna Pillutla, Sham M Kakade, and Zaid Harchaoui. Robust aggregation for federated learning. *arXiv* preprint arXiv:1912.13445, 2019. Qi Qian, Shenghuo Zhu, Jiasheng Tang, Rong Jin, Baigui Sun, and Hao Li. Robust optimization over multiple domains. In *Proceedings of the AAAI Conference on Artificial Intelligence*, volume 33, pp. 4739– 4746, 2019. Amirhossein Reisizadeh, Farzan Farnia, Ramtin Pedarsani, and Ali Jadbabaie. Robust federated learning: The case of affine distribution shifts. In *Advances in Neural Information Processing Systems*, volume 33, pp. 21554–21565, 2020. Wei Ren, Randal W Beard, and Ella M Atkins. Information consensus in multivehicle cooperative control. IEEE Control systems magazine, 27(2):71–82, 2007. Wei Shi, Qing Ling, Kun Yuan, Gang Wu, and Wotao Yin. On the linear convergence of the ADMM in decentralized consensus optimization. *IEEE Transactions on Signal Processing*, 62(7):1750–1761, 2014. Beatriz Soret, Lam Duc Nguyen, Jan Seeger, Arne Bröring, Chaouki Ben Issaid, Sumudu Samarakoon, Anis El Gabli, Vivek Kulkarni, Mehdi Bennis, and Petar Popovski. Learning, computing, and trustworthiness in intelligent IoT environments: Performance-energy tradeoffs. *IEEE Transactions on Green Communications and Networking*, 2021. Jianyu Wang, Anit Kumar Sahu, Zhouyi Yang, Gauri Joshi, and Soummya Kar. MATCHA: Speeding up decentralized sgd via matching decomposition sampling. *arXiv preprint arXiv:1905.09435*, 2019. Jianyu Wang, Qinghua Liu, Hao Liang, Gauri Joshi, and H Vincent Poor. Tackling the objective inconsistency problem in heterogeneous federated optimization. *Advances in neural information processing systems*, 33: 7611–7623, 2020. Mengdi Wang, Ji Liu, and Ethan Fang. Accelerating stochastic composition optimization. Advances in Neural Information Processing Systems, 29, 2016. Mengdi Wang, Ethan X Fang, and Han Liu. Stochastic compositional gradient descent: algorithms for minimizing compositions of expected-value functions. *Mathematical Programming*, 161(1):419–449, 2017. Ermin Wei and Asuman Ozdaglar. Distributed alternating direction method of multipliers. In *2012 IEEE* 51st IEEE Conference on Decision and Control (CDC), pp. 5445–5450. IEEE, 2012. Yichao Wu and Yufeng Liu. Robust truncated hinge loss support vector machines. *Journal of the American* Statistical Association, 102(479):974–983, 2007. Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. *arXiv preprint arXiv:1708.07747*, 2017. Linli Xu, Koby Crammer, Dale Schuurmans, et al. Robust support vector machine training via convex outlier ablation. In *AAAI*, volume 6, pp. 536–542, 2006. Min Yang, Linli Xu, Martha White, Dale Schuurmans, and Yao-liang Yu. Relaxed clipping: A global training method for robust regression and classification. *Advances in neural information processing systems*, 23, 2010. Qiang Yang, Yang Liu, Tianjian Chen, and Yongxin Tong. Federated machine learning: Concept and applications. *ACM Transactions on Intelligent Systems and Technology (TIST)*, 10(2):1–19, 2019. Kun Yuan, Qing Ling, and Wotao Yin. On the convergence of decentralized gradient descent. *SIAM Journal* on Optimization, 26(3):1835–1854, 2016. Jinshan Zeng and Wotao Yin. On nonconvex decentralized gradient descent. IEEE Transactions on signal processing, 66(11):2834–2848, 2018. Yue Zhao, Meng Li, Liangzhen Lai, Naveen Suda, Damon Civin, and Vikas Chandra. Federated learning with non-IID data. *arXiv preprint arXiv:1806.00582*, 2018. ## A Appendix A.1 Worst-Case Bound On Categorical Cross-Entropy Let's first examine the behavior of a randomly initialized network. With random weights, the many units/layers will usually compound to result in the network outputting approximately uniform predictions. In a classification problem with M classes, we will get probabilities of around 1/M for each category. In fact, the cross-entropy for a single data point is defined as $$CE=-\sum_{m=1}^{M}y_{m}\log(\hat{y}_{m}),\tag{30}$$ where y are the true probabilities (labels), yˆ are the predictions. With hard labels (i.e. one-hot encoded), only a single ym is 1, and all others are 0. Thus, CE reduces to − log(ˆym), where m is now the correct class. With a randomly initialized network, we have yˆm ∼ 1/M, therefore, we get − log(1/M) = log(M). Since the training objective is usually to reduce cross-entropy, we can think of log(M) as a worst-case bound. ## A.2 Proximity Of The Solutions Of (6) To (5) In this appendix, we discuss briefly the Proximity of the solutions of (6) to (5) in the **convex** case. According to (Qian et al., 2019), problem (6) can be re-written using the duality theory as $$\min_{\Theta\in\mathbb{R}^{d}}\max_{\lambda\in\Delta}\sum_{i=1}^{K}\lambda_{i}f_{i}(\Theta)$$ $$s.t.\ \phi(\lambda,1/K)\leq\tau\tag{1}$$ $$(31)$$ $$(32)$$ where to every µ, we associate a τ value. From (Namkoong & Duchi, 2016; Duchi et al., 2016), for **convex** loss functions, we have that $$\operatorname*{max}_{\lambda\in\mathcal{P}_{\rho,K}}\sum_{i=1}^{K}\lambda_{i}\ell_{i}(\Theta)=\frac{1}{K}\sum_{i=1}^{K}\ell_{i}(\Theta)+\sqrt{\tau V a r_{P_{0}}[\ell(\Theta,\xi)]}+o_{P_{0}}(K^{-\frac{1}{2}}),$$ where ℓ(Θ) = [ℓ1(Θ)*, . . . , ℓ*K(Θ)]T ∈ R K is the vector of losses, P0 is the empirical probability distribution, and the ambiguity set Pρ,K is defined as Pρ,K = {λ ∈ R K PK i=1 λi = 1, λ ≥ 0, ϕ(λ, 1/K) ≤ τ}. Note that problem (5) is equivalent to (6) when τ = 0. Thus, we can link the objective of the problem (6) to (5) as $$\operatorname*{min}_{\Theta\in\mathbb{R}^{d}}\operatorname*{max}_{\lambda\in\mathcal{P}_{\rho,K}}\sum_{i=1}^{K}\lambda_{i}f_{i}(\Theta)=\operatorname*{min}_{\Theta\in\mathbb{R}^{d}}\operatorname*{max}_{\lambda\in\mathcal{P}_{0,K}}\sum_{i=1}^{K}\lambda_{i}f_{i}(\Theta)+{\sqrt{\tau V a r_{P_{0}}[\ell(\Theta,\xi)]}}.$$ $$(33)$$ $$(34)$$ ## A.3 Basic Identities And Inequalities We start by summarizing the main identities and inequalities used in the proof. Let {as} S s=1 be a sequence of vectors in R d, b1 and b2 two scalars, C1 and C2 two matrices, and ϵ > 0, then we have $$\left\|\sum_{s=1}^{S}a_{s}\right\|^{2}\leq S\sum_{s=1}^{S}\|a_{s}\|^{2}.$$ $$(35)$$ 2. (35) $$2\langle\mathbf{a}_{1},\mathbf{a}_{2}\rangle=\|\mathbf{a}_{1}\|^{2}+\|\mathbf{a}_{2}\|^{2}-\|\mathbf{a}_{1}-\mathbf{a}_{2}\|^{2}.\tag{1}$$ $$(36)$$ $$2b_{1}b_{2}\leq\frac{b_{1}^{2}}{\epsilon}+\epsilon b_{2}^{2},\forall\epsilon>0.$$ $$(37)$$ $$\operatorname{urz})\quad|\operatorname{Tr}\{C_{1}C_{2}\}|\leq\|C_{1}\|_{F}\|C_{2}\|_{F}.$$ $$(38)$$ , ∀ϵ > 0. (37) (Cauchy-Schwarz) |Tr{C1C2*}| ≤ ∥*C1∥F ∥C2∥F . (38) $$\mathbb{E}\left[\|\mathbf{A}\left(\mathbf{W}^{n}-\mathbf{J}\right)\|_{F}^{2}\right]$$ $$=\sum_{i=1}^{K}\left\|\mathbf{a}_{i}^{T}\left(\mathbf{W}^{n}\mathbf{e}_{i}-\frac{\mathbf{1}}{K}\right)\right\|^{2}$$ $$\leq\sum_{i=1}^{K}\|\mathbf{a}_{i}^{T}\|^{2}\left\|\mathbf{W}^{n}\mathbf{e}_{i}-\frac{\mathbf{1}}{K}\right\|^{2}.\tag{39}$$ In how $$\left\|\mathbf{W}^{n}\mathbf{e}_{i}-\frac{1}{K}\right\|^{2}\leq\rho^{n}.\tag{10.1}$$ $$\mathbb{E}\left[\|A\left(W^{n}-J\right)\|_{F}^{2}\right]\leq\rho^{n}\|A\|_{F}^{2}.\tag{1}$$ F . (41) $$\mathbb{E}[|\exp\left(z_{1}\right)-\exp\left(z_{2}\right)|]\leq L_{e}|z_{1}-z_{2}|,\tag{1}$$ where $t_{1}=\{t_{1},t_{2}\}$. Next, let $x_{1}>t_{2}$ and define $t_{1}=\exp(x_{1})$, then we can write $$\mathbb{E}[t_{1}^{\frac{1}{\mu}}-t_{2}^{\frac{1}{\mu}}]=\frac{1}{\mu}\mathbb{E}\left[t_{1_{2}}^{\frac{1}{\mu}}x^{\frac{1}{\mu}-1}dx\right]\leq\frac{\exp\left((\frac{1}{\mu}-1)M\right)}{\mu}\mathbb{E}[t_{1}-t_{2}]=\frac{\exp\left((\frac{1}{\mu}-1)M\right)}{\mu}\mathbb{E}\left[\exp\left(z_{1}\right)-\exp\left(z_{2}\right)\right].\tag{4}$$ $$(40)$$ $$(41)$$ $$(42)$$ 2)].</p> $\left(43\right)$ . $$(44)$$ $$(45)$$ $$(46)^{\frac{1}{2}}$$ $$\mathbb{E}[t_{1}^{\frac{1}{\mu}}-t_{2}^{\frac{1}{\mu}}]\leq\exp\left((\frac{1}{\mu}-1)M\right)L_{e}\mathbb{E}\left[\frac{z_{1}}{\mu}-\frac{z_{2}}{\mu}\right]$$ $$\mathbb{E}\left[|t_{1}^{\frac{1}{\mu}}-t_{2}^{\frac{1}{\mu}}|\right]\leq\exp\left((\frac{1}{\mu}-1)M\right)L_{e}\mathbb{E}\left[\left|\frac{z_{1}}{\mu}-\frac{z_{2}}{\mu}\right|\right].$$ $$\mathbb{E}\left[|\exp(y_{1})-\exp(y_{2})|\right]\leq L_{2}(\mu)|y_{1}-y_{2}|,$$ E [| exp(y1) − exp(y2)|] ≤ L2(µ)|y1 − y2|, (46) ## A.4 Proof Of Lemma 1 A.5 Proof Of Lemma 2 Let a T i denote the ith row vector of matrix A and ei the ith vector of the canonical basis of R K, then we can write From (Lian et al., 2017, Lemma 5), we have Replacing equation 40 in equation 39, we get Hence, the proof is completed. From Assumption 4, we have that the function θ 7→ ℓ(*θ, ξ*) is bounded, then θ 7→ exp(ℓ(*θ, ξ*)) is C 1 on a compact, and as a consequence, there exists Le > 0 such that where zi = ℓ(θi, ξ). Next, let z1 > z2 and define ti = exp(zi), then we can write Using (42), we get A similar result can be obtained if we considered z1 < z2, hence, we can write Using the definition of Y, we can write where L2(µ) := exp ( 1 µ − 1)M Le and hence the proof of statement (a). For statement (b), using Hoeffding's lemma, we can write $$\mathbb{E}\left[\exp(\ell(\theta,\xi_{i})/\mu)\right]\leq\exp\left({\frac{\mathbb{E}\left[\ell(\theta,\xi_{i})\right]}{\mu}}+{\frac{M^{2}}{2\mu^{2}}}\right)\leq\exp\left({\frac{M}{\mu}}+{\frac{M^{2}}{2\mu^{2}}}\right).$$ $$(47)$$ By choosing G2(µ) := exp M µ + M2 2µ2 , we prove statement (b). Finally, for statement (c), we can write $$\mathbb{E}\left[|\exp(\ell(\mathbf{\theta},\xi_{i})/\mu)-\exp(f_{i}(\mathbf{\theta})/\mu)|^{2}\right]\leq2\left(\mathbb{E}\left[\exp(2\ell(\mathbf{\theta},\xi_{i})/\mu)\right]+\exp(2f_{i}(\mathbf{\theta})/\mu)\right).$$ Using Assumption 4 and Hoeffding's lemma, we get $$(48)$$ $$\mathbb{E}\left[|\exp(\ell(\mathbf{\theta},\xi_{i})/\mu)-\exp(f_{i}(\mathbf{\theta})/\mu)|^{2}\right]\leq(\sigma_{3}(\mu))^{2},$$ $$(49)$$ 2≤ (σ3(µ))2, (49) where (σ3(µ))2:= 2 exp 2M $$))^{2}:=2\left(\exp\left(\frac{2M}{\mu}+\frac{M^{2}}{\mu^{2}}\right)+\exp\left(\frac{2M}{\mu}\right)\right).$$ ## A.6 Proof Of Lemma 3 Using the update rule (20) and the identity W J = JW = J, we can write $$\theta^{t}(I-J)=\left(\theta^{t-1}-\eta U^{t-1}\right)W(I-J)=\theta^{t-1}(I-J)W-\eta U^{t-1}W(I-J).$$ Writing (50) recursively, we get $$\mathbf{\theta}^{t}(\mathbf{I}-\mathbf{J})=\mathbf{\theta}^{0}(\mathbf{I}-\mathbf{J})\mathbf{W}^{t}-\eta\sum_{\tau=0}^{t-1}\mathbf{U}^{\tau}\left(\mathbf{W}^{t-\tau}-\mathbf{J}\right)=-\eta\sum_{\tau=0}^{t-1}\mathbf{U}^{\tau}\left(\mathbf{W}^{t-\tau}-\mathbf{J}\right),\tag{51}$$ where we used the fact that all local models are initiated at the same point, i.e. θ 0(I − J)Wt = 0. Thus, we can write 1 KT X T t=1 E -∥θ t(I − J)∥ 2 F t=1 E Xt−1 τ=0 U τWt−τ − J 2 F =η 2 KT X T t=1 E Xt−1 τ=0 (U τ − ∇F τ + ∇F τ)Wt−τ − J 2 F =η 2 KT X T t=1 E Xt−1 τ=0 (U τ − ∇F τ)Wt−τ − J 2 F t=1 E Xt−1 τ=0 ∇F τWt−τ − J 2 F ≤ 2η 2 KT X T + 2η 2 KT X T , (52) $$(50)$$ where we used (35) (for S = 2) in the last inequality. Let Bτ,t = Wt−τ − J. We start by examining the first term of (52) by writing E Xt−1 τ=0 (U τ − ∇F τ) Bτ,t 2 F = Xt−1 τ=0 E h∥(U τ − ∇F τ) Bτ,t∥ 2 F i+ Xt−1 τ=0 Xt−1 τ ′=0, τ ′̸=τ E hTr{BT τ,t(U τ − ∇F τ) T(U τ ′− ∇F τ ′)Bτ ′,t} i ≤ Xt−1 τ=0 E h∥U τ − ∇F τ∥ 2 F ∥Bτ,t∥ 2 F i+ Xt−1 τ=0 Xt−1 τ ′=0, τ ′̸=τ E h∥(U τ − ∇F τ) Bτ,t∥F ∥(U τ ′− ∇F τ ′)Bτ ′,t∥F i ≤ Xt−1 τ=0 ρ t−τE h∥U τ − ∇F τ∥ 2 F i+ Xt−1 τ=0 Xt−1 τ ′=0, τ ′̸=τ (ρ t−τ 2ϵ E -∥U τ − ∇F τ∥ 2 F + ϵρt−τ ′ 2 E U τ ′− ∇F τ ′ 2 F ), (53) ``` where we have used Lemma 1 and inequalities (37) and (38). Setting ϵ = ρ τ ′−τ 2 , we can further write (53) as ``` E Xt−1 τ=0 (U τ − ∇F τ) Bτ,t 2 F τ ′=0, τ ′̸=τ ρ t− τ+τ ′ 2 2 E ∥U τ − ∇F τ∥ 2 F + U τ ′− ∇F τ ′ 2 F ≤ Xt−1 τ=0 ρ t−τE h∥U τ − ∇F τ∥ 2 F i+ Xt−1 τ=0 Xt−1 ≤ Xt−1 τ=0 ρ t−τE h∥U τ − ∇F τ∥ 2 F i+ Xt−1 τ=0 Xt−1 τ ′=0, τ ′̸=τ ρ t− τ+τ ′ 2 E h∥U τ − ∇F τ∥ 2 F i ≤ Xt−1 τ=0 ρ t−τE h∥U τ − ∇F τ∥ 2 F i+ Xt−1 τ=0 ρ t−τ 2 E h∥U τ − ∇F τ∥ 2 F i Xt−1 τ ′=0, τ ′̸=τ ρ t−τ ′ 2 = Xt−1 τ=0 ρ t−τE h∥U τ − ∇F τ∥ 2 F i+ Xt−1 τ=0 ρ t−τ 2 E h∥U τ − ∇F τ∥ 2 F i Xt−1 τ ′=0 ρ t−τ ′ 2 − ρ t−τ 2 ! ≤ Xt−1 τ=0 ρ t−τ 2 E h∥U τ − ∇F τ∥ 2 F i Xt−1 τ ′=0 ρ t−τ ′ 2 ≤ √ρ 1 − √ρ Xt−1 τ=0 ρ t−τ 2 E h∥U τ − ∇F τ∥ 2 F i, (54) where in the last inequality, we used Pt−1 τ=0 ρ t−τ 2 = √ρ t + √ρ t−1 + *· · ·* + √ρ ≤√ρ 1− √ρ . Now, let's focus on finding an upper bound for the term E h∥Uτ −∇F τ ∥ 2 F i. To this end, we start by writing $$\left\|\mathbf{U}^{\tau}-\nabla\mathbf{F}^{\tau}\right\|_{F}^{2}=\frac{1}{\mu^{2}}\sum_{i=1}^{K}\left\|h(\mathbf{\theta}_{i}^{\tau};\mu)\mathbf{g}_{i}(\mathbf{\theta}_{i}^{\tau})-\exp\left(\frac{f_{i}(\mathbf{\theta}_{i}^{\tau})}{\mu}\right)\nabla f_{i}(\mathbf{\theta}_{i}^{\tau})\right\|^{2}.\tag{55}$$ Next, we can write the following h(θ τ i ; µ)gi(θ τ i ) − exp fi(θ τ i ) µ ∇fi(θ τ i ) = h(θ τ i ; µ)gi(θ τ i ) − h(θ τ i ; µ)gi(θ¯τ) + h(θ τ i ; µ)gi(θ¯τ) − h(θ τ i ; µ)∇fi(θ¯τ) + h(θ τ i ; µ)∇fi(θ¯τ) − exp fi(θ τ i ) µ ∇fi(θ¯τ) + exp fi(θ τ i ) µ ∇fi(θ¯τ) − exp fi(θ τ i ) µ ∇fi(θ τ i ). (56) Using the decomposition (56) in (55) and taking the expected value while using the inequality (35) (for S = 4), we get E h∥U τ − ∇F τ∥ 2 F i ≤4 µ2 X K i=1 E hh(θ τ i ; µ)gi(θ τ i ) − gi(θ¯τ) 2i+ 4 µ2 X K $$\quad(56)$$ i=1 E hh(θ τ i ; µ)gi(θ¯τ) − ∇fi(θ¯i) 2i + 4 µ2 X K i=1 E " ∇fi(θ¯τ) h(θ τ i ; µ) − exp fi(θ τ i ) µ 2# + 4 µ2 X K i=1 E " exp fi(θ τ i ) µ ∇fi(θ¯τ) − ∇fi(θ τ i ) 2# ≤ 4(G2(µ))2 µ2 X K i=1 E -∥gi(θ τ i ) − gi(θ¯τ)∥ 2+ 4(G2(µ))2 µ2 X K i=1 E -∥gi(θ¯τ) − ∇fi(θ¯τ)∥ 2 + 4G21 µ2 X K i=1 E " h(θ τ i ; µ) − exp fi(θ τ i ) µ 2# + 4(G2(µ))2 µ2 X K i=1 E -∥∇fi(θ¯τ) − ∇fi(θ τ i )∥ 2 ≤ 8G2µL 2 µ µ2 X K i=1 E -∥θ¯τ − θ τ i ∥ 2+ 8G2µσ 2 µ (L 2 µ + 1)K µ2B ≤ 8G2µL 2 µ µ2 E -∥θ τ(I − J)∥ 2 F + 8G2µσ 2 µ (L 2 µ + 1)K µ2, (57) where we used Assumptions 1-3 and defined the constants σµ = max{σ1, σ2, σ3(µ)}, Gµ = max{G1, G2(µ)} and Lµ = max{LF , L1, L2(µ)}. Going back to (54), and using (57), we can write Xt−1 τ=0 (U τ − ∇F τ) Bτ,t 2 t=1 E F 1 KT X T ≤ 8 √ρG2µL 2 µ µ2(1 − √ρ) 1 KT X T t=1 Xt−1 τ=0 ρ t−τ 2 E -∥θ τ(I − J)∥ 2 F + 8 √ρG2µσ 2 µ (L 2 µ + 1) µ2(1 − √ρ)TX T t=1 Xt−1 τ=0 ρ t−τ 2 ≤ 8 √ρG2µL 2 µ µ2(1 − √ρ) 1 KT X T t=1 E -∥θ t(I − J)∥ 2 F T X−t τ=0 ρ τ 2 + 8 √ρG2µσ 2 µ (L 2 µ + 1) µ2(1 − √ρ)TX T t=1 T X−t τ=0 ρ τ 2 ≤ 8ρG2µL 2 µ µ2(1 − √ρ) 2 1 KT X T t=1 E -∥θ t(I − J)∥ 2 F + 8ρG2µσ 2 µ (L 2 µ + 1) µ2(1 − √ρ) 2. (58) Now, we focus on the second term of (52). Following similar steps as when bounding the first term of (52), $$\left(57\right)$$ we get $$\mathbb{E}\left[\left\|\sum_{\tau=0}^{t-1}\nabla\mathbf{F}^{\tau}\mathbf{B}_{\tau,t}\right\|_{F}^{2}\right]\leq\frac{\sqrt{\rho}}{1-\sqrt{\rho}}\sum_{\tau=0}^{t-1}\rho^{\frac{t-\tau}{2}}\mathbb{E}\left[\left\|\nabla\mathbf{F}^{\tau}\right\|_{F}^{2}\right].\tag{59}$$ Next, we look for an upper bound for the term E h∥∇F τ ∥ 2 F i. To this end, we start by writing $$\mathbb{E}\left[\left\|\nabla\mathbf{F}^{\tau}\right\|_{F}^{2}\right]$$ $$=\frac{1}{\mu^{2}}\sum_{i=1}^{K}\mathbb{E}\left[\left\|\exp\left(\frac{f_{i}(\mathbf{\theta}_{i}^{\tau})}{\mu}\right)\nabla f_{i}(\mathbf{\theta}_{i}^{\tau})\right\|^{2}\right]$$ $$\leq\frac{(G_{2}(\mu))^{2}}{\mu^{2}}\mathbb{E}\left[\left\|\nabla f_{i}(\mathbf{\theta}_{i}^{\tau})\right\|^{2}\right]$$ $$\leq\frac{G1^{2}(G_{2}(\mu))^{2}K}{\mu^{2}}$$ $$\leq\frac{G_{\mu}^{4}K}{\mu^{2}}.\tag{6}$$ Therefore, we get $$\frac{1}{K T}\sum_{t=1}^{T}\mathbb{E}\left[\left|\left|\sum_{\tau=0}^{t-1}\nabla F^{\tau}B_{\tau,t}\right|\right|_{F}^{2}\right]\leq\frac{G_{\mu}^{4}\rho}{\mu^{2}(1-\sqrt{\rho})^{2}}.$$ $$(60)$$ $$(61)$$ $$(62)$$ $$(63)$$ Next, using (52), (58), and (61), we can write $$\frac{1}{KT}\sum_{t=1}^{T}\mathbb{E}\left[\|\mathbf{\theta}^{t}(\mathbf{I}-\mathbf{J})\|_{F}^{2}\right]\leq\frac{16\eta^{2}\rho L_{\rho}^{2}G_{\mu}^{2}}{\mu^{2}(1-\sqrt{\rho})^{2}}\frac{1}{KT}\sum_{t=1}^{T}\mathbb{E}\left[\|\mathbf{\theta}^{t}(\mathbf{I}-\mathbf{J})\|_{F}^{2}\right]+\frac{2\eta^{2}\rho G_{\mu}^{2}[8\rho_{\mu}^{2}(L_{\mu}^{2}+1)+G_{\mu}^{2}]}{\mu^{2}(1-\sqrt{\rho})^{2}}.$$ 2. (62) Let γµ = 16η 2ρL2µG2µ µ2(1− √ρ) 2 , then we obtain $$\frac{1}{K T}\sum_{t=1}^{T}\mathbb{E}\left[\|\mathbf{\theta}^{t}(\mathbf{I}-\mathbf{J})\|_{F}^{2}\right]\leq\frac{2\eta^{2}\rho G_{\mu}^{2}[8\sigma_{\mu}^{2}(\mathbf{I}_{\mu}^{2}+1)+G_{\mu}^{2}]}{\mu^{2}(1-\gamma_{\mu})(1-\sqrt{\rho})^{2}},$$ which concludes the proof of Lemma 3. ## A.7 Proof Of Theorem 1 Since the objective function F(·) has a Lipschitz gradient, we can write $$F(\bar{\mathbf{\theta}}^{i+1})-F(\bar{\mathbf{\theta}}^{i})\leq\langle\nabla F(\bar{\mathbf{\theta}}^{i}),\bar{\mathbf{\theta}}^{i+1}-\bar{\mathbf{\theta}}^{i}\rangle+\frac{L_{\mu}}{2}\|\bar{\mathbf{\theta}}^{i+1}-\bar{\mathbf{\theta}}^{i}\|^{2}.\tag{10.11}$$ Plugging the update rule θ¯t+1 = θ¯t − ηUt1/K, we have $$F(\bar{\theta}^{i+1})-F(\bar{\theta}^{t})\leq-\eta\langle\nabla F(\bar{\theta}^{t}),\frac{U^{t}{\bf1}}{K}\rangle+\frac{\eta^{2}L_{\mu}}{2}\left\|\frac{U^{t}{\bf1}}{K}\right\|^{2}.$$ Using the identity (36), we can write the first term of the left hand-side of (65) as $$\langle\nabla F(\vec{\theta}^{t}),\frac{U^{t}\mathbf{1}}{K}\rangle=\frac{1}{2}\left[\|\nabla F(\vec{\theta}^{t})\|^{2}+\left\|\frac{U^{t}\mathbf{1}}{K}\right\|^{2}-\left\|F(\vec{\theta}^{t})-\frac{U^{t}\mathbf{1}}{K}\right\|^{2}\right].$$ $$(64)$$ $$(65)$$ $$(66)$$ Next, we look for an upper bound for the third term of (66). To this end, we start by writing ∇F(θ¯t) − Ut1 K =1 µK X K i=1 exp fi(θ¯t) µ ∇fi(θ¯t) − h(θ t i ; µ)gi(θ t i ) =1 µK X K i=1 exp fi(θ¯t) µ ∇fi(θ¯t) − h(θ¯t; µ)∇fi(θ¯t) +1 µK X K i=1 h(θ¯t; µ)∇fi(θ¯t) − h(θ t i ; µ)∇fi(θ¯t) +1 µK X K i=1 h(θ t i ; µ)∇fi(θ¯t) − h(θ t i ; µ)gi(θ¯t) +1 µK X K i=1 h(θ t i ; µ)gi(θ¯t) − h(θ t i ; µ)gi(θ t i ) . (67) Using the inequality (35), we get ∇F(θ¯t) − Ut1 K 2 ≤4 µ2K X K i=1 exp fi(θ¯t) µ − h(θ¯t; µ) ∇fi(θ¯t) 2 +4 µ2K X K i=1 h(θ¯t; µ) − h(θ t i ; µ)∇fi(θ¯t) 2 +4 µ2K X K i=1 h(θ t i ; µ)∇fi(θ¯t) − gi(θ¯t) 2+4 µ2K X K i=1 h(θ t i ; µ)gi(θ¯t) − gi(θ t i ) 2. (68) Using assumption 2 and taking the expected value from both sides, we can write E " ∇F(θ¯t) − Ut1 K 2# i=1 E " exp fi(θ¯t) µ − h(θ¯t; µ) 2# ≤ 4G21 µ2K X K + 4G21 µ2K X K i=1 E h h(θ¯t; µ) − h(θ t i ; µ) 2i | {z } T2 | {z } T1 + 4(G2(µ))2 µ2K X K + 4(G2(µ))2 µ2K X K i=1 E h∇fi(θ¯t) − gi(θ¯t) 2i i=1 E hgi(θ¯t) − gi(θ t i ) 2i . (69) | {z } T3 | {z } T4 We start by bounding the term T1 T1 = E " exp fi(θ¯t) µ − h(θ¯t; µ) 2# (15) ≤ L 2 µE 2 1 B X B i=1 ℓ(θ¯t, ξt i ) µ− fi(θ¯t) µ = L 2 µ B2µ2 E i=1 ℓ(θ¯t, ξt i ) − fi(θ¯t) 2 X B = L 2 µ B2µ2 E i=1 Xt i 2 X B = L 2 µ B2µ2 i=1 E h Xt i 2i+ X j̸=i E -⟨Xt i , Xt j ⟩ X B , (70) where Xt i = ℓ(θ¯t, ξt i ) − fi(θ¯t). Since ξ t i and ξ t j are independent for j ̸= i, then E-⟨Xt i , Xt j ⟩= 0. Then, using (25), we can write that $$T_{1}=\frac{L_{\mu}^{2}}{B^{2}\mu^{2}}\sum_{i=1}^{B}\mathbb{E}\left[\left|X_{i}^{t}\right|^{2}\right]\leq\frac{L_{\mu}^{2}}{B^{2}\mu^{2}}(B\sigma_{\mu}^{2})=\frac{L_{\mu}^{2}\sigma_{\mu}^{2}}{B\mu^{2}}.$$ ``` Similarly, we can bound the term T3 as T3 ≤ σ 2 µ B . Next, we bound the term T2 as ``` T2 = E h h(θ¯t; µ) − h(θ t i ; µ) 2i = E exp 2 − exp 1 B X B j=1 ℓ(θ¯t, ξt j ) µ 1 B X B j=1 ℓ(θ t i , ξt j ) µ (15) ≤ L 2E 1 B X B 2 j=1 ℓ(θ¯t, ξt j ) µ− 1 B X B j=1 ℓ(θ t i , ξt j ) µ = L 2 µ B2µ2 E X B j=1 (ℓ(θ¯t, ξt j ) − ℓ(θ t i , ξt j )) 2 ≤ L 2 µ Bµ2 X B j=1 E h ℓ(θ¯t, ξt j ) − ℓ(θ t i , ξt j ) 2i (a) ≤ L 2 µG2µ µ2 E hθ¯t − θ t i 2i, (72) $$(71)$$ where we have used the fact that (12) gives that ℓ(θ¯t, ξt j ) is G-Lipschitz continuous in (a) and (24) in the last inequality. Finally, using (11), we can bound T4 as T4 ≤ L 2 µE-∥θ¯t − θ t i ∥ 2. Using the bounds on the terms T1-T4, we can write $$\mathbb{E}\left[\left\|\nabla F(\bar{\theta}^{i})-\frac{U^{i}\mathbf{1}}{K}\right\|^{2}\right]\leq\frac{4G_{\mu}^{2}\sigma_{\mu}^{2}(L_{\mu}^{2}+\mu^{2})}{\mu^{4}B}+\frac{4G_{\mu}^{2}(G_{\mu}^{2}+\mu^{2})L_{\mu}^{2}}{\mu^{4}K}\sum_{i=1}^{K}\mathbb{E}\left[\left\|\bar{\theta}^{i}-\theta_{i}^{i}\right\|^{2}\right].$$ $$(72)$$ 2. (73) Replacing (73) in (66), we obtain $$\mathbb{E}\left[\langle\nabla F(\vec{\theta^{\prime}}),\frac{U^{I}\mathbf{1}}{K}\rangle\right]\geq\frac{1}{2}\mathbb{E}\left[\|\nabla F(\vec{\theta^{\prime}})\|^{2}\right]+\frac{1}{2}\mathbb{E}\left[\left\|\frac{U^{I}\mathbf{1}}{K}\right\|^{2}\right]-\frac{2G_{\mu}^{2}\sigma_{\mu}^{2}(L_{\mu}^{2}+\mu^{2})}{\mu^{4}B}-\frac{2G_{\mu}^{2}(G_{\mu}^{2}+\mu^{2})L_{\mu}^{2}}{\mu^{4}K}\mathbb{E}\left[\|\vec{\theta^{\prime}}\|^{2}\right].$$ $$\begin{array}{c}{{\mathrm{i}\mathbb{E}\left[||\theta^{t}(I-J)||_{F}^{2}\right].}}\\ {{\mathrm{}}}\\ {{\mathrm{}}}\\ {{\mathrm{}}}\end{array}$$ $$(73)$$ Going back to (65), we can write $$\mathbb{E}\left[F(\vec{\theta}^{(\ell+1)}-F(\vec{\theta}^{\prime}))\right]$$ $$\leq-\frac{\eta}{2}\mathbb{E}\left[\|\nabla F(\vec{\theta}^{\prime})\|^{2}\right]+\frac{\eta}{2}\left(\eta L_{\mu}-1\right)\mathbb{E}\left[\left\|\frac{U^{\prime}1}{K}\right\|^{2}\right]+\frac{2G_{\mu}^{2}\sigma_{\mu}^{2}\eta(L_{\mu}^{2}+\mu^{2})}{\mu^{4}B}+\frac{4G_{\mu}^{2}L_{\mu}^{2}\eta(G_{\mu}^{2}+\mu^{2})}{\mu^{4}K}\mathbb{E}\left[\|\theta^{\prime}(I+I)\|^{2}\right].$$ t(I − J)∥ $$-\left.J\right)\left[\right._{F}^{2}\right].$$ Setting the learning rate η such that ηLµ ≤ 1, and taking the average over t ∈ [1, T], we get $$\mathbb{E}\left[F(\hat{\mathbf{\theta}}^{T})-F(\hat{\mathbf{\theta}}^{1})\right]\leq-\frac{\eta}{2T}\sum_{t=1}^{T}\mathbb{E}\left[\left|\nabla F(\hat{\mathbf{\theta}}^{t})\right|\right]^{2}+\frac{2\eta G_{\theta}^{2}\sigma_{\theta}^{2}L_{\mu}^{2}+\mu^{2}}{\mu^{4}B}+\frac{2\eta G_{\theta}^{2}L_{\mu}^{2}(G_{\theta}^{2}+\mu^{2})}{\mu^{4}KT}\sum_{t=1}^{T}\mathbb{E}\left[\left|\mathbf{\theta}^{t}(\mathbf{I}-\mathbf{J})\right|_{L}^{2}\right]\tag{76}$$ $$-{\mathbf{J}})\|_{F}^{2}\right]\,.$$ (76) Re-arranging the terms and using assumption 5, we can write $$\frac{1}{T}\sum_{t=1}^{T}\mathbb{E}\left[\|\nabla F(\hat{\mathbf{\theta}}^{t})\|^{2}\right]\leq\frac{2(F(\hat{\mathbf{\theta}}^{t})-F_{\text{int}})}{\eta T}+\frac{2G_{\rho\sigma}^{2}\rho_{\sigma}^{2}(L_{\rho}^{2}+\mu^{2})}{\mu^{4}B}+\frac{2G_{\rho\sigma}^{2}L_{\rho}^{2}(G_{\rho\sigma}^{2}+\mu^{2})}{\mu^{4}KT}\sum_{t=1}^{T}\mathbb{E}\left[\|\mathbf{\theta}^{t}(\mathbf{I}-\mathbf{J})\|_{F}^{2}\right].\tag{77}$$ Using Lemma 3 in (77), we get $$\frac{1}{T}\sum_{t=1}^{T}\mathbb{E}\left[\|\nabla F(\hat{\mathbf{\theta}}^{\prime})\|^{2}\right]\leq\frac{2(F(\hat{\mathbf{\theta}}^{1})-F_{inf})}{\eta T}+\frac{2G_{\mu}^{0}\sigma_{\mu}^{2}(L_{\mu}^{2}+\mu^{2})}{\mu^{4}B}+\frac{4\eta^{2}L_{\mu}^{2}\rho G_{\mu}^{2}(G_{\mu}^{2}+\mu^{2})[8\sigma_{\mu}^{2}(L_{\mu}^{2}+1)+G_{E}^{2}]}{\mu^{8}(1-\gamma)(1-\sqrt{\rho})^{2}}\tag{14}$$ $${\frac{r_{\mu}^{2}]}{\mathrm{.}}}.$$ (78) Furthermore, choosing η such that ηLµ < µ(1− √ρ) 8Gµ √ρensures that γµ < 1 4 , then we can write $$\frac{1}{T}\sum_{t=1}^{T}\mathbb{E}\left[\|\nabla F(\dot{\mathbf{\theta}}^{\prime})\|^{2}\right]\leq\frac{2(F(\dot{\mathbf{\theta}}^{1})-F_{inf})}{\eta T}+\frac{2G_{\rho}^{2}\sigma_{\mu}^{2}(L_{\rho}^{2}+\mu^{2})}{\mu^{4}B}+\frac{16\eta^{2}L_{\rho}^{2}\rho G_{\mu}^{2}(G_{\rho}^{2}+\mu^{2})[8\sigma_{\mu}^{2}(L_{\rho}^{2}+1)+G^{2}]}{3\mu^{8}(1-\sqrt{\rho})^{2}}\tag{7}$$ $${\frac{{\mathcal{I}}^{2}]}{\mathrm{{,}}}}$$ $$(79)$$ which finalizes the proof.
Review 1: Summary: This works studies distributionally robust optimization, i.e., the problem of minimizing the worst linear combination of given losses $f_i$, where $f_i$ is the objective of $i$-th device. The authors assume that $f_i$ is given in the form of expectation over random samples, with bounded values, bounded variance of values, and bounded variance of the gradients as well. The authors formulate this problem and then relax it using Kullback-Leibler regularization from uniform weights. They parameterize the regularization with coefficient $\mu$, which gives the original problem if $\mu=0$ and gives standard empirical risk if $\mu\to+\infty$. The last objective can be equivalently rewritten as $\min_{\Theta} \frac{1}{K}\sum_{i=1}^k F_i(\Theta)$, where $F_i(\Theta)=\frac{\exp(f_i(\Theta))}{\mu}$. The main contribution is a decentralized algorithm that runs stochastic gradient descent on each device and communicates with neighbors given by a mixing matrix $W$. The authors state its convergence in Theorem 1, which is roughly saying that after $T$ iterations we have $\mathbb{E}[\Vert\nabla F(\overline \theta)\Vert^2] = O\left(\frac{1}{T} + \frac{1}{\mu^2} \right)$. The authors also run experiments to compare their algorithm DR-DSGD with non-decentralized DSGD. Strengths and Weaknesses: ## Strengths First of all, I want to state that I checked all proofs and I did not find any serious mistake. I think the proofs are correct. I also found the work to be sufficiently well-written. There are some typos, but they are fixable. The only missing piece in terms of writing is a good discussion of the paper's limitations. Finally, I found the topic of the work to be quite meaningful. There is an ongoing effort to make decentralized optimization useful in applications and I think the combination of decentralization and distributional robustness makes sense. I do not have much to say about the experiments, but it seems they are sufficiently good. For some reason, the authors only compared to DSGD, so there is no comparison to non-decentralized algorithms, but the paper seems to be primarily theoretical, so I will not request any additional experiments. ## Weaknesses The theory in this work is far from satisfying. There are several major issues: 1. First of all, it is not exactly clear if the authors aim at solving problem (5) or (6). From the text, it appears that the main interest is in having robustness as given in formulation (5). However, there are no guarantees for that problem in this paper. Instead, Theorem 1 states convergence for the gradient norm of the regularized objective. The authors should either explain how these guarantees translate to guarantees for problem (5), or give sufficient motivation to solve (6). 2. Secondly, I am quite unhappy about the results. The error in Theorem 1, $O\left(\frac{1}{T} + \frac{1}{\mu^2} \right)$, does not go to 0 if we increase the number of iterations, so it does not guarantee convergence. It could be fine if we could also increase $\mu$, but the issue is that in this case the problem would get closer and closer to the standard empirical risk minimization. So, the more robustness we want the worse is the guarantee, which I find to be a very significant limitation. Resolving this issue is absolutely necessary for the paper to be accepted. 3. Next, I am a bit unhappy about Assumption 2. The assumption requires almost surely bounded gradient gradients and bounded loss values, which seems to be quite restrictive. This type of assumption has been criticised in the literature on federated learning (see Khaled et al., "Tighter theory for local SGD on identical and heterogeneous data"). 4. I am also concerned about implicit dependence of "constants" on $\mu$. For instance, equation (12) in Assumption 1, equation (14) in Assumption 2, and equation (17) in Assumption 3 all state the bounds in terms of universal constants even though they involve $\mu$. It seems that the values of $L_2$, $G_2$ and $\sigma_3$ implicitly depend on $\mu$, and at least in Corollary 1, the value of $\mu$ is not assumed to be fixed. The authors should either justify why these constants do not depend on $\mu$, or they should fix the assumptions and make the necessary corrections in the theoretical results. 5. Corollary 1 is very strange, if not incorrect. First of all, why can we take $\eta=\sqrt{\frac{K}{T}}$? It is not apparent at all why this value would satisfy the conditions of Theorem 1. Secondly, the value $\mu = \left(\frac{1}{KT}\right)^\frac{1}{4}$ does not lead to the upper bound as written in (27). Indeed, $\mu^2$ is in the denominator in (26), so to obtain the expression in (27), one needs to set $\mu=\left(KT\right)^\frac{1}{4}$, which to me makes no sense. Requested Changes: The main change required from the authors is to fix convergence and dependence on $\mu$ in the constants. There should also be a discussion of the assumptions as they are quite restrictive. ## Minor points 1. One thing that really confuses me is that superscripts are used both as iteration counters and matrix powers, sometimes within the same equation, for instance in (36). 2. The authors claim several times that their algorithm is "robust to data heterogeneity". I am not sure what this means and where it is shown. Instead, it seems that the algorithm is robust to distribution shift, which is not the same as robust to higher data heterogeneity. Moreover, I suspect that any algorithm that tries to use distributional robustness would be less robust to data heterogeneity, as it may largely overfit to the data on a single client. 3. Why is DR-DSGD better than DSGD in the experiments in terms of average test accuracy? From what I understand, DR-DSGD is solving a harder problem, so it is natural to expect that it would be better in terms of worst-distribution test accuracy, but the improvement of the average accuracy is quite surprising. For instance, in the work on "tilte" risk minimization, Table 7, only an improvement for the worst devices is reported. ## Typos Page 2, "on distributionally robustness" -> "on distributional robustness" Page 2, "as shown in corollary 1" -> "as shown in Corollary 1" Page 3, "set of neighbors of device $n$ is defined as $N_i$" -> "set of neighbors of device $i$ is defined as $N_i$" Page 3, "if only if" -> "if and only if" Page 4, the text writes "a local stochastic gradient update (Line 3) using the learning rate $\eta_t$", but in the algorithm itself $\eta$ is used without a subscript Page 5, equation (15), it's not vectors, so norms need to be replaced with absolute values Assumption 4 should probably mention that $F_{inf}>-\infty$ Page 7, "we start by stating a key lemma". It's a bit strange to write this after stating Lemma 1 Page 7, "Let $\eta$ satisfies" -> "Let $\eta$ satisfy" Page 14, equation (38), the last term should be part of the sum rather than be written separately from it Page 15, the step where $\sum_{\substack{\tau'=0 \\ \tau'\neq \tau}}^{t-1} \rho^{\frac{t-\tau'}{2}}$ is changed to $\sum_{\tau'=0}^{t-1} \rho^{\frac{t-\tau'}{2}} - \rho^{\frac{t-\tau}{2}}$ should be identity rather than inequality Page 16, "where we used assumptions 1-3" -> "where we used Assumptions 1-3" Page 17, "$F(\cdot)$ is Lipschitz smooth" -> "$F(\cdot)$ is $L$-smooth" or "$F(\cdot)$ has Lipschitz gradient" Page 18, equation (52), the last terms in the right-hand sides are detached from the sums, use () to make them part of the summation Broader Impact Concerns: I do not think that there might be any ethical concern about this work. ================================================== Review 2: Summary: This paper proposes and analyzes a new method, distributionally-robust decentralized stochastic gradient descent or DR-DSGD, for robust decentralized learning. The target setting is motivated by federated learning, where there is data heterogeneity. Rather than the usual objective, which corresponds to minimizing the empirical risk, the proposed objective is the usual one considered in distributionally robust optimization, where the aim is to minimize the loss wrt the the worst-case mixture over data distributions. Using existing ideas from the literature, this min-max problem is transformed to a minimization problem with a different objective, and the standard DSGD method is applied to the new formulation. A convergence analysis is provided for the smooth non-convex setting, and experiments validate the convergence analysis, highlighting the promising performance of the proposed approach in comparison to standard DSGD applied to the ERM formulation. Strengths and Weaknesses: ## Strengths * The paper is generally well-written and pleasant to read * Experimental results are promising, showing consistent improvements over plain DSGD * The theoretical analysis guaranteeing convergence at the expected $\mathcal{O}(1/KT)$ rate appears to be correct. ## Weaknesses I elaborate on each of the following weaknesses below, when discussing requested changes to address them: * Several statements in the introduction are highly debatable. The paper would be strengthened by providing better support for these, or by softening the statements. * There are some relevant references on robustness in FL that are missing * There are relevant references to related work on decentralized distributionally-robust methods that are missing * Several assumptions in the analysis should be more clearly explained, better justified, or possibly even simplified * There are ways in which the presentation of theoretical results in Section 5 could be improved * The experimental evaluation only compares DR-DSGD with DSGD. In particular, there isn't any comparison to other methods in the literature that aim to address robustness or data heterogeneity. Requested Changes: The suggested changes here are primarily to address weaknesses mentioned above. ### Accuracy of several statements in the intro There are several statements made in the introduction which are highly debatable and should be better supported by evidence. * "privacy ensured by only exchanging models/gradients with server" This is not true; see for example, work on gradient inversion attacks such as [Geiping et al. 2003](https://arxiv.org/abs/2003.14053). Additional mechanisms are needed (differential privacy, secure aggregation) to formally ensure privacy. * "Most FL algorithms fail to address the data heterogeneity issue" There have been several methods proposed in the FL literature that aim to address the data heterogeneity issue, and which ought to be better acknowledged. For example, see FedProx, VRLSGD, Scaffold, Mime, FedNova, FedLin, and FedShuffle. * Although I agree that FedAvg-style methods are state-of-the-art, I would not call FedAvg itself state-of-the-art in FL. Again, see the methods mentioned in the previous point, which exhibit superior performance to FedAvg. ### Relationship to other literature on robustness Several other papers in the literature address robustness in FL in different senses. While the paper does already mention several relevant references, there are a few others I was also expecting to see: * [Pillutla et al., 2019](https://arxiv.org/abs/1912.13445) and references therein * [Li et al., 2020](https://arxiv.org/abs/2012.04221) ### Relationship to other decentralized algorithms for distributionally-robust optimization There is some prior literature looking at decentralized distributionally-robust optimization specifically in the context of power systems. It would be good to call out this connection and also acknowledge prior work. For example, see * https://ieeexplore.ieee.org/abstract/document/9542394 * https://ieeexplore.ieee.org/document/9208508 ### Explaining, justifying, and possibly simplifying assumptions Presently, the analysis in Section 5 requires some strong assumptions, and it is not clear whether these are all necessary. * Assumption 1, equation (12) essentially follows from assuming that the range of the ($\mu$-scaled) loss function is bounded. Can you provide examples of loss functions that satisfy this assumption? The only way I can see to ensure this for most commonly-used losses is to impose a clipping. If that's indeed necessary, then it would be better to state it explicitly. Once you assume that the range is bounded, then smoothness of $F_i$ and $F$ follows directly from smoothness of $f_i$. Often one may already know or more easily check properties of $\ell$, and hence $f_i$, than properties of $F_i$ or $F$. * Equation (11) is not well-defined as written, since $g_i$ are stochastic gradients. Is there a missing expectation? Or is the assumption really that $\| \nabla \ell(\theta_1, \xi_i^t) - \nabla \ell(\theta_2, \xi_i^t)\| \le L_1 \|\theta_1 - \theta_2\|$ for all $\xi_i^t$? * The bounded gradient assumption is rather strong. Can you provide examples where this holds? ### More general suggestions about the presentation of the theoretical results * The ultimate objective (8) on which the DR-DSGD method is based is the composition of the original loss $f_i$ with the exponential function, which is smooth, convex, and non-decreasing. I appreciate that the analysis focuses on guarantees for non-convex functions. However, to start, it could be worthwhile to point out that if $f_i$ is convex (e.g., if $\ell$ is convex), then convergence of the proposed method follows directly from existing results in the literature. In particular, since $\exp(\cdot)$ is convex and non-decreasing, if $f_i$ is also convex then (8) is convex too. * In the non-convex case, as mentioned in Remark 1, gradients aren't unbiased. It could be worth pointing out that this is not necessarily detrimental, and it is well known (e.g., [Bottou et al. (2016)](https://arxiv.org/abs/1606.04838) Theorems 4.8 and 4.9) that stochastic gradient methods can still converge as long as the stochastic gradients are sufficiently well-aligned with the expected gradient. * How are $\sigma$, $L$, and $G$ in Lemma 2 defined? The definitions ought to be included in the main body of the paper for readability. ### Suggestions for the experiments section * Please include more details about the ``pathological non-IID way'' in which data is distributed across devices, to enable an interested reader to reproduce your results. * Was it expected that DR-DSGD improves Average Test Accuracy, in addition to Worst Distribution Test Accuracy? Or is this a pleasant consequence? Is there some intuition for why this is the case? Would it be the same if data were IID across devices? * The empirical comparison only is made between DR-DSGD and DSGD. It would significantly strength the work and increase the interest of the paper if a comparison was included to other methods from the literature on robustness and fairness in FL, such as DITTO, Tilted empirical risk minimization, and DRFA. * The `networkx` package provides functions to generate several types of random graphs. It sounds like the ones used in the experiment are Erdos-Renyi. Is that correct? Please clarify. It could be relevant to explore performance on several other types of graphs (e.g., rings, grids, ...) to validate the theoretical dependence on network topology. Broader Impact Concerns: I don't have any major concerns about ethical implications of the work. At the same time, given that the paper addresses fairness and robustness, it seems like there is a missed opportunity here to discuss the potential broader impact of this work, since the Broader Impact Statement has been omitted in the initial submission. ================================================== Review 3: Summary: The paper proposed a decentralized optimization algorithm for agnostic federated learning. The proposed algorithm is essentially decentralized SGD applied to a slightly different formulation than empirical risk minimization. Experiments on Fashion MNIST and CIFAR-10 are done to compare the proposed algorithm with decentralized SGD. Empirically, it is shown the proposed algorithm can converge faster and can achieve smaller accuracy variance across nodes. Strengths and Weaknesses: Strengths: 1. The proposed algorithm has better performance than decentralized SGD 2. The proposed algorithm has rigorous convergence guarantees since it is essentially decentralized SGD. Weakness: 1. The analysis seems to be unnecessary since there are many existing analyses for decentralized SGD. 2. The experiment is a bit weak and unconvincing for several reasons. 1). The parameter tuning procedure seems to be missing in the paper. 2). The experiments use small datasets, a small neural network, and a small number of devices. It is hard to say how the algorithm will perform in more practical settings. Requested Changes: 1. If the analyses is just redoing traditional analyses for decentralized SGD, please remove it and cite existing results. If not, please highlight the difference and this could be part of the contribution. 2. Please include parameter tuning procedures like how stepsizes and \mu are chosen for the experiments. Broader Impact Concerns: No concerns. ==================================================
# Towards More Robust Nlp System Evaluation: Handling Missing Scores In Benchmarks Anonymous authors Paper under double-blind review ## Abstract The evaluation of natural language processing (NLP) systems is crucial for advancing the field, but current benchmarking approaches often assume that all systems have scores available for all tasks, which is not always practical. In reality, several factors such as the cost of running baseline, private systems, computational limitations, or incomplete data may prevent some systems from being evaluated on entire tasks. This paper formalize an existing problem in NLP research: benchmarking when some systems scores are missing on the task, and proposes a novel approach to address it. Our method utilizes a compatible partial ranking approach to impute missing data, which is then aggregated using the Borda count method. It includes two refinements designed specifically for scenarios where either task-level or instance-level scores are available. We also introduce an extended benchmark, which contains over 131 million scores, an order of magnitude larger than existing benchmarks. We validate our methods and demonstrate their effectiveness in addressing the challenge of missing system evaluation on an entire task. This work highlights the need for more comprehensive benchmarking approaches that can handle real-world scenarios where not all systems are evaluated on the entire task. ## 1 Introduction Benchmarking and system evaluation are critical processes for assessing the performance of AI systems, providing a standardized means of comparing various models and techniques while keeping track of technological advancements Ruder (2021); Dehghani et al. (2021); Post (2018). However, evaluating general-purpose systems, such as foundation models used for generative tasks Lehman et al. (2023); Koco et al. (2023b); OpenAI (2023); Brown et al. (2020); Raffel et al. (2020), presents unique challenges. A single task, metric, or dataset may not be sufficient to effectively gauge their capabilities Herbrich et al. (2006); Novikova et al. (2018); Sedoc & Ungar (2020). Therefore, it is crucial to develop tools that can benchmark these systems on a multitude of tasks Aribandi et al. (2021), enabling a comprehensive assessment of their overall performance Peyrard et al. (2021). In recent years, the field of natural language processing (NLP) has made significant strides, with frequent emergence of new models Lehman et al. (2023); Koco et al. (2023a); Brown et al. (2020); OpenAI (2023); Raffel et al. (2020); Liu et al. (2019); Fan et al. (2021) and techniques Bommasani et al. (2021); Hupkes et al. (2022). To evaluate the performance of these systems across various tasks, datasets, and metrics Colombo et al. (2022c) have been created. However, with the increasing complexity of these benchmarks, missing scores has become a significant challenge. Missing data can arise from a variety of sources, such as benchmarks that are too large or time-consuming to run (*e.g.*, BigBench has recently introduced MiniBench for these reasons Srivastava et al. (2022)), high costs associated with reproducing experiments (*e.g.*, see Table 3 in Artetxe et al. (2022)), incomplete datasets (see Table 5 in Reid & Artetxe (2022)), data collection errors, data cleaning procedures, data privacy concerns (particularly in-house datasets Guibon et al. (2021)), and specialized expertise required to process niche datasets Peng et al. (2019). In recent work, two main approaches have been followed to deal with missing scores, which are discarding data Pfeiffer et al. (2022) or ignoring certain tasks (see Table 10 in Lin et al. (2022) and Table 5 in Martin et al. (2020)) or evaluations. However, these approaches are unsatisfactory as they can lead to biased and unreliable evaluations. In this work, we aim to address the challenge of benchmarking NLP systems when one or several systems cannot be evaluated on a specific task. We propose the development of effective methods for aggregating metrics that can handle missing data and enable a comprehensive assessment of system performance. Our approach will ensure the reliability and validity of NLP system evaluations and contribute to the creation of benchmarks that can be used to compare and evaluate NLP systems effectively. Specifically, our contributions are listed below. 1. **Introducing a new problem with a direct impact on NLP research:** benchmarking when there are missing system evaluations for an entire task, which has practical implications Pfeiffer et al. (2022); Lin et al. (2022); Martin et al. (2020); Guibon et al. (2021); Peng et al. (2019). 2. **A novel method for benchmarking NLP systems with missing system scores.** We present a novel method that effectively tackles the issue of missing system evaluations for entire tasks. Our work includes a novel combinatorial approach for imputing missing data in partial rankings. It allows using standard rank aggregation algorithms such as Borda and offers two refinements tailored to the availability of either task-level or instance-level scores of the systems across different tasks. 3. **An extended benchmark for a comprehensive and accurate evaluation of NLP systems:** previous works on score aggregation relied on a benchmark of 250K scores Colombo et al. (2022b); Peyrard et al. (2021), and did not release the system's input, output, and ground truth texts. In our work, we collected their scores and extended the benchmark by adding over 131M scores. 4. **Extensive validation of benchmarking methods:** Results show that our method effectively handles missing scores and is more robust than existing methods, affecting final conclusions. ## 2 Problem Formulation And State Of The Art 2.1 General Considerations Comparing systems with benchmarks. Benchmarking aims to determine the ranking of systems based on their scores to identify the best-performing systems. In this process, each system is evaluated on individual tests within a larger set and assigned a score according to a specific metric. Depending on the available information, two approaches are typically employed. When only **task-level** information is available (i.e., the system scores on each task), a **task-level aggregation** is utilized to obtain the final ranking. On the other hand, when **instance-level information** is available, i.e., the system scores on each instance of each task test set, an **instance-level aggregation** method is used to obtain the final system ranking. The mean aggregation has been adopted to consolidate information at both the instance and task levels. Benchmarking in the presence of missing data. As benchmarks and models continue to grow in size and complexity, the occurrence of missing system performance of entire tasks becomes increasingly common. This is particularly true in situations where one or more systems cannot be evaluated on a specific task due to factors such as the high cost of running the model or the extensive computational requirements of the benchmarks Gehrmann et al. (2022a; 2021; 2022b). Fig. 1 illustrates the general framework (*i.e.*, with instance and system level). ## 2.2 Problem Formulation This discussion will use notation similar to that in the previously mentioned work Colombo et al. (2022b). In essence, we are dealing with a scenario where N systems are being compared based on their performance on T different tasks. Each task t ∈ {1*, . . . , T*} has a specific metric mt associated with it and has been evaluated on k test instances with k ∈ {1*, . . . , K*t}, where Kt is the test size of task t. The score of each system on each instance of each test set is represented by the real number s*n,t,k* ∈ R. The final goal of benchmarking is to output a ranking of each system according to some objective criterion. We denote by SN the symmetric group on N elements. With this objective in mind aggregating instance and task level information is equivalent to computing a permutation σ ∈ SN corresponding to the final ranking of the ![2_image_0.png](2_image_0.png) Figure 1: **Framework for benchmarking NLP systems with two information granularity**: *instancelevel* (red above) and *task-level* (purple below). The final goal of benchmarking is to produce a ranking (green bottom). The instance-level aggregation allows for the derivation of task-level information, which is used to synthesize system performance via the final ranking (in green). X indicates the presence of missing values. N systems. In this formalism, system i is the σi-th best system according to the considered aggregation. Equivalently, ordering π = (π1 π2 *. . .* πN ) denotes that πiis better than system πi+1 for all i. Let us first define the different granularity of benchmarking depending on whether we have access to instance scores. Aggregating with Missing Task Level Information. Given a set of scores (sn,t, 1 ≤ n ≤ Nt, 1 ≤ t ≤ T) where Nt is the number of systems for which we have access to the score on task t*, find a proper aggregation* procedure. Thus the problem of task-level information aggregation boils down to finding f $${\mathrm{finding~}}f^{T}\colon$$ ti ti ti ti $\mathfrak{g}\mathfrak{h}\mathfrak{r}\mathfrak{t}\mathfrak{e}\mathfrak{g}\mathfrak{a}$ $$f^{T}:\;\underbrace{{\mathcal{S}}_{N_{1}}\times\cdots\times{\mathcal{S}}_{N_{T}}}_{T\;t i m e s}\longrightarrow\mathfrak{S}_{N}.$$ $$(1)$$ −→ SN . (1) where SNt = (sn,t, 1 ≤ n ≤ Nt) is the set of scores achieved by each system evaluated on the task t. Note that only Nt systems are evaluated on task t. In many cases, we not only have access to task-level performance but also individual instance-level scores. As a result, the challenge lies in effectively aggregating information at the instance level. Aggregating Missing Instance Level Information. Given a set of scores (s*n,t,k*, 1 ≤ n ≤ Nt, 1 ≤ t ≤ T, 1 ≤ k ≤ Kt) where similarly as previously Nt is the number of systems for which we have access to the score on task t*, find a proper aggregation procedure.* f instance-level information aggregation boils down to finding $f^I$: $$f^I:\ \underbrace{\mathcal{S}^1_{K_1}\times\cdots\times\mathcal{S}^{K_1}_{N_1}\times\cdots\times\mathcal{S}^{K_I}_{N_t}\times\cdots\times\mathcal{S}^1_{N_T}\times\cdots\mathcal{S}^{K_T}_{N_T}}_{T\sum\limits_t K_t\ times}\longrightarrow\mathfrak{S}_N.\tag{2}$$ $${\mathrm{to~finding~}}f^{I}\colon$$ where S k Ni = (s*n,t,k*, 1 ≤ n ≤ Ni) is the set of the score achieved by each system evaluated on the task t for the specific instance k. Remark 1. *In the context of complete ranking, which is also a classical setting for benchmarking NLP* systems and has been addressed in Colombo et al. (2022b), we have Nt = N *for all* t ∈ [1, T]. ## 2.3 Handling Complete Scores In Nlp System Evaluation The literature relies on two main techniques for aggregating score information to benchmark machine learning systems: mean aggregation and ranking-based aggregation. Mean aggregation ($\sigma^{\mu}$) is the default choice for practitioners. At the task level $\sigma^{\mu}$ is defined as $\sigma^{\mu}=argsort\left(argsort\left(\frac{1}{T}\sum\limits_{1\leq i\leq T}\kappa_{\sigma,i,k}\text{for}1\leq n\leq N\right)\right)$ and at the instance level $\sigma^{\mu}=argsort\left(argsort\left[\frac{1}{T}\sum\limits_{1\leq i\leq T}\frac{1}{T_{1}}\sum\limits_{1\leq i\leq T_{i}}\kappa_{\sigma,i,k}\text{for}1\leq n\leq N\right]\right)$.) where $argsort(\mathbf{u})$ is the permutation that sorts the item's $\mathbf{u}$. However, this approach has its limitations, particularly when evaluating tasks of different natures or using evaluation scores that are not on the same scale. Indeed in NLP, metrics can have different ranges (or even be unbounded) and systems are evaluated based on diverse criteria such as quality, speed, or number of parameters. In such cases, conventional rescaling or normalization techniques may not sufficiently capture the inherent difficulty of each task. Ranking Based Aggregation To address the challenges mentioned, researchers have proposed rankingbased aggregations Peyrard et al. (2021); Colombo et al. (2022b). These methods aggregate rankings instead of scores. In Colombo et al. (2022b), the authors tackle the problem of generating a ranking by aggregating rankings, utilizing the Borda count method (see Ssec. E.1 for more details on Borda Count) known for its computational properties Bartholdi et al. (1989); Dwork et al. (2001); Ali & Meilă (2012). Extending the Borda count method is not a straightforward task either. In the next section, we present our aggregation procedure that can handle missing system scores on a whole task. ## 3 Ranking With Missing System Evaluation In this section, we will outline our methodology for ranking multiple systems in multi-task benchmarks, even if some systems have not been evaluated on one or more tasks. We use the ranking and ordering notation interchangeably. ## 3.1 Partial Rankings Mapping Scores to Partial Rankings To address the challenge of benchmarking with missing system evaluations, we propose a ranking-based approach that focuses on aggregating rankings rather than directly combining scores. Suppose we have a specific task t with a task-level score denoted as SNt , or in the case of instance-level information, a task t and instance k with score S k Nt . In scenarios where there are missing evaluations at the task-level or instance-level, a *partial ranking* of systems is generated. A partial ordering represents an incomplete ranking that includes only a subset of items from a larger set. We denote the partial ordering of systems as π Nt = (π1 π2 *. . .* πNt ) for the task-level scenario, and as π Nt,k = (π k 1 π k 2 *. . .* π k Nt ) for the instance-level scenario. Here, πi represents the i-th best system according to the set SNt in the task-level scenario, while π k i represents the i-th best system according to π k in the instance-level scenario. Compatible Permutation When working with partial rankings, it is necessary to construct a complete ranking that respects the order of the evaluated systems, i.e., a linear extension of the partial ranking. This is accomplished by creating a compatible permutation Gessel & Zhuang (2018), which is a permutation of all systems consistent with the partial ranking. To construct a compatible permutation, we begin with the partial ranking of the evaluated systems and extend it to include the missing systems while maintaining the order of the evaluated systems. For example, let's consider a partial ordering π1 π2 based on the evaluation of only these two systems. If there is an additional system that has not been evaluated, we can construct three compatible permutations: π3 π1 π2, π1 π3 π2 and π1 π2 π3. These permutations ensure that the ordering of the evaluated systems is preserved while incorporating the missing system into the complete ranking. Why use a combinatorial approach? imputing missing data using compatible permutations enables us to leverage the Borda aggregation, inheriting its theoretical and practical advantages. Unlike classical methods like harmonic Fourier analysis Kondor & Barbosa (2010); Kondor & Dempsey (2012); Clémençon et al. (2011) or multi-resolution analysis Sibony et al. (2015), our approach works, providing a distinct combinatorial solution for imputing missing data in partial rankings. ## 3.2 Our Ranking Procedures: From Scores To System Ranking In summary, our method can be described in two steps: Our ranking procedure in a nutshell ![4_image_0.png](4_image_0.png) 1. **Matrix Representation of the rankings (Sssec. 3.2.1).** To harness the full potential of the ![4_image_1.png](4_image_1.png) available information in partial rankings, we **efficiently** generate all compatible permutations from ![4_image_2.png](4_image_2.png) 2. **Final System Ranking from Matrix Representation**. To obtain the final ranking of the ![4_image_3.png](4_image_3.png) systems, we propose a one-level (σ l) approach (see Sssec. 3.2.2) for both task-level and instance-level information and a two-level aggregation approach (σ 2l) for instance-level information (see Sssec. 3.2.3). ## 3.2.1 Matrix Representation Of The Rankings Intuition. The first step in our algorithm is to summarize the available information in all tasks and to impute the missing information in a consistent manner. To do this, we use a matrix representation Mπfor each partial ranking π. This matrix decomposes the ranking information in pairwise variables, i.e., for every pair of systems *i, j* there is a variable representing the probability that system i outperforms system j. Why using matrix representation? Using pairwise information has many advantages in ranking problems with missing data since it allows decomposing the total ranking information in N(N − 1)/2 different variables. This decomposition has been used in statistical problems on partial and complete rankings Fürnkranz & Hüllermeier (2003); Lu & Boutilier (2014a;b); Shah et al. (2017), for computing distances among partial rankings Fagin et al. (2003), clustering Ailon (2010) and classification Hüllermeier et al. (2008) among others. However, these problems consider specific forms of missing data such as top-k rankings Fagin et al. (2003) or bucket orderings Achab et al. (2019). Our approach differs from the aforementioned literature in the fact that we impute the missing data in a consistent manner in order to be able to deal with arbitrary missing data. Efficiently building Mπ. Let us consider a partial ranking π and let Mπ ∈ [0, 1]N×N be its matrix representation. Matrix Mπ ij denotes the proportion of complete rankings that are compatible with π and satisfy the condition i j, where i and j are distinct systems in the task. Formally, we can distinguish three cases: 1. if system i *is directly compared to system* j in π. In this case, we set Mπ i,j = 0 if i *j else M*π i,j = 1 2. if no information is provided for either system i *or system* j in π, meaning that both systems are unobserved in the partial ranking. In this case, Mπ i,j = 0.5, which is the natural choice when no information is available. 3. if we lack direct information about the comparison between system i and j in π (one system was evaluated and the was not), we represent this situation by setting the corresponding matrix entry to the proportion of compatible permutations ranking system i higher than system j among the total number of compatible permutations (see Ap. E). A naive algorithm for generating the matrix Mπfrom π would have factorial complexity and it is thus exorbitant in practice for a relatively small number of systems, say N > 10. **One of the contributions of** our solution is to reduce the complexity to O(n 3) **by efficiently computing** Mπ i,j . The closed-form expressions for Mπ i,j as well as the proof for uniformity can be found in Ap. E. ## 3.2.2 System Ranking From Matrix Representation: A One Level Approach (Σ L) Intuition. At this stage, we have demonstrated the construction of a matrix Mπfor a given partial ranking. However, in benchmarking scenarios, systems are typically evaluated on multiple tasks (in the case of task-level evaluation) or on multiple instances and tasks (in the case of instance-level evaluation). Consequently, it becomes necessary to combine multiple partial rankings. In this section, we will describe our approach for performing the one-level aggregation to address this requirement. Combining Multiple Partial Rankings for Benchmarking. To combine the different matrices into a single matrix M we sum over all the tasks (in the case of task-level information) or instances and tasks (in the case of instance-level information). Formally, this is achieved by performing the following operation to obtain the combined matrix MI =P t∈[1,T] P k∈[1,Kt] Mπ rt,k , where Mπ rt,k represents the partial ranking induced on task t and instance k. Similarly, for the task level we define MT =P t∈[1,T] Mπrt where Mπ rtrepresents the partial ranking induced on task t. Obtaining the final system ranking In the final step, our goal is to obtain the final system ranking σ l based on the matrix MI or MT. To achieve this, we use the Borda Count method, which involves computing the column-wise sum of the matrix and return the permutation that sorts the scores in increasing order. This step aligns with the approach proposed in Colombo et al. (2022b). Formally: $$\sigma^{l}=a r g s o r t\left(a r g s o r t\left[\sum_{i}M_{i,0},\cdots,\sum_{i}M_{i,N}\right]\right).$$ $$\left(3\right)^{\frac{1}{3}}$$ ................................. Here, M represents the matrix MTfor task-level information, and MIfor instance-level information. ## 3.2.3 System Ranking From Matrix Representation: A Two-Level Approach (Σ 2L) Intuition. In the case of instance-level information, we also present a two-step procedure that draws inspiration from the widely adopted two-step mean aggregation approach. Procedure. In the first step, we apply the task-level aggregation approach to generate individual rankings for each task t, resulting in T different permutations. In the second step, we aggregate these multiple rankings using the Borda aggregation method. Formally σ 2lcan be computed as: 1. For each task $t$, compute $M^t=\sum\limits_{k\in[1,K_t]}M^{\pi^{r_t,k}}$. 2. For each task $t$, compute $\sigma^{2t,t}=\mathit{argsort}\left(\mathit{argsort}\left[\sum\limits_{i}M_{i,0}^{t},\cdots,\sum\limits_{i}M_{i,N}^{t}\right]\right).$ 3. Compute the Borda count aggregation $\sigma^{2t}$ of $[\sigma^{2t_{1}},\cdots,\sigma^{2t_{s}},\cdots,\sigma^{2t_{s}T}]$.Colombo et al. (2022a). ## 3.3 Confidence Intervals For Σ L When evaluating systems with missing data, it is crucial to measure the uncertainty of partial rankings. In the previous section, we discussed combining partial rankings into a complete ranking. In this section, we analyze the confidence of our data regarding pairwise comparisons of system performance. Under any ranking model such as Mallows Model Fligner & Verducci (1986) or Plackett-Luce Plackett (1975), Mπ ij are random variables of known expected value. What we compute in the previous section is the empirical value of it, Mcπ ij that approximates the true value Mπ ij . Here, we want to know how close these two quantities are. Formally, we are looking for a confidence interval of level δ, that is the value for cij around Mcπ ij that ![6_image_0.png](6_image_0.png) $$\left(4\right)$$ ![6_image_1.png](6_image_1.png) Figure 2: Task-Level Robustness Experiment. We compare the robustness of our method σ l with the mean aggregation method σ µ by measuring the Kendall τ correlation coefficient between their respective rankings after removing a proportion η of scores and by considering the whole scores. Figure 3: Synthetic experiment. Robustness for missing data (η) and different scaling corruptions (λ). contains Mπ ij with high probability, P(|Mcπ ij − Mπ ij | ≥ cij ) ≤ 1 − δ. Noting that 0 ≤ Mπ ij ≤ 1, we can use the Hoeffding inequality Hoeffding (1994) to compute the value of the confidence interval: $$c_{i j}={\sqrt{\frac{-\log\delta}{2z_{i j}}}},$$ 2zij, (4) where zij is the number of times the systems have been compared. Intuition: to determine the significance of the difference in performance between system i and j, we can compare Mij to 0.5. Thus, i performs better than j iff Mπ ij > .5. If the difference between Mij and 0.5 is small, the performance difference between the two systems may not be statistically significant, indicating that we cannot determine which system performs better than the other. The confidence interval developed above says that the true parameter Mπ ij is included in the interval [Mcπ ij − cij , Mcπ ij + cij ] with high probability. It follows that if 0.5 is not in this interval then we can say that one of the systems is better than the other with a high probability. Similar approaches have been proposed to find complete rankings and best-ranked systems with high probability Busa-Fekete et al. (2014); Szörényi et al. (2015). ## 3.4 Baseline Methods To date, there is no established method for benchmarking NLP systems in the presence of missing data. To compare our proposed algorithm to existing methods, we consider a baseline approach that ignores missing data and relies on mean aggregation. This approach has been used in previous studies Pfeiffer et al. (2022); Lin et al. (2022); Martin et al. (2020); Guibon et al. (2021); Peng et al. (2019), and we will refer to it as σ µ in our experiments. ## 4 Synthetic Experiments 4.1 Data Generation The analysis of a toy experiment involves synthetic scores generated from N = 20 systems, T = 20 tasks, and K = 20 instances. Each system's performance is modeled by a Gumbel random variable Gn with a center at φ × n and a scale of β = 1, where φ is a dispersion parameter between 0 and 1. The scores of each system, s (*n, t, k*), are independent and identically distributed samples of Gn centered at φ × n with a scale of β = 1. Furthermore, the scores from different systems are sampled independently. Since the difference between Gn+1 and Gn follows a logistic distribution with a mean of φ and a scale of 1, the probability that system n + 1 ![7_image_0.png](7_image_0.png) Figure 5: Instance-Level Robustness Experiment. We evaluate the robustness of our proposed aggregation methods, namely σ 2l, σl, and the mean aggregation method σ µ, by randomly removing a proportion η of all instances on a specific task for a specific system. performs better than system n is at least 0.5, i.e., P (Gn+1 − Gn > 0) ≥ 0.5. Thus, the ranking of systems for all k and t is a realization of the true ranking [1, · · · , N], with a noise term controlled by the dispersion parameter φ. The extreme scenarios are φ = 0 and φ = 1, where φ = 0 means that all scores s (*n, t, k*) have the same distribution and φ = 1 results in a strong consensus and a clear system ranking. Unless specifically mentioned, each experiment is repeated 100 times for every data point. ## 4.2 Robustness To Scaling In order to conduct a more detailed comparison of the ranking, we introduce a corruption in the scores of a specific task by rescaling them with a positive factor of λ. For this experiment, the corrupted tasks are randomly chosen. Although this corruption does not have any impact on our ranking process (since the ranking induced by a task-instance pair remains unchanged), it progressively disrupts the mean aggregation procedure as the value of λ increases (see Fig. 3 for detailed results). This experiment further validates the use of rankings in NLP benchmarking, as these metrics involve different natures of measurements (e.g., BLEU score vs. number of parameters or speed) and can have bounded or unbounded scales. ## 4.3 Pairwise Confidence Analysis To determine the number of system comparisons required to achieve a desired confidence level of δ, we use Eq. 4. Fig. 4 presents the results for two confidence levels (δ). The graph illustrates the number of system pairs for which 0.5 is not within the confidence interval, plotted against the number of comparisons for different values of m and φ. As expected, when the rankings are more concentrated (*i.e.*, when φ is closer to 1), fewer system comparisons are needed to achieve a high number of valid system comparisons. In real-world benchmarks, test sets usually contain more than 500 pairs. ![7_image_1.png](7_image_1.png) ![7_image_2.png](7_image_2.png) Figure 4: Confidence analysis. ## 5 Empirical Experiments In this section, we benchmark our methods on real rankings. We introduce a dataset with over 100 million scores, surpassing previous datasets by several orders of magnitude (see Ssec. 5.1 and Ap. C). ## 5.1 A Comprehensive Collection Of Nlp System Scores Our dataset builds upon the one used in Colombo et al. (2022b) and includes two types of datasets: those with task-level information and those with instance-level information. Datasets with Task Level Information Our datasets are based on GLUE Wang et al. (2018), SGLUE Wang et al. (2019), and XTREME Hu et al. (2020), which include tasks of varying natures such as accuracy, F1-score, and mean square errors. In addition, we collected data from the GEM Benchmark Gehrmann et al. (2021), which was an ideal use case for our methods as it encompasses missing data by design (as shown in Table 3 of Gehrmann et al. (2021)) and includes evaluations of various natures such as lexical similarity, semantic equivalence, faithfulness evaluation, diversity, and system characterization (i.e., size of the vocabulary). Datasets with Instance Level Information We did not use the data from Peyrard et al. (2021) for the datasets with instance-level information because they did not provide the sentence and reference test required to add more evaluation metrics or more systems. Therefore, we collected all the data from scratch and extended the dataset in two ways. Firstly, we collected data from five distinct tasks - dialogue Mehri & Eskenazi (2020), image description Young et al. (2014), summary evaluation Dang et al. (2008); Owczarzak & Dang (2011); Bhandari et al. (2020); Fabbri et al. (2021), data-to-text Gardent et al. (2017); Zhou & Lampouras (2020), and translation Ranasinghe et al. (2021). For the translation part, we added datasets from WMT15 Stanojević et al. (2015), WMT16 Bojar et al. (2016), WMT17 Bojar et al. (2017), WMT18 rej Bojar et al. (2018), WMT19 Barrault et al. (2019), WMT20 Loïc et al. (2020), and WMT21 Farhad et al. (2021) in several languages such as en, ru, ts, and others. Secondly, we expanded the set of used metrics from 10 to 17, including Rouge Lin (2004), JS Lin et al. (2006), Bleu Papineni et al. (2002), Chrfpp Popović (2017), BERTScore Zhang et al. (2019a), MoverScore Zhao et al. (2019), Baryscore Colombo et al. (2021b), DepthScore Staerman et al. (2021), Infolm Colombo et al. (2021a), CharErrorRate Morris et al. (2004a), ExtendedEditDistance Stanchev et al. (2019), MatchErrorRate, TranslationEditRate Snover et al. (2006), WordErrorRate Ali & Renals (2018), WordInfoLost Morris et al. (2004b), Bleurt Sellam et al. (2020), and Comet Rei et al. (2022; 2020). Overall, our benchmark grew from 250K scores to over 131 M score. This extensive data work is one of the core contributions of this paper, and we believe it will be valuable for future research. ## 5.2 Task-Level Benchmarking In Real-World Scenarios In this section, we explore aggregating missing data with task-level information. First, we test the robustness of our proposed method (σ l) against the mean aggregation method (σ µ) and then we quantify the difference between the two output rankings. σ l**is more robust than** σ µ. To compare the effectiveness of aggregation methods in handling missing values on real data, we randomly remove a proportion η of the task-level data and measure robustness by computing the Kendall τ between the rankings of the systems obtained by considering the scores with and without missing values. From Fig. 2, we observe two extreme cases: when no systems are removed (*i.e.*, η = 0), the aggregation methods output the same value as the one obtained with the full ranking and τ = 1. At the other extreme, when all missing values are removed (*i.e.*, η = 1), a total absence of correlation can be observed. Overall, we find that σ l achieves a higher correlation, with a large improvement of more than 10 points compared to other methods These results demonstrate that, on average, the rankings remain more stable when using our proposed method. σ l **outputs a different ranking than** σ µ. We evaluated the correlation between different rankings obtained in the robustness experiment depicted in Fig. 2. Specifically, we compared the rankings produced by σ l and σ µ by computing the averaged τ between the produced rankings when varying the proportion of missing ranking. Results in Tab. 1 show a weak correlation between the two rankings, indicating that they produce different rankings. This weak correlation is further supported by the results presented in Tab. 2, which measures the percentage of times that the top 1 and top 3 rankings differ when considering the 2k rankings generated in the robustness experiment. *These results demonstrate that* in addition to being more robust, our ranking procedure produces different conclusions when benchmarking systems in the presence of missing tasks. Table 1: Agreement measured by Kendall τ correlation. Table 2: Percentage of times the top 1 and top 3 systems are the same between σ l and σ µ. | τσl↔σµ | | | | | |----------|------------|---------|-------|-------| | GLUE | 0.17 ±0.24 | | | | | SGLUE | 0.33 ±0.27 | | | | | XTREM | 0.26 ±0.26 | | | | | GEM | 0.36 ±0.36 | Dataset | top 1 | top 3 | | GEM | 0.52 | 0.25 | | | | SGLUE | 0.20 | 0.15 | | | | GLUE | 0.10 | 0.07 | | | | XTREM | 0.19 | 0.09 | | | ## 5.3 Instance-Level Benchmarking In Real-World Scenarios In this section, we evaluate the robustness of σ 2l, σ l, and the baseline σ µ. σ 2l and σ l **are more robust than** σ µ. Similarly to the previous robustness experiment, we randomly remove a proportion η of scores by discarding all instances of a specific task. *The goal of this missing value* sampling is to simulate how missing scores may occur when certain systems are not evaluated on specific tasks. For each method, Fig. 5 reports the τ correlation coefficient between the ranking obtained with missing values and the ranking obtained with complete scores. Both σ 2l and σ l **produce highly correlated rankings, while being different** from σ µ. We conducted a replication of the agreement analysis presented in Ssec. 5.2 and present the findings in Tab. 3 and Tab. 4. Our results align Table 3: Agreement. Table 4: Top 1 and 3 analysis. ![9_image_0.png](9_image_0.png) with those of our previous experiments, demonstrating that both of our ranking-based procedures (σ 2l and σ l) are more robust in the presence of missing data and yield different rankings than σ µ. | Corr. | | | | |-------------|------------|-------|-------| | τσ2l↔σl | 0.80 ±0.22 | | | | τσl↔σµ | 0.20 ±0.28 | | | | τσµ↔σ2l | 0.19 ±0.28 | Top 1 | Top 3 | | σ 2l vs σ l | 0.67 | 0.36 | | | σ l vs σ µ | 0.21 | 0.09 | | | σ µ vs σ 2l | 0.19 | 0.09 | | ## 5.4 Statistical Analysis Confidence interval for practitioners. The confidence interval is valuable for informing additional comparisons between systems i and j. A narrow interval indicates a reliable comparison, while a wider interval suggests more uncertainty and the need for additional comparisons across tasks. For example, in Fig. 6, we report the results of applying σ l on WMT en-de with a confidence level of δ = 0.1. Green value in position *i < j* illustrate that system 0.5 6∈ [Mcπ ij − cij , Mcπ ij + cij ] and i j with high probability. The scale of green displays the distance between 0.5 and the CI, so the greener the more i j. The results reveal distinct blocks where top systems (*i.e.,* 9,1,16,15) significantly outperform others with high confidence. Near the diagonal, the elements indicate relatively closer performance of the systems. These findings demonstrate that the confidence interval analysis provides insights into the relative performance of systems. Figure 6: Confidence interval analysis on WMT en-de for a corruption level of η = 0.2 and a confidence level δ = 0.01. The final ranking can be seen on the x-axis: left to right is best to worst ## 6 Conclusions And Future Research Directions Our study sheds light on the limitations of the conventional mean-aggregation approach, particularly when dealing with missing data. To address this issue, we propose a novel statistical perspective and aggregation procedures that are both robust and grounded in social choice theory. We introduce two alternative methods: the one-level aggregation method (σ l) stands out as the most robust approach. ## References Mastane Achab, Anna Korba, and Stephan Clémençon. Dimensionality reduction and (bucket) ranking: a mass transportation approach. volume 98, pp. 64–93. PMLR, 2019. URL http://proceedings.mlr. press/v98/achab19a.html. Nir Ailon. Aggregation of partial rankings, p-ratings and top-m lists. *Algorithmica (New York)*, 2010. ISSN 01784617. doi: 10.1007/s00453-008-9211-1. Khetam Al Sharou, Zhenhao Li, and Lucia Specia. Towards a better understanding of noise in natural language processing. In *Proceedings of the International Conference on Recent Advances in Natural* Language Processing (RANLP 2021), pp. 53–62, 2021. Ahmed Ali and Steve Renals. Word error rate estimation for speech recognition: e-wer. In *Proceedings of* the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 20–24, 2018. Alnur Ali and Marina Meilă. Experiments with kemeny ranking: What works when? *Mathematical Social* Sciences, 64(1):28–40, 2012. Vamsi Aribandi, Yi Tay, Tal Schuster, Jinfeng Rao, Huaixiu Steven Zheng, Sanket Vaibhav Mehta, Honglei Zhuang, Vinh Q Tran, Dara Bahri, Jianmo Ni, et al. Ext5: Towards extreme multi-task scaling for transfer learning. *arXiv preprint arXiv:2111.10952*, 2021. Mikel Artetxe and Holger Schwenk. Massively multilingual sentence embeddings for zero-shot cross-lingual transfer and beyond. *Transactions of the Association for Computational Linguistics*, 7:597–610, 2019. Mikel Artetxe, Sebastian Ruder, and Dani Yogatama. On the cross-lingual transferability of monolingual representations. *arXiv preprint arXiv:1910.11856*, 2019. Mikel Artetxe, Itziar Aldabe, Rodrigo Agerri, Olatz Perez-de Viñaspre, and Aitor Soroa. Does corpus quality really matter for low-resource languages? In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 7383–7390, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.499. Loïc Barrault, Ondřej Bojar, Marta R Costa-Jussa, Christian Federmann, Mark Fishel, Yvette Graham, Barry Haddow, Matthias Huck, Philipp Koehn, Shervin Malmasi, et al. Findings of the 2019 conference on machine translation (wmt19). ACL, 2019. John J Bartholdi, Craig A Tovey, and Michael A Trick. The computational difficulty of manipulating an election. *Social Choice and Welfare*, 6(3):227–241, 1989. D Bayer and P Diaconis. Trailing the dovetail shuffle to its lair. *The Annals of Applied Probability*, 2:294–313, 1992. URL http://www.jstor.org/view/10505164/di983988/98p0059i/0. Luisa Bentivogli, Peter Clark, Ido Dagan, and Danilo Giampiccolo. The fifth pascal recognizing textual entailment challenge. In TAC, 2009. Manik Bhandari, Pranav Gour, Atabak Ashfaq, Pengfei Liu, and Graham Neubig. Re-evaluating evaluation in text summarization. *arXiv preprint arXiv:2010.07100*, 2020. Ondřej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, et al. Findings of the 2016 conference on machine translation. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pp. 131–198, 2016. Ondřej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Shujian Huang, Matthias Huck, Philipp Koehn, Qun Liu, Varvara Logacheva, et al. Findings of the 2017 conference on machine translation (wmt17). Association for Computational Linguistics, 2017. Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of foundation models. *arXiv preprint arXiv:2108.07258*, 2021. Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020. Róbert Busa-Fekete, Eyke Hüllermeier, and Balázs Szörényi. Preference-Based Rank Elicitation using Statistical Models: The Case of Mallows. In *Proceedings of the 31th International Conference on Machine Learning,* (ICML), pp. 1071–1079, 2014. URL http://jmlr.org/proceedings/papers/v32/busa-fekete14.html. Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task 1: Semantic textual similarity-multilingual and cross-lingual focused evaluation. *arXiv preprint arXiv:1708.00055*, 2017. Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. Boolq: Exploring the surprising difficulty of natural yes/no questions. *arXiv preprint arXiv:1905.10044*, 2019. Jonathan H Clark, Eunsol Choi, Michael Collins, Dan Garrette, Tom Kwiatkowski, Vitaly Nikolaev, and Jennimaria Palomaki. Tydi qa: A benchmark for information-seeking question answering in typologically diverse languages. *Transactions of the Association for Computational Linguistics*, 8:454–470, 2020. Stéphan Clémençon, Romaric Gaudel, and Jérémie Jakubowicz. Clustering rankings in the fourier domain. In *Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2011,* Athens, Greece, September 5-9, 2011. Proceedings, Part I 11, pp. 343–358. Springer, 2011. Pierre Colombo, Chloe Clave, and Pablo Piantanida. Infolm: A new metric to evaluate summarization & data2text generation. *arXiv preprint arXiv:2112.01589*, 2021a. Pierre Colombo, Guillaume Staerman, Chloe Clavel, and Pablo Piantanida. Automatic text evaluation through the lens of wasserstein barycenters. *arXiv preprint arXiv:2108.12463*, 2021b. Pierre Colombo, Nathan Noiry, Ekhine Irurozki, and Stéphan Clémençon. What are the best systems? new perspectives on NLP benchmarking. In *NeurIPS*, 2022a. URL http://papers.nips.cc/paper_files/ paper/2022/hash/ac4920f4085b5662133dd751493946a6-Abstract-Conference.html. Pierre Colombo, Nathan Noiry, Ekhine Irurozki, and Stephan CLEMENCON. What are the best systems? new perspectives on NLP benchmarking. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), *Advances in Neural Information Processing Systems*, 2022b. URL https://openreview.net/ forum?id=kvtVrzQPvgb. Pierre Colombo, Maxime Peyrard, Nathan Noiry, Robert West, and Pablo Piantanida. The glass ceiling of automatic evaluation in natural language generation. *arXiv preprint arXiv:2208.14585*, 2022c. Alexis Conneau, Guillaume Lample, Ruty Rinott, Adina Williams, Samuel R Bowman, Holger Schwenk, and Veselin Stoyanov. Xnli: Evaluating cross-lingual sentence representations. *arXiv preprint arXiv:1809.05053*, 2018. Ido Dagan, Oren Glickman, and Bernardo Magnini. The pascal recognising textual entailment challenge. In Machine Learning Challenges Workshop, pp. 177–190. Springer, 2005. Hoa Trang Dang, Karolina Owczarzak, et al. Overview of the tac 2008 update summarization task. In TAC, 2008. Marie-Catherine De Marneffe, Mandy Simons, and Judith Tonhauser. The commitmentbank: Investigating projection in naturally occurring discourse. In *proceedings of Sinn und Bedeutung*, volume 23, pp. 107–124, 2019. Mostafa Dehghani, Yi Tay, Alexey A Gritsenko, Zhe Zhao, Neil Houlsby, Fernando Diaz, Donald Metzler, and Oriol Vinyals. The benchmark lottery. *arXiv preprint arXiv:2107.07002*, 2021. William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005), 2005. Cynthia Dwork, Ravi Kumar, Moni Naor, and Dandapani Sivakumar. Rank aggregation methods for the web. In *Proceedings of the 10th international conference on World Wide Web*, pp. 613–622, 2001. Alexander R Fabbri, Wojciech Kryściński, Bryan McCann, Caiming Xiong, Richard Socher, and Dragomir Radev. Summeval: Re-evaluating summarization evaluation. *Transactions of the Association for Computational Linguistics*, 9:391–409, 2021. Ronald Fagin, Ravi Kumar, and D. Sivakumar. Comparing top k lists. *SIAM Journal on Discrete Mathematics*, 2003. ISSN 0895-4801. doi: 10.1137/s0895480102412856. Angela Fan, Shruti Bhosale, Holger Schwenk, Zhiyi Ma, Ahmed El-Kishky, Siddharth Goyal, Mandeep Baines, Onur Celebi, Guillaume Wenzek, Vishrav Chaudhary, et al. Beyond english-centric multilingual machine translation. *The Journal of Machine Learning Research*, 22(1):4839–4886, 2021. Akhbardeh Farhad, Arkhangorodsky Arkady, Biesialska Magdalena, Bojar Ondřej, Chatterjee Rajen, Chaudhary Vishrav, Marta R Costa-jussa, España-Bonet Cristina, Fan Angela, Federmann Christian, et al. Findings of the 2021 conference on machine translation (wmt21). In Proceedings of the Sixth Conference on Machine Translation, pp. 1–88. Association for Computational Linguistics, 2021. Michael A Fligner and Joseph S Verducci. Distance based ranking models. *Journal of the Royal Statistical* Society, 48(3):359–369, 1986. Johannes Fürnkranz and Eyke Hüllermeier. Pairwise preference learning and ranking. pp. 145–156, 2003. Claire Gardent, Anastasia Shimorina, Shashi Narayan, and Laura Perez-Beltrachini. The webnlg challenge: Generating text from rdf data. In Proceedings of the 10th International Conference on Natural Language Generation, pp. 124–133, 2017. Sebastian Gehrmann, Tosin Adewumi, Karmanya Aggarwal, Pawan Sasanka Ammanamanchi, Aremu Anuoluwapo, Antoine Bosselut, Khyathi Raghavi Chandu, Miruna Clinciu, Dipanjan Das, Kaustubh D Dhole, et al. The gem benchmark: Natural language generation, its evaluation and metrics. arXiv preprint arXiv:2102.01672, 2021. Sebastian Gehrmann, Abhik Bhattacharjee, Abinaya Mahendiran, Alex Wang, Alexandros Papangelis, Aman Madaan, Angelina McMillan-Major, Anna Shvets, Ashish Upadhyay, Bingsheng Yao, et al. Gemv2: Multilingual nlg benchmarking in a single line of code. *arXiv preprint arXiv:2206.11249*, 2022a. Sebastian Gehrmann, Elizabeth Clark, and Thibault Sellam. Repairing the cracked foundation: A survey of obstacles in evaluation practices for generated text. *arXiv preprint arXiv:2202.06935*, 2022b. Ira M Gessel and Yan Zhuang. Shuffle-compatible permutation statistics. *Advances in Mathematics*, 332: 85–141, 2018. Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and William B Dolan. The third pascal recognizing textual entailment challenge. In Proceedings of the ACL-PASCAL workshop on textual entailment and paraphrasing, pp. 1–9, 2007. Gaël Guibon, Matthieu Labeau, Hélène Flamein, Luce Lefeuvre, and Chloé Clavel. Few-shot emotion recognition in conversation with sequential prototypical networks. In *Proceedings of the 2021 Conference* on Empirical Methods in Natural Language Processing, pp. 6858–6870, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main. 549. URL https://aclanthology.org/2021.emnlp-main.549. Ralf Herbrich, Tom Minka, and Thore Graepel. Trueskill™: A bayesian skill rating system. In B. Schölkopf, J. Platt, and T. Hoffman (eds.), *Advances in Neural Information Processing Systems*, volume 19. MIT Press, 2006. URL https://proceedings.neurips.cc/paper_files/paper/2006/file/ f44ee263952e65b3610b8ba51229d1f9-Paper.pdf. Wassily Hoeffding. Probability inequalities for sums of bounded random variables. *The collected works of* Wassily Hoeffding, pp. 409–426, 1994. Junjie Hu, Sebastian Ruder, Aditya Siddhant, Graham Neubig, Orhan Firat, and Melvin Johnson. Xtreme: A massively multilingual multi-task benchmark for evaluating cross-lingual generalisation. In International Conference on Machine Learning, pp. 4411–4421. PMLR, 2020. Dieuwke Hupkes, Mario Giulianelli, Verna Dankers, Mikel Artetxe, Yanai Elazar, Tiago Pimentel, Christos Christodoulopoulos, Karim Lasri, Naomi Saphra, Arabella Sinclair, et al. State-of-the-art generalisation research in nlp: a taxonomy and review. *arXiv preprint arXiv:2210.03050*, 2022. Eyke Hüllermeier, Johannes Fürnkranz, Weiwei Cheng, and Klaus Brinker. Label ranking by learning pairwise preferences. *Artificial Intelligence*, 172:1897–1916, 2008. Daniel Khashabi, Snigdha Chaturvedi, Michael Roth, Shyam Upadhyay, and Dan Roth. Looking beyond the surface: A challenge set for reading comprehension over multiple sentences. In *Proceedings of the* 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 252–262, 2018. Donald E Knuth. Permutations, matrices and generalized young tableaux. *Pacific Journal of Mathematics*, 34:709–727, 1970. Jan Koco, Igor Cichecki, Oliwier Kaszyca, Mateusz Kochanek, Dominika Szydo, Joanna Baran, Julita Bielaniewicz, Marcin Gruza, Arkadiusz Janz, Kamil Kanclerz, Anna Koco, Bartomiej Koptyra, Wiktoria Mieleszczenko-Kowszewicz, Piotr Mikowski, Marcin Oleksy, Maciej Piasecki, ukasz Radliski, Konrad Wojtasik, Stanisaw Woniak, and Przemysaw Kazienko. Chatgpt: Jack of all trades, master of none, 2023a. Jan Koco, Igor Cichecki, Oliwier Kaszyca, Mateusz Kochanek, Dominika Szydo, Joanna Baran, Julita Bielaniewicz, Marcin Gruza, Arkadiusz Janz, Kamil Kanclerz, Anna Koco, Bartomiej Koptyra, Wiktoria Mieleszczenko-Kowszewicz, Piotr Mikowski, Marcin Oleksy, Maciej Piasecki, ukasz Radliski, Konrad Wojtasik, Stanisaw Woniak, and Przemysaw Kazienko. Chatgpt: Jack of all trades, master of none, 2023b. R Kondor and M Barbosa. Ranking with kernels in fourier space. 2010. Risi Kondor and Walter Dempsey. Multiresolution analysis on the symmetric group. *Advances in Neural* Information Processing Systems, 25, 2012. Eric Lehman, Evan Hernandez, Diwakar Mahajan, Jonas Wulff, Micah J. Smith, Zachary Ziegler, Daniel Nadler, Peter Szolovits, Alistair Johnson, and Emily Alsentzer. Do we still need clinical language models?, 2023. Hector Levesque, Ernest Davis, and Leora Morgenstern. The winograd schema challenge. In *Thirteenth* International Conference on the Principles of Knowledge Representation and Reasoning, 2012. Patrick Lewis, Barlas Oğuz, Ruty Rinott, Sebastian Riedel, and Holger Schwenk. Mlqa: Evaluating crosslingual extractive question answering. *arXiv preprint arXiv:1910.07475*, 2019. Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. In *Text summarization branches* out, pp. 74–81, 2004. Chin-Yew Lin, Guihong Cao, Jianfeng Gao, and Jian-Yun Nie. An information-theoretic approach to automatic evaluation of summaries. In Proceedings of the Human Language Technology Conference of the NAACL, Main Conference, pp. 463–470, 2006. Stephanie Lin, Jacob Hilton, and Owain Evans. Truthfulqa: Measuring how models mimic human falsehoods. arXiv preprint arXiv:2109.07958, 2021. Xi Victoria Lin, Todor Mihaylov, Mikel Artetxe, Tianlu Wang, Shuohui Chen, Daniel Simig, Myle Ott, Naman Goyal, Shruti Bhosale, Jingfei Du, Ramakanth Pasunuru, Sam Shleifer, Punit Singh Koura, Vishrav Chaudhary, Brian O'Horo, Jeff Wang, Luke Zettlemoyer, Zornitsa Kozareva, Mona Diab, Veselin Stoyanov, and Xian Li. Few-shot learning with multilingual generative language models. In *Proceedings* of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 9019–9052, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https: //aclanthology.org/2022.emnlp-main.616. Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. *arXiv* preprint arXiv:1907.11692, 2019. Barrault Loïc, Biesialska Magdalena, Bojar Ondřej, Federmann Christian, Graham Yvette, Grundkiewicz Roman, Haddow Barry, Huck Matthias, Joanis Eric, Kocmi Tom, et al. Findings of the 2020 conference on machine translation (wmt20). In *Proceedings of the Fifth Conference on Machine Translation*, pp. 1–55. Association for Computational Linguistics" 2020. Tyler Lu and Craig Boutilier. Effective sampling and learning for mallows models with pairwise-preference data. *Journal of Machine Learning Research*, 2014a. Tyler Lu and Craig Boutilier. Effective sampling and learning for mallows models with pairwise-preference data. *Journal of Machine Learning Research*, 2014b. Louis Martin, Benjamin Muller, Pedro Javier Ortiz Suárez, Yoann Dupont, Laurent Romary, Éric de la Clergerie, Djamé Seddah, and Benoît Sagot. CamemBERT: a tasty French language model. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7203–7219, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.645. URL https: //aclanthology.org/2020.acl-main.645. Shikib Mehri and Maxine Eskenazi. Usr: An unsupervised and reference free evaluation metric for dialog generation. *arXiv preprint arXiv:2005.00456*, 2020. Andrew Morris, Viktoria Maier, and Phil Green. From wer and ril to mer and wil: improved evaluation measures for connected speech recognition. 01 2004a. Andrew Cameron Morris, Viktoria Maier, and Phil Green. From wer and ril to mer and wil: improved evaluation measures for connected speech recognition. In *Eighth International Conference on Spoken* Language Processing, 2004b. Jun-Ping Ng and Viktoria Abrecht. Better summarization evaluation with word embeddings for rouge. arXiv preprint arXiv:1508.06034, 2015. Joakim Nivre, Mitchell Abrams, Zeljko Agic, Lars Ahrenberg, Lene Antonsen, et al. Universal dependencies 2.2 (2018). *URL http://hdl. handle. net/11234/1-1983xxx. LINDAT/CLARIN digital library at the Institute* of Formal and Applied Linguistics, Charles University, Prague, http://hdl. handle. net/11234/1-1983xxx, 2018. Jekaterina Novikova, Ondřej Dušek, and Verena Rieser. Rankme: Reliable human ratings for natural language generation. *arXiv preprint arXiv:1803.05928*, 2018. OpenAI. Gpt-4 technical report, 2023. Karolina Owczarzak and Hoa Trang Dang. Overview of the tac 2011 summarization track: Guided task and aesop task. In *Proceedings of the Text Analysis Conference (TAC 2011), Gaithersburg, Maryland, USA,* November, 2011. Xiaoman Pan, Boliang Zhang, Jonathan May, Joel Nothman, Kevin Knight, and Heng Ji. Cross-lingual name tagging and linking for 282 languages. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1946–1958, 2017. Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In *Proceedings of the 40th annual meeting of the Association for Computational* Linguistics, pp. 311–318, 2002. Yifan Peng, Shankai Yan, and Zhiyong Lu. Transfer learning in biomedical natural language processing: An evaluation of BERT and ELMo on ten benchmarking datasets. In Proceedings of the 18th BioNLP Workshop and Shared Task, pp. 58–65, Florence, Italy, August 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-5006. URL https://aclanthology.org/W19-5006. Maxime Peyrard, Teresa Botschen, and Iryna Gurevych. Learning to score system summaries for better content selection evaluation. In *Proceedings of the Workshop on New Frontiers in Summarization*, pp. 74–84, 2017. Maxime Peyrard, Wei Zhao, Steffen Eger, and Robert West. Better than average: Paired evaluation of nlp systems. *arXiv preprint arXiv:2110.10746*, 2021. Jonas Pfeiffer, Naman Goyal, Xi Lin, Xian Li, James Cross, Sebastian Riedel, and Mikel Artetxe. Lifting the curse of multilinguality by pre-training modular transformers. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 3479–3495, Seattle, United States, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.255. URL https://aclanthology.org/2022.naacl-main.255. Mohammad Taher Pilehvar and Jose Camacho-Collados. Wic: the word-in-context dataset for evaluating context-sensitive meaning representations. *arXiv preprint arXiv:1808.09121*, 2018. Robin L Plackett. The analysis of permutations. Journal of the Royal Statistical Society: Series C (Applied Statistics), 24(2):193–202, 1975. Maja Popović. chrf++: words helping character n-grams. In *Proceedings of the second conference on machine* translation, pp. 612–618, 2017. Matt Post. A call for clarity in reporting BLEU scores. In *Proceedings of the Third Conference on Machine* Translation: Research Papers, pp. 186–191, Belgium, Brussels, October 2018. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/W18-6319. Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485–5551, 2020. Afshin Rahimi, Yuan Li, and Trevor Cohn. Massively multilingual transfer for ner. arXiv preprint arXiv:1902.00193, 2019. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions for machine comprehension of text. *arXiv preprint arXiv:1606.05250*, 2016. Tharindu Ranasinghe, Constantin Orasan, and Ruslan Mitkov. An exploratory analysis of multilingual word-level quality estimation with cross-lingual transformers. *arXiv preprint arXiv:2106.00143*, 2021. Ricardo Rei, Craig Stewart, Ana C Farinha, and Alon Lavie. Comet: A neural framework for mt evaluation. arXiv preprint arXiv:2009.09025, 2020. Ricardo Rei, José GC de Souza, Duarte Alves, Chrysoula Zerva, Ana C Farinha, Taisiya Glushkova, Alon Lavie, Luisa Coheur, and André FT Martins. Comet-22: Unbabel-ist 2022 submission for the metrics shared task. In *Proceedings of the Seventh Conference on Machine Translation (WMT)*, pp. 578–585, 2022. Machel Reid and Mikel Artetxe. PARADISE: Exploiting parallel data for multilingual sequence-to-sequence pretraining. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 800–810, Seattle, United States, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.58. URL https://aclanthology.org/2022.naacl-main.58. Ond rej Bojar, Christian Federmann, Mark Fishel, Yvette Graham, Barry Haddow, Matthias Huck, Philipp Koehn, and Christof Monz. Findings of the 2018 conference on machine translation (wmt18). In Proceedings of the Third Conference on Machine Translation, volume 2, pp. 272–307, 2018. Mario Rodríguez-Cantelar, Chen Zhang, Chengguang Tang, Ke Shi, Sarik Ghazarian, João Sedoc, Luis Fernando D'Haro, and Alexander Rudnicky. Overview of robust and multilingual automatic evaluation metrics for open-domain dialogue systems at dstc 11 track 4. *arXiv preprint arXiv:2306.12794*, 2023. Melissa Roemmele, Cosmin Adrian Bejan, and Andrew S Gordon. Choice of plausible alternatives: An evaluation of commonsense causal reasoning. In *2011 AAAI Spring Symposium Series*, 2011. Sebastian Ruder. Challenges and Opportunities in NLP Benchmarking. http://ruder.io/ nlp-benchmarking, 2021. João Sedoc and Lyle Ungar. Item response theory for efficient human evaluation of chatbots. In *Proceedings* of the First Workshop on Evaluation and Comparison of NLP Systems, pp. 21–33, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.eval4nlp-1.3. URL https: //aclanthology.org/2020.eval4nlp-1.3. Thibault Sellam, Dipanjan Das, and Ankur P Parikh. Bleurt: Learning robust metrics for text generation. arXiv preprint arXiv:2004.04696, 2020. Nihar B. Shah, Sivaraman Balakrishnan, Adityanand Guntuboyina, and Martin J. Wainwright. Stochastically transitive models for pairwise comparisons: Statistical and computational issues. IEEE Transactions on Information Theory, 2017. ISSN 00189448. doi: 10.1109/TIT.2016.2634418. Eric Sibony, Stéphan Clémençon, and Jérémie Jakubowicz. Mra-based statistical learning from incomplete rankings. In *International Conference on Machine Learning*, pp. 1432–1441. PMLR, 2015. Matthew Snover, Bonnie Dorr, Richard Schwartz, Linnea Micciulla, and John Makhoul. A study of translation edit rate with targeted human annotation. In *Proceedings of association for machine translation in the* Americas, number 6. Cambridge, MA, 2006. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pp. 1631–1642, 2013. Aarohi Srivastava, Abhinav Rastogi, Abhishek Rao, Abu Awal Md Shoeb, Abubakar Abid, Adam Fisch, Adam R Brown, Adam Santoro, Aditya Gupta, Adrià Garriga-Alonso, et al. Beyond the imitation game: Quantifying and extrapolating the capabilities of language models. *arXiv preprint arXiv:2206.04615*, 2022. Lars St, Svante Wold, et al. Analysis of variance (anova). *Chemometrics and intelligent laboratory systems*, 6 (4):259–272, 1989. Guillaume Staerman, Pavlo Mozharovskyi, Stéphan Clémençon, and Florence d'Alché Buc. Depth-based pseudo-metrics between probability distributions. *arXiv e-prints*, pp. arXiv–2103, 2021. Peter Stanchev, Weiyue Wang, and Hermann Ney. EED: Extended edit distance measure for machine translation. In *Proceedings of the Fourth Conference on Machine Translation (Volume 2: Shared Task* Papers, Day 1), pp. 514–520, Florence, Italy, August 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-5359. URL https://www.aclweb.org/anthology/W19-5359. R P Stanley. *Enumerative Combinatorics*. Wadsworth Publishing Company, 1986. ISBN 0-534-06546-5. Miloš Stanojević, Amir Kamran, Philipp Koehn, and Ondřej Bojar. Results of the wmt15 metrics shared task. In *Proceedings of the Tenth Workshop on Statistical Machine Translation*, pp. 256–273, 2015. Balázs Szörényi, Róbert Busa-Fekete, Adil Paul, and Eyke Hüllermeier. Online rank elicitation for plackett-luce: A dueling bandits approach. *Advances in Neural Information Processing Systems*, 28, 2015. Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multitask benchmark and analysis platform for natural language understanding. *arXiv preprint arXiv:1804.07461*, 2018. Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Superglue: A stickier benchmark for general-purpose language understanding systems. *arXiv preprint arXiv:1905.00537*, 2019. Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. Neural network acceptability judgments. *Transactions of the Association for Computational Linguistics*, 7:625–641, 2019. Herbert S. Wilf. *East Side, West Side . . . - an introduction to combinatorial families-with Maple programming*. arxiv, 1999. Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. *arXiv preprint arXiv:1704.05426*, 2017a. Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. *arXiv preprint arXiv:1704.05426*, 2017b. Yinfei Yang, Yuan Zhang, Chris Tar, and Jason Baldridge. Paws-x: A cross-lingual adversarial dataset for paraphrase identification. *arXiv preprint arXiv:1908.11828*, 2019. Peter Young, Alice Lai, Micah Hodosh, and Julia Hockenmaier. From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions. Transactions of the Association for Computational Linguistics, 2:67–78, 2014. Sheng Zhang, Xiaodong Liu, Jingjing Liu, Jianfeng Gao, Kevin Duh, and Benjamin Van Durme. Record: Bridging the gap between human and machine commonsense reading comprehension. arXiv preprint arXiv:1810.12885, 2018. Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. Bertscore: Evaluating text generation with bert. *arXiv preprint arXiv:1904.09675*, 2019a. Yuan Zhang, Jason Baldridge, and Luheng He. Paws: Paraphrase adversaries from word scrambling. arXiv preprint arXiv:1904.01130, 2019b. Wei Zhao, Maxime Peyrard, Fei Liu, Yang Gao, Christian M Meyer, and Steffen Eger. Moverscore: Text generation evaluating with contextualized embeddings and earth mover distance. *arXiv preprint arXiv:1909.02622*, 2019. Giulio Zhou and Gerasimos Lampouras. Webnlg challenge 2020: Language agnostic delexicalisation for multilingual rdf-to-text generation. In *Proceedings of the 3rd International Workshop on Natural Language* Generation from the Semantic Web (WebNLG+), pp. 186–191, 2020. Pierre Zweigenbaum, Serge Sharoff, and Reinhard Rapp. Overview of the second bucc shared task: Spotting parallel sentences in comparable corpora. In Proceedings of the 10th Workshop on Building and Using Comparable Corpora, pp. 60–67, 2017. Pierre Zweigenbaum, Serge Sharoff, and Reinhard Rapp. Overview of the third bucc shared task: Spotting parallel sentences in comparable corpora. In *Proceedings of 11th Workshop on Building and Using Comparable* Corpora, pp. 39–42, 2018. ## Appendices | A | Extended Related Work and Other Baselines methods | 20 | | |-----|-------------------------------------------------------|------|----| | A.1 | More on missing data in NLP | 20 | | | A.2 | Why not directly imputing data in the score? | | 20 | | A.3 | Other ideas of future work | 20 | | | A.4 | More on the technical contribution of the algorithm. | | 21 | | A.5 | Extended Limitations and Perspective for future works | 21 | | | B | Ethical Statement & Limitation of our work | 21 | | |------------------------------------|-------------------------------------------------------------|------|----| | C | Dataset Description | 21 | | | C.1 | Task Level Information | 21 | | | C.2 | Instance Level Information | | 22 | | C.3 | Data Statistics | | 22 | | D Additional Real-Data Experiments | 22 | | | | D.1 | Example of Ranking with missing data on XTREM | 23 | | | D.2 | Additional Robustness Experiment on task level datasets | 23 | | | D.3 | Additional Robustness Experiment on instance level datasets | | 24 | | D.4 | Additional Confidence Analysis on Task Level | 26 | | | E | On the Rankings | 27 | | | E.1 | Borda Count on permutations (in vector notation) | | 27 | | E.2 | Borda Count on permutations in pairwise matrix notation | 27 | | | E.3 | Generating all compatible rankings | 28 | | | E.4 | Proof of uniformity | 28 | | ## A Extended Related Work And Other Baselines Methods A.1 More On Missing Data In Nlp. Another approach to handling missing data in benchmarks would be to create new datasets, however, it can be a sluggish, costly, and expertise-demanding process (see footnote 5 in Lin et al. (2021)). Moreover, there are situations where collection becomes infeasible, such as when working with private datasets, calling for the need to develop tools that can rank systems with missing scores. ## A.2 Why Not Directly Imputing Data In The Score? Directly imputing values as scores is not the current practice in NLP. In fact, this approach would be inadequate due to potential variations in metric scale and difficulty, leading to a failure in accurately capturing task difficulty (as mentioned above and in Dolan & Brockett (2005)). To illustrate this to we present some experiments. ![19_image_0.png](19_image_0.png) Figure 7: **Imputation methods are not robust to scaling**. To further compare the ranking, we corrupt the scores of a given task by re-scaling them by a factor λ. Whereas it does not affect our ranking procedure (every ranking induced by a task-instance pair remains the same), it increasingly perturbs the mean aggregation and other imputation procedures as λ increases. ˜ σmed corresponds to the median imputation and σ˜µ corresponds to the mean imputation. ![19_image_1.png](19_image_1.png) Figure 8: Additional Instance-Level Robustness Experiment (see Figure 13). We evaluate the robustness of our proposed aggregation methods, namely σ 2l, σl, and the mean aggregation method σ µ, by randomly removing a proportion η of all instances on a specific task for a specific system. ## A.3 Other Ideas Of Future Work In the future, we would like to explore several refinements of the method: - **Impact of the inter-task correlation**. The task correlation can impact the choice of the best system. In the future, we would like to study the impact of the choice of the ranking procedure in depth. - **Impact of misleading evaluation**. Evaluation in NLP can be noisy due to the variety in language and lack of metric robustness Al Sharou et al. (2021); Rodríguez-Cantelar et al. (2023). Future work will include the consideration of this factor when choosing the aggregation method. - Comparison with the ANOVA method St et al. **(1989)**. Although this is slightly outside the scope of the paper, we would like to compare our confidence interval with the one obtained with the ANOVA method. ## A.4 More On The Technical Contribution Of The Algorithm. Our technical contribution boils down to extending the Borda aggregation to the case of missing data (aka incomplete rankings). In the ranking literature, two types of approaches can be identified to deal with partial rankings: Relying on top-k rankings. In this case, all the systems are evaluated but only those that are ranked in the first k positions are provided. There are many methods to aggregate and all in this setting, for example, Ailon (2010). This is different from our scenario where some systems cannot be evaluated on particular tasks. Relying on incomplete rankings. In this case, only k systems are evaluated on a specific task. This fits our scenario. Rank aggregation/statistical analysis in the case of k=2 is called pairwise ranking and is well handled by the literature Knuth (1970); Lu & Boutilier (2014a); Plackett (1975); Popović (2017); Zhang et al. (2018). These approaches are limited and only use pairwise comparisons which can lead to paradoxes when ranking more systems. In this paper, we introduce an aggregation procedure for arbitrary values of k. Our main technical contribution is to extend the Borda aggregation to incomplete rankings. To the best of our knowledge, this is the only paper dealing with aggregation -not specifically Borda- of incomplete rankings. ## A.5 Extended Limitations And Perspective For Future Works The initial limitation we pinpoint is the task's reliance on the noise model applied to the data, which affects the outcomes. In an extreme scenario where a system lacks all measures, our method might not consistently rank it. Additional edge cases could be investigated, such as a system being poor in only one task with missing data, leading to potentially misleading ranking. To address this, we introduced the confidence interval in Section 3.3, supported by results in Section 5.4, to effectively recognize such challenging scenarios. It's important to highlight that these edge cases can impact all ranking procedures involving missing data. Another limitation pertains to our ranking procedure's lack of consideration for user preferences regarding tasks. For instance, a user might emphasize certain tasks, such as A, D, and H, with task A carrying greater importance than the others. A natural approach to address this issue involves adopting a weighted variation of the Borda count or drawing inspiration from Dwork et al. (2001). Although this avenue remains unexplored within our current work, it holds promise as a captivating direction for future investigations. ## B Ethical Statement & Limitation Of Our Work It is important to consider the potential ethical implications and limitations of our work. One ethical concern is the potential bias in the reranking process, as the selection of the "best" hypothesis may favor certain perspectives or reinforce existing biases present in the training data. Care should be taken to ensure fairness and mitigate any potential bias before applying our methods. ## C Dataset Description C.1 Task Level Information We provide additional details on the data collection for Task Level Information. We gathered data from four benchmark studies, namely GLUE (General Language Understanding Evaluation) Wang et al. (2018), SGLUE (SuperGLUE) Wang et al. (2019) 1, XTREME Hu et al. (2020) and GEM. In the GLUE dataset, there were a total of 105 systems evaluated across nine different tasks: CoLA, SST-2, MRPC, STS-B, QQP, MNLI, QNLI, RTE, and WNLI Warstadt et al. (2019); Socher et al. (2013); Dolan & Brockett (2005); Cer et al. (2017); Rajpurkar et al. (2016); Williams et al. (2017b); Dagan et al. (2005); Giampiccolo et al. (2007); Bentivogli et al. (2009); Levesque et al. (2012). The SGLUE dataset consisted of 24 systems evaluated on 10 different tasks: BoolQ, CB, COPA, MultiRC, ReCoRD, RTE, WiC, WSC, AX-b, and AX-g Clark et al. (2019); De Marneffe et al. (2019); Roemmele et al. (2011); Khashabi et al. (2018); Zhang et al. (2018); Levesque et al. (2012); Pilehvar & Camacho-Collados (2018). The XTREME benchmark comprised 15 systems and included tasks such as sentence classification (XNLI and PAXS-X), structured prediction (Universal Dependencies v2.5 and Wikiann), sentence retrieval (BUCC and Tatoeba), and question answering (XQuAD, MLQA, TyDiQA-GoldP) Conneau et al. (2018); Williams et al. (2017a); Yang et al. (2019); Zhang et al. (2019b); Nivre et al. (2018); Rahimi et al. (2019); Pan et al. (2017); Zweigenbaum et al. (2018; 2017); Artetxe & Schwenk (2019); Artetxe et al. (2019); Rajpurkar et al. (2016); Lewis et al. (2019); Clark et al. (2020). Each benchmark employed a variety of metrics with different scales, including accuracy, f1, and correlation. Additionally, the GEM benchmark involved 22 systems evaluated using diverse metrics such as prediction length, vocabulary size, entropy, Rouge, NIST, Bleu', Meteor', Bleurt, Nubia, and Bertscore. ## C.2 Instance Level Information In this particular setting, our primary focus is on evaluating the performance of natural language generation (NLG) systems, as these scores are among the easiest to collect. We concentrate on five different tasks: summary evaluation, image description, dialogue, and translation. For *summary evaluation*, we utilize the TAC08 Dang et al. (2008), TAC10, TAC11 Owczarzak & Dang (2011), RSUM Bhandari et al. (2020), and SEVAL Fabbri et al. (2021) datasets. Regarding *sentence-based image description*, we rely on the FLICKR dataset Young et al. (2014). For *dialogue*, we make use of the PersonaChat (PC) and TopicalChat (TC) datasets Mehri & Eskenazi (2020). For the translation part, we added datasets from WMT15 Stanojević et al. (2015), WMT16 Bojar et al. (2016), WMT17 Bojar et al. (2017), WMT18 rej Bojar et al. (2018), WMT19 Barrault et al. (2019), WMT20 Loïc et al. (2020), and WMT21 Farhad et al. (2021) in several languages such as en, ru, ts, and others. For all datasets except MLQE, we consider automatic metrics based on S3 (both variant pyr/resp) Peyrard et al. (2017), ROUGE Lin (2004) (including five of its variants Ng & Abrecht (2015)), JS [1-2] Lin et al. (2006), Chrfpp Popović (2017), BLEU, BERTScore Zhang et al. (2019a), and MoverScore Zhao et al. (2019). For the MLQE dataset, we solely consider several versions of BERTScore, MoverScore, and ContrastScore. Additionally, we incorporate human evaluation, which is specific to each dataset. ## C.3 Data Statistics To give to the reader a better sense of the richness of our benchmark, we report in Fig. 9 the statistics on our dataset. We demonstrate a diverse distribution of system counts across various datasets, ranging from a minimum of 2 systems to a maximum of 60 systems. Regarding the total number of sentences (instances) and the average number per system, as depicted in Fig. 10 and Fig. 11, the smaller datasets consist of several hundred sentences in total, while the larger datasets encompass up to several hundred thousand sentences in total. ## D Additional Real-Data Experiments In this dedicated section, we aim to provide curious readers with a deeper understanding of the capabilities of our methods by presenting additional figures and experimental results. Through these supplementary materials, we intend to shed more light on the effectiveness and potential of our approaches, enabling readers to gain valuable insights into our methods. 1Results can be accessed at https://super.gluebenchmark.com/ ## D.1 Example Of Ranking With Missing Data On Xtrem In this section, we aim to illustrate the distinction between different rankings obtained using σ l and σ µ on XTREM dataset for a specific noise realization. Using Tab. 5, we obtain the following rankings: - σ l gives the following ranking : M0 > M3 > M2 > M1 > M7 > M5 > M4 > M8 > M9 - σ µ gives the following ranking : M7 > M4 > M0 > M6 > M9 > M2 = M3 > M1 > M8 > M5. We can see that the two methods disagree on the best systems in this case. However, as can be seen in our experiments, the ranking-based method is more robust. | Model | Classification | Structured Prediction | Question Answering | Sentence Retrieval | | |---------|------------------|-------------------------|----------------------|----------------------|------| | M0 | 90.3 | | X | 76.3 | 93.7 | | M1 | 90.1 | | X | 75.0 | X | | M2 | 89.3 | | 75.5 | 75.2 | 92.4 | | M3 | 89.0 | | 76.7 | 73.4 | 93.3 | | M4 | 88.3 | | X | X | X | | M5 | X | | X | X | X | | M6 | 87.9 | | 75.6 | X | 91.9 | | M7 | X | | X | X | 92.6 | | M8 | X | | 75.4 | X | X | | M9 | 88.2 | | 74.6 | X | 89.0 | Table 5: XTREM dataset with 10 systems and 18 missing values (η = 0.45) ![22_image_0.png](22_image_0.png) ## D.2 Additional Robustness Experiment On Task Level Datasets In this section, we report additional experiments on the task level robustness. Figure 12: GEM D.3 Additional Robustness Experiment on instance level datasets In this section, we report additional experiments on the instance level robustness. ![24_image_0.png](24_image_0.png) ![24_image_1.png](24_image_1.png) ![24_image_2.png](24_image_2.png) 1.0 0.8 0.6 0.4 0.2 0.0 ![24_image_3.png](24_image_3.png) 1.0 0.8 0.6 ![24_image_4.png](24_image_4.png) 0.4 0.2 0.0 (t) WMT21 florestest ![24_image_5.png](24_image_5.png) hi-bn ![24_image_6.png](24_image_6.png) ![25_image_0.png](25_image_0.png) ![25_image_1.png](25_image_1.png) ![25_image_2.png](25_image_2.png) ![25_image_3.png](25_image_3.png) Figure 13: Instance-Level Robustness Experiment. We evaluate the robustness of our proposed aggregation methods, namely o21, o1, and the mean aggregation method o4, by randomly removing a proportion η of all instances on a specific task for a specific system. Each experiment is repeated 100 times for each proportion. ## D.4 Additional Confidence Analysis On Task Level In this section, we present additional experiments conducted on four instance-level datasets. We computed confidence intervals for the instance-level, similar to the approach used in Section Ssec. 5.4. Consistent with the main findings in the paper, our observations reveal that closer performance among systems is indicated near the diagonal and we can clearly observe group of systems. This analysis of confidence intervals provides valuable insights into the relative performance of different systems. ![26_image_0.png](26_image_0.png) Figure 14: Confidence intervals for various instance level datasets with η = 0.2 and δ = 0.01 ## E On The Rankings This section gathers technical considerations on the ranking methods used in our algorithm. ## E.1 Borda Count On Permutations (In Vector Notation) Remark 2. *The Borda count is a ranking system that aggregates a set of permutations* σ 1*, . . . , σ*L ∈ SN by summing the ranks of each system and then ranking the obtained sums. The procedure is as follows: $$1.\,\,\,C o p u t e\,\operatorname*{sum}_{n}:=\sum_{l=1}^{L}\sigma_{n}^{l}\,\,\,{\mathrm{for~every~}}1\leq n\leq N,$$ 2. Output σ := Borda(σ 1, . . . , σL) ∈ SN *that ranks the sums,* sumn (argsort(argsort(sum1*, . . . ,*sumT ))). ## E.2 Borda Count On Permutations In Pairwise Matrix Notation In Sssec. 3.2.1 we argue that a ranking σ ∈ SN can also be written as a pairwise matrix and in Sssec. 3.2.2 and Sssec. 3.2.3 we further elaborate on how to write ranking data-set D in pairwise matrix form MD ∈ [0, 1]N×N . Under this notation, the final aggregated ranking σ for the Borda count algorithm can be shown to be equivalent to the permutation that sorts the sum of the columns in MD, $$\sigma=a r g s o r t\left(a r g s o r t\left[\sum_{i}M_{i,0}^{D},\cdots,\sum_{i}M_{i,N}^{D}\right]\right).$$ i,N #! . (5) $$\left(5\right)$$ ## E.3 Generating All Compatible Rankings In this section, we detail the computation of the Mπ i,j when item i is not evaluated and item j is evaluated. Let us fix some notation first. For the following, k is the number of observed systems in π, item i is not evaluated, item j is evaluated and r is the (partial) rank of item j. Under this setting, we set Mπ i,j = p(*n, k, r*), i.e., the proportion of compatible rankings that rank i before j when π has k items. The closed-form expressions for these quantities are given in Eq. 6. Here we note that t(*n, k*) is the total number of rankings of n items compatible with π, S a b is the number of shuffles of two lists of lengths a and b and V a bdenotes the variations of a out of b items, i.e., the number of possible arrangements of selections of a objects out of b, where the order of the selected objects matters. $$\begin{array}{l}{{p(n,k,r)=\sum_{i=0}^{n-k-1}V_{n-k-1}^{i}*(i+1)*S_{i+1}^{r}(n-k-i-1)!*S_{k-r-1}^{n-k-i-1}/t(n,k)}}\\ {{\ }}\\ {{t(n,k)=(n-k)!*S_{n-k}^{k}}}\\ {{\ }}\\ {{S_{b}^{a}=(a+b)!/(a!+b!)}}\\ {{\ }}\\ {{V_{b}^{a}=a!/(b-a)!}}\end{array}$$ $$({\mathfrak{f}}{\mathfrak{h}})$$ Remark 3. A naive algorithm for generating the matrix Mπfrom σ ∈ SN−rtk would have factorial complexity and it is thus exorbitant in practice for a relatively small number of systems, say N > 10*. However, our* solution has a complexity of O(n 3) *and can be precomputed once at the beginning of the benchmarking process* to efficiently generate the pairwise matrix Mπ*from partial ranking* π. ## E.4 Proof Of Uniformity In this section, we give the intuition and the proof for Eq. 6. This section follows a classic strategy on Enumerative Combinatorics Stanley (1986); Wilf (1999): if we can define an algorithm to generate compatible permutations uniformly at random (such as that in Algorithm 2), we can easily adapt it to count those permutations to yield an efficient counting expression, as we do in Eq. 6. We start by introducing 2 basic operations of *permute* and *shuffle*, along with the number of possible outcomes of these operations. Permute a list - *permute*(l) Given a list of n objects, generate a permutation of these items. There are n! possible ways of permuting n items. An efficient way for generating random permutations is the Fisher-Yates-Knuth algorithm Knuth (1970). Shuffle two lists - shuffle(*A, B*) Given two disjoint lists of distinct elements *A, B* of lengths *a, b* respectively, generate a permutation σ of the two lists of length a + b in such a way that the relative order of the items in the lists A and B is respected in σ. This name and idea is based on the popular way of shuffling two decks of cards Bayer & Diaconis (1992). Its easy to see that Algorithm 1 generates every possible shuffling with equal probability. The total number of shuffles of lists *A, B* is given in Eq. 6 as S a b . Algorithm 1: Generate a random shuffle of lists A and B 1 for i ∈ [a + b] do 2 *rand* ← random number in [0, 1]; 3 if rand > 0.5 ∨ B is empty ∧ *A is non empty* **then** 4 σ(i) = pop(A); 5 **else** 6 σ(i) = pop(B); 7 end 8 end Counting complete, compatible rankings At this point, we are ready to detail the expression of p(*n, k, r*) in Eq. 6, both the intuition and the proof of uniformity. For this, we propose in Algorithm 2 to sample complete, compatible rankings and then adapt this sampling algorithm to a counting algorithm in Theorem 1. Notation We start by fixing the notation. Let β be a partial ranking of length k which includes item j in rank r, β1 . . . βr = j *. . .* βk. Let η be a disjoint set of n − k items that have not been ranked and which includes the unobserved item i. The goal is to generate (i) a compatible ranking with β (a ranking σ of all the items in such a way that the relative ordering of the items of β is maintained) and (ii) which ranks item i before item j. We denote the "s-head" of a list to the items in the first s positions in that list. Intuition We are now ready to explain the intuition. Each of the possible compatible permutations that rank i before j is generated in the following way: Algorithm 2 generates permutations that rank item j at position s, item i before j and we iterate for all possible values of s. First, in line line 2 we select s − 1 items randomly from η, where the order of the items matter (i.e., a variation). Then, we insert item i in a random position of this list, denoted η*head* in line 3. In line 4 we shuffle these two lists, i.e., η*head* and the r−head of β, β*head*, i.e., the sublist with the items that are ranked before j. The result of the shuffling process is the s + r-head of the output permutation σ. We permute the rest of the unobserved items denoting these list η*tail*, in line 6. Finally, we shuffle this list η*tail* and the k − r-tail of η in line 7. The result of this shuffle is the tail of σ. Finally, in line 8 we return the concatenation of σhead, j, σ*tail*, which is clearly a compatible permutation with β as the relative order of the items in β is maintained in the output. Algorithm 2: Generate a random ranking among those compatible with β 1 for s ∈ [n] do 2 η*head* ← s − 1 items from η where the order matters ; 3 η*head* ← insert i in η*head* ; 4 σ*head* ← shuffle(ηhead, β*head*) ; 5 ηtail ← η \ η*head* ; 6 η*tail* ← permute(η*tail*) ; 7 σ*tail* ← shuffle(ηtail, β*tail*) ; 8 **return** (σhead j σ*tail*) ; 9 end It is easy to see that Algorithm 2 generates the target permutations uniformly at random. Following a classic strategy on Enumerative Combinatorics Stanley (1986); Wilf (1999) we use this algorithm as a proof for p(*n, k, r*). Theorem 1. The number of complete permutations of n items compatible with partial ranking β that rank the unobserved item i before the observed item j *is given by the following expression,* $$p(n,k,r)=\sum_{i=0}^{n-k-1}V_{n-k-1}^{i}*(i+1)*S_{i+1}^{r}(n-k-i-1)!*S_{k-r-1}^{n-k-i-1}/t(n,k).$$ Proof. It is easy to see that in Algorithm 2 there is a bijection between the permutations in the target (that is, the permutations compatible with β for which i j) and each outcome of Algorithm 2. Clearly, for uniform at random outcomes of the *shuffle* and *permute* operations, the outcome of Algorithm 2 will be random as well. Therefore, the number of possible outcomes of the algorithm equals the number of permutations in the target. It follows that each term in p(*n, k, r*) Each term in the previous expression comes from a different line in 2: - Line 2: The number of variations of i items out of n − k − 1 is V i n−k−1 . - Line 3: There are s + 1 ways of inserting item i, thus the term (r + 1). - Line 4: There are S r s+1 ways of shuffling η*head* and β*head*. - Line 6: There are (n − k − s − 1)! possible permutations of the items in η*tail*. - Line 7: There are S n−k−s−1 k−r−1 ways of shuffling the two tails. - Line 8: Finally, we compute the proportion by dividing among the total number of compatible permutations. By repeating this process for all *s < n* − k − 1 the proof is completed. ![30_image_0.png](30_image_0.png) 31 ![31_image_0.png](31_image_0.png) 32 ![32_image_0.png](32_image_0.png) 33
Review 1: Summary: The paper tackles an existing problem in benchmarks of any ml systems: benchmarking with missing scores. The proposed method utilizes a compatible partial ranking approach to impute missing data, which is then aggregated using the Borda count method. The method considers both task-level and instance-level scenarios as some datasets only come with task-level. It introduces an extended benchmark. Confidence analysis, agreement, robustness experiment and analysis are provided to validate the proposed method. Strengths and Weaknesses: Strength The paper tackles a problem with potentially large impact in the era of LLMs. As mentioned (Lin 2022, Martin 2020), it has been a rising issue in the LLM community, and almost no solution was proposed to address it. The approach, a combinatorial approach for inputing missing data in partial rankings, is novel. It provides solid theoristic explanation and proof. The application of partial order in ranking can successfully impute the missing entries. The experiments cover a good number of datasets and benchmarks and both task-level and instance-level settings. Weakness The paper heavily adopts the framework, setting, illustration and writing style from Colombo et al 2022b. The paper itself is not quite self-contained. Colombo 22b is almost a prerequisite for this paper. I hope that this paper could provide necessary background rather than just " similar to that in the previously mentioned work". For example, what's the operator "x" in equation 1? For example, what's the benchmark of 250K scores. Concern of the release of results, code lib, and benchmark. I am not very confident in the release of these outcomes. The previous paper Colombo 22b does have a github page (https://github.com/PierreColombo/RankingNLPSystems) but it doesn't seem to be very carefully maintained and widely adopted. The paper alongwith Colombo 22b is rooted in the ranking idea, which means the relative difference is not captured. I am concerned if this direction will be widely adopted. Sometimes we know a model like GPT-4 is better than many models but people are more curious how large is the gap. Some issues mentioned in the question: explanation of baseline, notation, missing examples, etc. Requested Changes: Questions Figure 1: “Fig. 1 illustrates the general framework (i.e., with instance and system level).” I found this figure pretty similar to the Figure 1 in Colombo 2022b. It’s fine if they are sharing the common diagram and conceptual framework, but I don’t see how the idea of this paper is illustrated in this figure. The missing entries are “X” and then the final ranking can still be calculated with an arrow with “task-level aggregation”. Besides, the colors of instance-level and task-level aggregation are similar and might not be easily to read. Question: 2.3 Mean aggregation: I don’t quite understand the nested argsort in sigma^{mu} in the task level definition. Why use a combinatorial approach? “I”mputing Need further explanation on baseline approch. "we consider a baseline approach that ignores missing data and relies on mean aggregation. This approach has been used in previous studies" There is no even description about this baseline approach in this paper. And "we will refer to it as σ^μ" what's the reason of using this notation since it's been used in the paper already for notation? A running example of 3.2.1 and 3.2.2 would be very helpful for the audience. I won't expect everyone to understand this approach without some real examples. Transparency and readability are critical in building a tool like this. There is one example on XTREM dataset in D.1 Table 5. If the authors can extend it to 3.2, it would be great. What are the 250K scores and 131M scores? Are they based on GLUE, SGLUE, XTREM and GEM? Are they going to be public? 3.2.1 Matrix representation of the rankings. Can you provide more examples or explanation about "efficiently building"? For example, why M=0.5 is a "natural choice" if no information is provided for either system i or system j in π but for case #3, the solution is different. In figure 3, it seems the lines are converging in 0.3. What if there are even more missing data? Is the baseline going to be better in that case? And why blue dotted (thinnest) is ~0.9 when 0? Broader Impact Concerns: Complicatedness and outreach of this paper. Although the paper builds a solution for missing data issue in benchmarking, it is conceptually complicated and I am not sure if it will be used at the end of the day. ================================================== Review 2: Summary: Nowadays, models are often evaluated on many different tasks. In practice, however, not all models have evaluation results on all tasks. This paper aims at benchmarking different models with missing evaluation results. The authors propose to leverage compatible partial ranking to compare models based on different aggregation methods. The proposed approach can be used when either task-level or instance-level scores are missing. Results on a newly collected benchmark demonstrate that the proposed approach is more reliable and robust. Strengths and Weaknesses: Strengths: 1. The study of benchmarking systems with missing evaluation results is interesting and challenging. 2. The authors propose a simple solution based on compatible partial ranking, which shows improved reliability compared to trivial baselines. 3. The authors collected a new benchmark with 131 million scores for such a study. Weaknesses: 1. In the era of LLMs, most studies actually compare different LLMs with full evaluation results. The significance of this paper is somewhat unclear. 2. Paper presentation and method description could be improved. 3. Important ablations are missing. Requested Changes: 1. The citation format doesn’t follow TMLR, which should be improved. 2. When building the matrix representation, particularly in case 3 at page 5, to what extent the probability depends on the number of available systems? Does this affect the robustness? 3. How did you compute $\sigma^\mu$? Did you simply drop the missing data and only compute the shared evaluations? 4. Throughout the experiments, the authors only explored the impact of $\eta$ on the ranking correlation. However, the number of systems, tasks and instances are important factors, which impact is missing! Ideally, I would like to see a result showing how the averaged correlation over different $\eta$s change when varying these factors. 5. More importantly, a lot of LLMs actually achieve similar performance. It’s more significant to compare top-performing systems where they have very close performance. In this case, how does the proposed method work? Broader Impact Concerns: I didn't see any serious issues. ================================================== Review 3: Summary: This work proposes a method to aggregate the scores from the benchmark tasks and produce an overall evaluation score for some NLP (I guess, mostly LLM) systems. The underlying assumption is that some of the tasks in the benchmark dataset are difficult for some LLM systems to run. With the proposed aggregation method, this work compares its performance against the mean aggregation methods on synthetic and real-world datasets. Strengths and Weaknesses: **Strengths** - The task is interesting, and the proposed method seems solid from a theoretical perspective. - The evaluation results demonstrate the method has merits in certain aspects, such as robustness. **Weaknesses** This is an interesting work. I realized that as soon as one accepts that the research topic is meaningful and worth studying, the rest of this paper (especially the methodology section) becomes natural. Therefore, I would like to start my comments from the very beginning. - First of all, the question of missing scores is definitely a valid question. However, I am wondering whether it's necessary to impute the missing values or come up a better strategies to aggregate those scores. I guess the underlying assumption of this work is that all tasks are important, and to get a better understanding of an LLM's capability, we HAVE TO evaluate this LLM on all tasks. Again, I am wondering whether this is true or necessary. In other words, I am wondering about the value of running LLMs on tens, hundreds, or even thousands of tasks and to what extent these expensive evaluation tasks can help us understand LLMs better. The answer will help me better understand the value of the research in this work. Because if we don't have a convincing answer that we have to test LLMs on each individual task, maybe ignoring some tasks like those suggested in prior work is not a bad idea. - Assume I accept the assumption that aggregating scores is important. The evaluation seems to focus on the difference between the proposed method and the average aggregation method. The question is that, since we can do control experiments (by artificially removing some scores), why not we compare the ranking produced by the proposed method against the ground-truth ranking, and see how close they are? - In addition, in some cases, people may only be interested in the top of a rank, something similar to top-K in information retrieval. Although results like Table 2 provide some relevant information, those tables are more about the difference between the proposed method and the average aggregation method instead of the overlap with the ground-truth ranking list. - Last, a detailed question: How exactly does the function `argsort` work? It does not make sense if it works the way `numpy.argsort` does. It also does not make much sense if we interpret it as "the permutation that sorts the items in $$u$$" (the definition in the paper); at least the outer `argsort` in the equation does not make much sense in this interpretation. Requested Changes: - I would like to see a discussion about the value of this research topic that addresses the questions that I raised in the comments - If necessary, add more experiments by comparing against the ground-truth results rather than just the average aggregation results. I understand on some datasets, it is impossible to get the "ground truth", therefore some control experiments are acceptable. - Some clarification about the detailed question mentioned in the comments. Broader Impact Concerns: No ================================================== Metareview: Recommendation: Reject Comment: This is an interesting paper tackling a timely problem with a simple, well-motivated method that's effective for the task at hand. However, the reviewers had several concerns about this paper, largely about the premise of the work. The work mentions multiple contributions in the introduction, of which I think two fail to be supported: **Introducing a new problem with a direct impact on NLP research**: Reviewers find this lacking. CPCJ doesn't quite see the value, as many real-world evaluation studies are conducted by simply running all the relevant LLMs on all the relevant tasks. GV1j acknowledges there may be value in handling missing data, but is there a lot of value in producing aggregate rankings over tons of tasks? My interpretation of this: the methods here make sense when you have a lot of tasks to run on. In a world where LLMs are more specialized to individual tasks/domains, it's easy to imagine that producing a single system ranking over a large collection of tasks doesn't make sense. **A novel method for benchmarking NLP systems with missing system scores**: The reviewers raise some concerns about the evaluation (discussed a bit below). Furthermore, I will say that the mean method of aggregation is very naive and feels a bit like a strawman baseline. If different systems were missing different datasets, I feel that most practitioners would think to apply some kind of correction factor for this, even if something simple like converting benchmark scores into z-scores based on the mean and standard deviation among systems. Expanding on the evaluation of the proposed method, CPCJ brings up some very relevant concerns: > When building the matrix representation, particularly in case 3 at page 5, to what extent the probability depends on the number of available systems? Does this affect the robustness? > Throughout the experiments, the authors only explored the impact of $\eta$ on the ranking correlation. However, the number of systems, tasks and instances are important factors, which impact is missing! Ideally, I would like to see a result showing how the averaged correlation over different $\eta$s change when varying these factors. > More importantly, a lot of LLMs actually achieve similar performance. It’s more significant to compare top-performing systems where they have very close performance. In this case, how does the proposed method work? As a result, I think the claims about the effectiveness and impact of the method fail to be fully supported. In my view, the most important elements to resolve here are motivating the task better, exploring the impact of factors beyond $\eta$, and possibly engaging with other baselines as appropriate. Other more minor formatting concerns were raised, and the dependence on Colombo et al. was noted, which could also be improved. ==================================================
# Unifying Pixel-Labeling Vision Tasks By Sequence Modeling Anonymous authors Paper under double-blind review ## Abstract Developing a single neural network that can perform a wide range of tasks is an active area of research in computer vision. However, unifying models for pixel-labeling tasks presents significant challenges due to the diverse forms of outputs and the reliance on task-specific structures. In this paper, we propose UniPixTask, a model that unifies pixel-labeling tasks by modeling them with discrete vocabulary codes. UniPixTask consists of two main components: a Sequence Learner that produces a unified expression and a Dense Decoder that constructs latent codes for dense prediction outputs. This combination enables UniPixTask to model the complex task space using unified discrete representations while maintaining high-quality output for pixel-labeling tasks. We evaluate UniPixTask on three pixel-labeling tasks: semantic segmentation, surface normal estimation, and monocular depth estimation. The experimental results show that UniPixTask is a promising approach for unifying pixellabeling tasks. Our code will be available. ## 1 Introduction Researchers have been working on developing general models that use a single neural network to perform multiple tasks. A key aspect of achieving this goal is to build unified representations for multiple modalities and tasks. The rise of autoregressive sequence models parameterized by Transformers (Vaswani et al., 2017) has led to the use of discrete vocabulary codes as a popular method for achieving unification. Compared to continuous and high-dimensional representations, discrete representations have more potential to fit different modalities and tasks. Language can be represented as a sequence of symbols, which are inherently discrete. Similarly, visual tasks such as keypoints detection and object detection produce discrete sets of keypoints or bounding boxes. Therefore, the use of discrete output is a key direction for the unification of multitask and multimodal, avoiding the need to add an additional decoder head on top of the continuous output to perform the discrete representation tasks. Recent models (Jaegle et al., 2021b;a; Wang et al., 2022; Alayrac et al., 2022) have made various attempts in this regard. For instance, Pix2Seq (Chen et al., 2021) quantizes the coordinates of bounding boxes and class labels of object detection into discrete tokens. Pix2Seq v2 (Chen et al., 2022a) further expresses the discrete forms of more tasks like instance segmentation and keypoint estimation. Unified-IO (Lu et al., 2022) targets a wider set of vision and language tasks and homogenizes them into a sequence of discrete tokens. However, for dense prediction tasks which produce pixel-level predictions of images, unifying them still poses great challenges. Labels for these tasks have diverse forms and may be continuous values. Simply quantizing these outputs into discrete variables can lead to a loss of accuracy. Moreover, unlike most tasks that only require a global representation, pixel-labeling tasks focus on local semantic details, necessitating pixel-level outputs that are dependent on feature resolution. However, due to the quadratic increase in sequence length, the traditional model is difficult to scale. To address these problems, in this paper, we propose UniPixTask, a novel unified approach for modeling dense prediction tasks using latent discrete tokens. Our model is depicted in Figure 1 and we contribute in three ways: 1 ![1_image_0.png](1_image_0.png) Figure 1: Overview of the UniPixTask framework. - Sequence Learner and Dense Decoder work jointly to achieve discrete representation modeling for dense prediction tasks. Sequence Learner is efficient at predicting discrete vocabulary tokens while Dense Decoder is capable of generating task-specific outputs. - Our compression and restoration modules enable efficient modeling of feature representations using a small number of latent codes. By restoring in the channel and spatial dimensions, we are able to efficiently reconstruct features from discrete codes with minimal information loss. This allows us to model complex pixel-labeling tasks while maintaining high-quality output. - As a unified approach, UniPixTask is well suited to multiple tasks, including semantic segmentation, surface normal estimation, and monocular depth estimation. It achieves competitive results with well-established task-specific models. ## 2 Related Work 2.1 Pixel-Labeling Vision Tasks Pixel-labeling, also called dense prediction, refers to tasks that produce pixel-level outputs for images. These tasks perform pixel-level classification or regression based on the feature map (Wang et al., 2021b). Examples of dense prediction tasks include semantic segmentation (Zhou et al., 2017), surface normal estimation (Silberman et al., 2012), and monocular depth estimation (Eigen et al., 2014). Semantic segmentation predicts the semantic class of each pixel, surface normal estimation predicts the surface orientation of each pixel, and monocular depth estimation predicts the distance of each pixel from the camera. Semantic segmentation is the task of assigning a semantic category to each pixel of an image. The fully convolution network (FCN) (Long et al., 2015) has been the fundamental work in the field of semantic segmentation. Follow up methods use atrous convolution (Chen et al., 2017a;b), pyramid pooling module (Zhao et al., 2017) or CRF/MRF (Liu et al., 2015; Liang-Chieh et al., 2015; Zheng et al., 2015) to help refine the coarse predictions by FCN. Recently, motivated by the success of Transformer architecture (Vaswani et al., 2017), SETR (Zheng et al., 2021), MaX-DeepLab (Wang et al., 2021a), MaskFormer (Cheng et al., 2021), SegFormer (Xie et al., 2021), EVA (Fang et al., 2022) have proved the effectiveness of Transformer-based architectures for semantic segmentation. Surface normal estimation is to extract 3D geometry and surface orientation from a single image. Traditional approaches design networks with high capacity to learn both global and local cues. For example, Deep3D (Wang et al., 2015) proposes a two-stream CNN to fuse coarse scene structure and fine details. SkipNet (Bansal et al., 2016) introduces a skip-network approach to recover fine object details. PAP (Zhang et al., 2019) proposes pattern-affinitive propagation to utilize the matched non-local affinity information. TiltedSN (Do et al., 2020) introduces a spatial rectifier to transform the surface normal distribution and handle tilted images. Moreover, GeoNet (Qi et al., 2018) enforces depth-normal consistency and incorporates geometric relation based on two-stream CNNs. EAU (Bae et al., 2021) introduces a new parameterization for the surface normal probability distribution to address the aleatoric uncertainty. Monocular depth estimation requires estimating depth from a single RGB image. Methods based on deep convolutional neural networks have been proposed to achieve good accuracy, including the usage of radar modalities (Lo & Vandewalle, 2021), adopting multi-scale network architecture (Laina et al., 2016; Hu et al., 2019; Xu et al., 2021), using geometric constraints (Yin et al., 2021), pretaining wit masked image modeling Xie et al. (2022) or guiding by local planar (Lee et al., 2019). Recently, AdaBins (Bhat et al., 2021) leverages a Transformer-based architecture block to perform global processing of the scene's information. Depthformer (Agarwal & Arora, 2022) introduces an encoder-decoder Transformer network to predict multiscale feature maps. However, each task requires a unique network design, resulting in significant differences among networks for different tasks. In this paper, we aim to unify the networks and expressions of various dense prediction tasks. ## 2.2 Vision Model Unification Recently, there has been a significant amount of research in the field of computer vision Kokkinos (2017); Wang et al. (2020); Yuan et al. (2021) focused on developing models that can perform a wide range of tasks without the need for task-specific architectures. These unified models are able to achieve good results on a variety of tasks and have attracted significant attention from researchers. Examples of these unified models include Perceiver (Jaegle et al., 2021b), Perceiver IO (Jaegle et al., 2021a) and Uni-Perceiver v2 (Li et al., 2022), which propose general architectures that can handle data from arbitrary settings. OFA (Wang et al., 2022) designs a unified sequence-to-sequence framework for a diverse set of multimodal and uni-modal understanding and generation tasks. Pix2Seq (Chen et al., 2021) proposes a generic framework for object detection using sequences of discrete tokens, and Pix2Seq v2 (Chen et al., 2022a) extends this approach to tasks such as segmentation, keypoint estimation, and image captioning. Flamingo (Alayrac et al., 2022) introduces a universal structure that produces natural language outputs for a variety of cross-modal tasks, demonstrating the effectiveness of using a unified architecture for multi-task and multimodal tasks in vision and language. However, these models typically perform tasks that inherently generate discrete outputs or natural language, while our proposed approach, UniPixTask, focuses on dense prediction tasks that produce pixel-level predictions. Concurrent to our work, UViM (Kolesnikov et al., 2022) proposes a discrete guiding code for unifying a set of vision tasks like panoptic segmentation, depth prediction, and colorization. It relies on the use of both discrete codes and the original image to perform the task. Unified-IO (Lu et al., 2022) homogenizes different forms of input and output for a wide set of tasks into a sequence of discrete vocabulary tokens, leveraging VQ-GAN (Esser et al., 2021) to learn a label-to-label mapping and obtain the discrete tokens. In this paper, we propose UniPixTask, which is distict from them. UniPixTask models discrete representation from task-specific structures using vector quantization. It benefits from the well-established task decoder and the intermediate semantics contained in the mapping from image to label. We also incorporate modules for compressing the sequence to improve the generation efficiency of our approach. ## 3 Unipixtask In this section, we introduce UniPixTask: a unified approach to model dense prediction tasks by discrete latent variables. It consists of three main parts: (i) a Sequence Learner to generate a unified expression of the input data in an autoregressive manner; (ii) a novel Dense Decoder to construct discrete codes for various dense prediction tasks; (iii) the unified training objective and the approach to obtain task-specific predictions. ## 3.1 Sequence Generation The goal of Sequence Learner is to perform various tasks with discrete tokens drawn from a unified and finite vocabulary. As language is inherently discrete, inputs and outputs across a wide number of NLP tasks are represented as a sequence of symbols. Similarly, vision tasks like keypoints detection and object detection can be represented by a set of discrete points. To benefit from this homogeneous property, we construct Sequence Learner by the language modeling approach to generate discrete tokens for dense prediction tasks. Sequence Learner is modeled by an encoder-decoder architecture. The decoder is responsible for autoregressive generation while the encoder extracts image representation. The decoder predicts one token at a time, conditioned on the image representation and the preceding sequence. Both modules are composed of stacked Transformer layers (Vaswani et al., 2017), which consist of self-attention, feed-forward neural network, layer norm and residual learning. Specially, a cross-attention module is additionally included in each layer of the decoder to perform a correlation learning between tokens and images. ## 3.2 Discrete Construction Of Dense Predictions In Latent Feature Space Different from most vision tasks, the dense prediction task which produces diverse forms of pixel-level predictions poses great challenges for unification. For example, the output of semantic segmentation is the predicted category for each pixel while the output of surface normal estimation is the three values for x/y/z orientations. Simply quantizing these outputs into discrete variables will inevitably lead to decline of accuracy and loss of local semantic details. Experimental results of this scheme can be also found in Section 4.2. Meanwhile, since the autoregressive decoder predicts code by code, the length of predicted sequence will significantly influence the computational costs. For example, considering a 6-layer autoregressive Transformer, predicting a map with 80 × 80 codes needs to go through 38,400 layers. Due to the quadratically increasing cost in sequence length, the traditional model is hard to be scaled to higher resolutions. Therefore, to address these problems, we propose Dense Decoder with compression and restoration modules to achieve efficient and high-quality transformation of discrete codes. The model is a combination of two mapping module: an encoded mapping from the image input to discrete tokens f : *X → V* and a decoded mapping from tokens to restored output g : *V → Y*i. In general, X , V, Y represent the image space, discrete space, and output space respectively. The index i represents different forms of outputs in dense prediction tasks. Unlike simple quantization at the output level, we focus on the intermediate feature space in order to confront the accuracy decline under the discretization. Accordingly, the goal of Dense Decoder is to take x ∈ X as the input, model the discrete representation v ∈ V, and finally be able to construct the output y ∈ Y. As discussed above, the quantization in V should be a collection of finite and discrete representations. We raise the idea from vector quantization (VQ) (Van Den Oord et al., 2017), where the representations can be drawn from a learned codebook. To be specific, the vocabulary V ∈ R k×dis a set of k vectors v ∈ V with d dimensions. Note that V = {vi} k i=1, vi ∈ R d. Then Dense Decoder will learn how to choose codes from the vocabulary to perform a task with pixel-level labels. The encoded mapping f consists of a Vision Transformer (Dosovitskiy et al., 2020) backbone, a compression module, and a tokenizer. Given an input image x ∈ R H×W×3, the vision transformer first projects the input into vectors and extracts the feature z ∈ R h×w×c, where (*H/h, W/w*) is the projected patch size and c is the channel dimension. Then the following compression module reduces the size of the feature map to (h ′, w′) by learnable down-sampling layers. In practice, the total number of features is compressed to a quarter of the original map, indicating that the predictions of corresponding discrete tokens are able to reduce the computational cost to 1/4. Finally, the tokenizer projects the compressed features into code space z ′ ∈ R h ′×w ′×d(where the channel dimension d is typically much smaller than c) and obtain the discrete tokens by mapping onto the nearest neighbor in the codebook V: ei = vj , where j = argminj∥z ′ i − vj∥2. (1) e = f(x) is exactly the discrete representation we want. It is chosen from the finite discrete space, that is, j ∈ {1, 2*, ..., k*}. On the one hand, it is correspondingly generated from each image input. And on the other hand, it is capable to predict the task-specific output for dense prediction tasks. Then this transformation from the discrete codes to the task-specific output space is achieved by the decoded mapping g. The most challenging goal of g is to use compressed tokens to accomplish dense predictions with high quality. Accordingly, besides task output heads, a restoration module is proposed to combine into this decoded mapping. The module can be summarized into three parts, channel restoration, spatial restoration, and a smooth transformer. Firstly, the channel restoration is performed by the efficient vision Transformer. It projects the channel ![4_image_0.png](4_image_0.png) dimension of discrete tokens d to that of the latent feature space c. Then, a learnable up-sampling approach as spatial restoration is engaged to construct the original spatial size of feature map. On this basis, the smooth transformer will be used to obtain z˜ ∈ R h×w×c, making up for the inconsistency of semantics after the first two restoration. Finally, with this continuous high-dimensional feature, we can use an arbitrary existing task head to acquire the prediction y for the desired task. The total process of decoded mapping can be expressed by y = g(e). Figure 2: The structure of Dense Decoder. It consists of two mappings. The output of the encoded mapping and the input of the decoded mapping are discrete code representations, which are shown in the upper right of the figure. The encoded mapping consists of a backbone, a compression module, and a tokenizer, while the decoded mapping consists of three restoration modules and task heads. ## 3.3 Training Objectives To obtain a well-trained Dense Decoder, the objectives can be divided into two parts. On the one hand, the learning of discrete code representations is shared by all tasks. And on the other hand, the restoration and prediction of outputs are specific for each task. When constructing discrete representations, the key is to minimize the conversion loss when mapping the compressed features onto the codebook. Thus a commitment loss (Van Den Oord et al., 2017) is adopted. The objective can be written as: $${\mathcal{L}}_{f}=\|\mathrm{{sg}}[\mathbf{z}^{\prime}]-\mathbf{e}\|_{2}^{2}+\|\mathbf{z}^{\prime}-\mathrm{{sg}}[\mathbf{e}]\|_{2}^{2},$$ , (2) where sg[·] denotes the stop-gradient operation. The first term optimizes the codebook, moving the embedding vectors toward the output features in code space. Meanwhile, the second term updates the Transformer backbone, compression module, and the projection layer in the encoded mapping of Dense Decoder, constraining the output to a limited set of discrete space. Next, the training of Dense Decoder also requires the help of task-specific objectives. They are used to optimize the decoded mapping which needs to be able to effectively restore the task output and meanwhile $$(2)$$ help construct the code space to support the task. We employ task-specific models to generate the training labels for the restored features output by restoration modules in the decoded mapping. Given a well-trained task model T, it generally consists of two parts, a feature extraction backbone T1 and a task output head T2. The objective is to minimize the difference between task features T1(x) and the restored features from discrete codes: $${\mathcal{L}}_{t}=\|T_{1}(\mathbf{x}),{\hat{\mathbf{z}}}\|_{2}.$$ $$\left({\boldsymbol{3}}\right)$$ Lt = ∥T1(x),ˆz∥2. (3) Here we use the mean squared error to supervise this restoration. Then when the features restored by the Dense Decoder are consistent with the features extracted by T1, we can directly use T2 as the task output head in Dense Decoder to obtain the final task predictions. For Sequence Learner, the goal is to predict the distribution of possible indices for the next code p(ei|x, e<i) based on the image representation and previous codes e<i. Thus the training objective of Sequence Learner is a general loss function for all tasks, which is to maximize the log-likelihood of the predicted representations (Van Den Oord et al., 2017): $${\cal L}_{e}=\sum_{i}\,\,\hat{e}_{i}\log p(e_{i}|{\bf x},e_{<i}).\tag{10}$$ $$\quad(4)$$ x is the input image and eˆ is the one-hot label generated by the code prediction of well-trained Dense Decoder. When the code predicted by Sequence Learner is consistent with that of the encoded mapping in Dense Decoder, we can then leverage the decoded mapping to perform the prediction of task output. Therefore, at the inference stage, generating the dense prediction by a given image therefore involves two modules: Sequence Learner to obtain discrete tokens, and the decoded mapping in Dense Decoder to predict the task output. The sequence is generated code by code while each is sampling the largest likelihood predicted by Sequence Learner, i.e., p(ei|x, e<i). Then once the sequence with a certain length is generated, it can be fed into Dense Decoder for restoration and prediction of task-specific outputs. ## 3.4 Advantages Over Vq-Gan. The main difference between our method and VQ-GAN (Esser et al., 2021) in Unified-IO (Lu et al., 2022) is that VQ-GAN learns a label-to-label mapping, while our method uses vector quantization to learn an image-to-label mapping. Therefore, our UniPixTask has three advantages over VQ-GAN. First, our model can keep up with the times by improving the structure and accuracy of the model for each task, because it is able to use the task head of almost all task-specific models as its decoder. For a well-established model, we can first insert vector quantization and our proposed restoration modules between the backbone and the task head, and take its task head as our well-trained task decoder. And then after training with Equation 2 and Equation 3, we can then obtain the great discrete code representations for the task. However, it is difficult for VQ-GAN to catch up with the latest task-related models in terms of accuracy, as it can only be helped by improvements in the relevant image-to-image model and cannot be helped by task-related models. Second, when training Dense Decoder and Sequence Learner for a task, we only need a well established model, not even the data used for training. The labels that the Dense Decoder needs to use are the hidden feature variables obtained by the well-trained model. In contrast, for VQ-GAN, a corresponding decoder needs to be trained using labels for each task dataset. Third, for VQ-GAN in Unified-IO, to obtain a task-specific decoder head in unified vision tasks, it needs to learn a mapping from labels to labels. For example, in the segmentation task, the label needs to be converted into a segmentation map, where different colors represent different categories. Then the decoder learns the mapping from discrete codes to colors. However, this latent variable is limited to the label level, without semantic-aware image-to-label mapping, which is not an effective latent representation for auto-regressive encoder to perform the task. On contrast, UniPixTask learns the mapping from images to task labels based on the complete task process and well-established model to obtain discrete latent variables effective for the task. In general, the Sequence Learner of the UniPixTask only needs to perform the backbone part of the task-specific model, which will be beneficial for future multi-modal or multi-task unification. ## 4 Experiments We apply UniPixTask to three pixel-level labeling vision tasks: semantic segmentation, surface normal estimation and monocular depth estimation. We describe the unified settings and select task-specific output head for each task below. Quantitative results are presented in Table 1,2,3 respectively and qualitative results are shown in Figure 4. ## 4.1 Implementation Details Sequence Learner Any backbone architecture can be compatible with the encoder. In experiments, we adopt Swin-B (Liu et al., 2021) as the encoder and add a simple feature pyramid module with 3 × 3 convolution layers to extract multi-scale features. We then construct a 6-layer Transformer (Vaswani et al., 2017) as decoder to predict code in autoregressive way. Dense Decoder For backbone model, we select Swin-B as well and also use a feature pyramid module to obtain multi-scale features. Then we use a combination of a 3 × 3 convolution layer with 2 strides and a hyperbolic tangent function to construct the compression module. For all the projection layers, we directly use a 1 × 1 convolution layer. In the decoded mapping, the channel restoration is composed of two 3 × 3 convolution layers with a tangent function in the middle and a subsequent 3-layer Transformer with 768 hidden size. Then a transposed convolution is adopted as the dimension restoration. Finally, another 3-layer Transformer is employed as the smooth transformer. More details can be found in the appendix. ## 4.2 Baseline We design a baseline model for clearer comparison, which structure is shown in Figure 3. Rather than looking ![6_image_0.png](6_image_0.png) for a latent variable feature space for unification, the baseline model directly quantizes the output space into a finite sequence of discrete codes. For fair comparison, we limit the length of codes for the baseline same as the codes used in UniPixTask. We first down-sample the ground-truth map and then convert it to discrete codes as new labels. Figure 3: The structure of baseline model. Notably, the baseline model fails to perform both surface normal and depth estimation tasks, as its result is shown in Table 2 and Table 3. The poor performances are due to the high requirements of details and resolutions on these two tasks. The results demonstrate that the outputs for some pixel-labeling tasks are difficult to directly express only by 1/256 discrete codes. UniPixTask provides an appealing solution with high accuracy based on the same amount of codes. ## 4.3 Semantic Segmentation Semantic segmentation requires assigning each pixel of an image a semantic category. Each value of the output is a class index representing the predicted category in that pixel. We follow MaskFormer (Cheng et al., 2021) to construct the task-specific output head. The tokenizer has 1024 dictionary vectors where each has a length of 16. We train on ADE20k (Zhou et al., 2017) dataset, which is a popular scene parsing benchmark containing dense labels of 150 categories. It includes 20K images in the training set, and 2K images in the validation set. For evaluation, we follow MaskFormer to use the standard metric mIoU (mean Intersection-over-Union) (Everingham et al., 2015). The training crop size is 640 × 640, while Sequence Learner will predict a length of 20 × 20 codes to perform the segmentation task. For the baseline, we use the index of the class label which is in discrete form and has a fixed mapping. Table 1 shows that UniPixTask achieves 48.5 mIoU on semantic segmentation. It significantly outperforms the baseline and Unified-IO with the same backbone. And compared to the task-specific model, UniPixTask is only 4.2 points lower than MaskFormer. We analyze that the accuracy gap with the task-specific model comes from the loss of details where we only use very few tokens to express the full image. Moreover, Figure 4 demonstrates that our model is capable of producing a segmentation map of similar quality to that of the task-specific model. ## 4.4 Surface Normal Estimation Surface normal estimation predicts three values of x/y/z orientations for each pixel. We adopt the decoder of EAU model (Bae et al., 2021) as the task output head. We combine the Swin-B model and the decoder, and then retrain it to obtain the ready task head. The tokenizer has 1024 dictionary vectors where each has a length of 64. For the baseline, since the ground-truth map of x/y/z orientations are normalized and each orientation value is in the range of [0, 1], we divide the value of x and y axes into 32 bins respectively and obtain the value of z axis by the normalization formula. Therefore, the total number of codes required for the surface normal label is 1024. We evaluate UniPixTask on NYUv2 (Silberman et al., 2012), which consists of 464 indoor scenes with RGB-D video sequences. As the official training set only contains 795 images, recent methods leverage on additional images to reconstruct the training set (Bansal et al., 2016; Qi et al., 2018; 2020). To ensure a fair comparison, we follow the same training and dataset settings as EAU (Bae et al., 2021). The training crop size is 480×640 and Sequence Learner will predict a length of 30 × 40 codes. Table 2 compares the accuracy of UniPixTask and other related works. Compared to task-specific approaches, our method is only 1.7 rmse higher than EAU. Meanwhile, it outperforms other task-specific models, demonstrating the effectiveness of the proposed unified architecture. ## 4.5 Monocular Depth Estimation Monocular Depth Estimation requires estimating the depth map where each value is an arbitrary positive number. We follow AdaBins (Bhat et al., 2021) to construct the task output head. The tokenizer has 1024 dictionary vectors where each has a length of 64. For the baseline, we divide the ground-truth depth map into 256 bins. Each code represents a specific bin that can be transferred to a depth value. We train on NYU Depth v2 (Silberman et al., 2012), which provides images and depth maps for different indoor scenes. 24,231 image-depth pairs are divided for the training set and the rest 654 pairs are for the test set. The training crop size is 480 × 640, and the corresponding predicted sequence has a length of 30 × 40. Table 3 shows that UniPixTask achieves 0.414 rmse on depth estimation, outperforming UViM and Unified-IO by significant margins. It is only 0.05 worse than the task-specific model AdaBins, demonstrating UniPixTask contributes an effective unified way for pixel-labeling tasks. It is worth noticing that due to the discrete code modelling from continuous feature space, UniPixTask has a performance gap with latest state-of-the-art approaches. However, this accuracy gap is small and controllable, since our model is able to keep up with times by changing the task decoder of recent task-specific models for each task. In other words, we propose a high-quality solution for dense prediction tasks based on discrete code representations. UniPixTask actually achieves a combination of both the great performances and the generality to more modalities. | Method | Backbone | Crop Size | mIoU (s.s.) ↑ | mIoU (m.s.) ↑ | |------------------------------------|------------|-------------|-----------------|-----------------| | DeepLabV3+ (Chen et al., 2017a) | ResNet-101 | 512 × 512 | 45.5 | 46.4 | | MaskFormer (Cheng et al., 2021) | ResNet-101 | 512 × 512 | 46.0 | 48.1 | | SETR (Zheng et al., 2021) | ViT-L | 512 × 512 | - | 50.3 | | ViT-Adapter-B (Chen et al., 2022b) | ViT-B | 512 × 512 | 50.7 | 51.9 | | Swin-UperNet Liu et al. (2021) | Swin-B | 640 × 640 | - | 51.6 | | Mask2Former (Cheng et al., 2022) | Swin-B | 640 × 640 | 53.9 | 55.1 | | MaskFormer (Cheng et al., 2021) | Swin-B | 640 × 640 | 52.7 | 53.9 | | Dense Decoder (Ours) | Swin-B | 640 × 640 | 50.5 | 52.0 | | Baseline | Swin-B | 640 × 640 | 41.4 | - | | Unified-IO† (Lu et al., 2022) | Swin-B | 640 × 640 | 43.2 | - | | UniPixTask (Ours) | Swin-B | 640 × 640 | 48.7 | 50.5 | | Method | mean ↓ | median ↓ | rmse ↓ | 11.25◦ ↑ | 22.5◦ ↑ | 30◦ ↑ | |-------------------------------|----------|------------|----------|------------|-----------|---------| | SkipNet (Bansal et al., 2016) | 19.8 | 12.0 | 28.2 | 47.9 | 77.0 | 77.8 | | SURGE (Wang et al., 2016) | 20.6 | 12.2 | - | 47.3 | 68.9 | 76.6 | | GeoNet (Qi et al., 2018) | 19.0 | 11.8 | 26.9 | 48.4 | 71.5 | 79.5 | | PAP (Zhang et al., 2019) | 18.6 | 11.7 | 25.5 | 48.8 | 72.2 | 79.8 | | GeoNet++ (Qi et al., 2020) | 18.5 | 11.2 | 26.7 | 50.2 | 73.2 | 80.7 | | IronDepth (Bae et al., 2022) | 20.8 | 11.3 | 31.9 | 49.7 | 70.5 | 77.9 | | EAU (Bae et al., 2021) | 14.9 | 7.5 | 23.5 | 62.2 | 79.3 | 85.2 | | Dense Decoder (Ours) | 16.7 | 9.4 | 24.7 | 55.8 | 75.7 | 82.8 | | Baseline | 48.3 | 47.1 | 54.5 | 6.6 | 19.9 | 29.4 | | UniPixTask (Ours) | 17.1 | 9.8 | 25.2 | 54.6 | 75.0 | 82.2 | Table 1: Comparison of the proposed method and related works for semantic segmentation on ADE20k. The upper part of the table shows task-specific approaches, while the lower part shows unified models which represent the task by unified discrete codes. † denotes our reproduction of the method by replacing the backbone to Swin-B for a fair comparison. We report both single-scale (s.s.) and multi-scale (m.s.) for evaluation. Our method outperforms unified models and is competitive with recent task-specific approaches. Table 2: Accuracy of surface normal estimation on NYUv2. The upper part of the table shows task-specific approaches, while the lower part shows unified models which represent the task by unified discrete codes. The baseline model has poor performance due to the high requirements of details and the constraint of 1/256 codes. Our method achieves state-of-the-art performances under the same setting. 9 | Method | Backbone | δ1 ↑ | δ2 ↑ | δ3 ↑ | REL ↓ | RMS ↓ | |-------------------------------------|-----------------|--------|--------|--------|---------|---------| | RSIDE (Hu et al., 2019) | SENet-154 | 0.866 | 0.975 | 0.993 | 0.115 | 0.530 | | SARBN (Chen et al., 2019) | SENet | 0.878 | 0.977 | 0.994 | 0.111 | 0.514 | | EGC (Yin et al., 2019) | ResNeXt-101 | 0.875 | 0.976 | 0.994 | 0.108 | 0.416 | | BTS (Lee et al., 2019) | DenseNet-161 | 0.885 | 0.978 | 0.994 | 0.110 | 0.392 | | P3Depth (Patil et al., 2022) | ResNet101 | 0.898 | 0.981 | 0.996 | 0.104 | 0.356 | | PixelFormer (Agarwal & Arora, 2023) | Swin-L | 0.929 | 0.991 | 0.998 | 0.090 | 0.322 | | AdaBins (Bhat et al., 2021) | EfficientNet-B5 | 0.903 | 0.984 | 0.997 | 0.103 | 0.364 | | Dense Decoder (Ours) | Swin-B | 0.888 | 0.985 | 0.997 | 0.116 | 0.386 | | Baseline | Swin-B | 0.365 | 0.627 | 0.798 | 0.374 | 1.163 | | Unified-IO | T5-B | - | - | - | - | 0.469 | | UViM | ViT-L | - | - | - | - | 0.467 | | UniPixTask (Ours) | Swin-B | 0.864 | 0.979 | 0.995 | 0.126 | 0.414 | Table 3: Comparison of the proposed method and related works for depth estimation on NYYU-Depth-v2 dataset. The upper part of the table shows task-specific approaches, while the lower part shows unified models which represent the task by unified discrete codes. The baseline model fails again due to the high requirements of details and the constraint of 1/256 codes. Under the same length of codes, our method outperforms Unified-IO and UViM and is competitive with recent task-specific approaches. ## 5 Key Issues And Discussion 5.1 Influence Of Code Length And Codebook Size | Codebook Size | | | | | | | | | | |-----------------|------|------|---------------|------|-------------|------|------|------|------| | 256 | 1024 | 4096 | Codebook Size | | | | | | | | | | 256 | 1024 | 4096 | | | | | | | 16 | 49.1 | 50.5 | 51.3 | 16 | 48.5 | 48.7 | 48.5 | | | | Code Length | 64 | 48.3 | 49.2 | 49.4 | Code Length | 64 | 45.2 | 47.1 | 46.7 | | 256 | 47.1 | 48.4 | 48.0 | 256 | 44.8 | 46.1 | 46.5 | | | We study how the length of discrete code and size of the codebook affect the performance. We vary the two dimensions of vocabulary: the number of vectors k and the dimension d. Nine models are trained with different settings: a cross-product of k ∈ {16, 64, 256} and d ∈ {256, 1024, 4096}, to show a clear comparison. Table 4 reports the comparison results of Dense Decoder on semantic segmentation while Table 5 reports the results of UniPixTask. Table 4: Performances of Dense Decoder under different settings of codebook size and code length on ADE20k (measured as single-scale mIoU). Table 5: Performances of Sequence Learner under different settings of codebook size and code length on ADE20k (measured as single-scale mIoU). The experiments are held on ADE20k for semantic segmentation. For Dense Decoder, when the code length is relatively small, *i.e.*, 16 and 64, the accuracy of the model benefits from the increase of codebook size. However, when the code length reaches 256, the use of the tokenizer in Dense Decoder will be saturated quickly, resulting in a decrease of accuracy after 1024 codes. Meanwhile, when the codebook size is fixed, the results show that the accuracy of Dense Decoder benefits from a shorter code length. ![10_image_0.png](10_image_0.png) Figure 4: Visualizations of our model on three pixel-labeling tasks: semantic segmentation (1st row), monocular depth estimation (2nd row) and surface normal estimation (3rd row). The columns represent the visualization results predicted by different models. Dense Decoder quantizing by discrete codes is able to generate near perfect results. And the UniPixTask predicting in autoregressive way also achieves very high quality, demonstrating its effectiveness. For Sequence Learner, it is rather unclear how the accuracy is affected by size of codebook and the length of codes. In general, when the codebook size is fixed, the model is still benefiting from a shorter code length. However, for different code lengths, all optimal sizes of codebooks in Dense Decoder have changed. We analyze that longer codes and larger codebook will have potentially negative effect on autoregressivepredicted models. ## 5.2 Utilization Rate Of Codebook Next, we further investigate the codebook utilization rate under the variation of code length and codebook size to to explore potential reasons for the performance fluctuations. For the Dense Decoder, we count how many codes in the vocabulary have been used at least once during the inference stage. Intuitively, a short length of code will have limited ability to express semantic information and thus require more vocabulary to achieve the task. Figure 5 reports the utilization rates under the same crossproduct of nine settings in Section 5.1. As expected, with the same size of the codebook, the utilization rate of shorter codes in the codebook is higher than that of longer codes. Meanwhile, for codebooks with the same code length, the number of used codes will increase accordingly with the expansion of the vocabulary size. For example, for a codebook with a code length of 16, when the optional vocabulary is only 256, the number of used codes is 252. However, when the optional vocabu- Figure 5: The utilization rate of the codebook in Dense ![10_image_1.png](10_image_1.png) Decoder. The experiments are held on ADE20k for the semantic segmentation task under different settings. The utilization rates are measured on validation set. lary is increased to 1024, the number of used codes will be increased to 990. This shows that the increase in the optional vocabulary will encourage the model to spread the task semantics to more codes and avoid overloading a few codes. However, for a codebook with a relatively low utilization rate, such as a codebook with a code length of 256 and a size of 1024, increasing its vocabulary size hardly improves the total usage. At this time, a large number of unused codes in the codebook are redundant. ## 5.3 Computational Cost Evaluation We evaluate the memory usage, model size, and inference time of four models, including baseline, Unified-IO reproduced by Swin-B, Dense Decoder, and the final UniPixTask. The result is shown in Table 6. We also take the original Unified-IO with T5-B backbone for comparison. We compute the floating point operations (FLOPs) and report fps (images/s) on the input with 640 × 640 crop size. The experiments are held on Tesla V100 32G. Since Dense Decoder predicts the whole image in only one forward pass rather than in an autoregressive way, its flops and fps are significantly better than other methods. It is worth noting that despite adopting a task-specific decoder and leveraging on restoration modules in Dense Decoder, UniPixTask still achieves lower memory usage and similar fps compared to reproduced Unified-IO under the same backbone. It thus shows that the proposed components are not only efficient but also lightweight. | Method | Backbone | flops (G) | params (M) | fps (images/s) | |----------------|------------|-------------|--------------|------------------| | Baseline | Swin-B | 1152.07 | 94.7 | 0.69 | | Unified-IO | T5-B | - | 241.0 | - | | Unified-IO† | Swin-B | 1366.5 | 135.4 | 0.28 | | MaskFormer | Swin-B | 139.7 | 88.8 | 12.14 | | Dense Decoder∗ | Swin-B | 183.3 | 126.3 | 10.48 | | UniPixTask | Swin-B | 1195.5 | 137.8 | 0.28 | Table 6: Computational cost evaluation. † denotes our reproduction of the method with Swin-B backbone. ∗ denotes that the method does not predict in autoregressive way. Despite adopting a task-specific decoder and leveraging on restoration modules in Dense Decoder, UniPixTask still achieves lower memory usage and similar fps compared to reproduced Unified-IO under the same backbone. | Backbone | SL | EM | DM | Task Head | VQ-GAN Decoder | flops (G) | params (M) | |------------|-------|--------|--------|-------------|------------------|-------------|--------------| | ✓ | 138.9 | 82.6 | | | | | | | ✓ | ✓ | 1148.1 | 94.6 | | | | | | ✓ | ✓ | ✓ | 1148.1 | 94.6 | | | | | ✓ | ✓ | ✓ | ✓ | 1190.7 | 131.5 | | | | ✓ | ✓ | ✓ | ✓ | ✓ | 1195.5 | 137.8 | | | ✓ | ✓ | 1366.5 | 135.4 | | | | | | | ✓ | ✓ | ✓ | 43.4 | 43.2 | | | | | ✓ | 214.5 | 40.8 | | | | | We also hold experiments to study the computational cost of each component in UniPixTask and compare with the cost of VQ-GAN decoder in Unified-IO. SL denotes Sequence Learner; EM denotes Encoded Mapping; and DM denotes Decoded Mapping. The result is shown in Table 7. For the decoder part, the EM module is very lightweight and has very little impact on the overall computation and parameter cost of the model. And the computational cost is concentrated on the DM module, which consists of multiple transformer layers to perform a spatial restoration and a smooth module. However, the combination of decoder head in UniPixTask still achieves lower floating point operations than that of VG-GAN decoder in Unified-IO. Table 7: Computational cost evaluation of different components. The computational cost of UniPixTask decoder is concentrated on the DM module, which consists of multiple transformer layers to perform restoration and smooth modules. ## 6 Conclusion In this paper, we introduce UniPixTask, a unified approach that achieves state-of-the-art performance in dense prediction tasks. The key idea behind UniPixTask is to unify the representations of various tasks using discrete codes. It consists of two components: Sequence Learner, which learns to generate predictions in an autoregressive manner, and Dense Decoder, which models diverse inputs and outputs using discrete codes with task semantics. We demonstrate that our model performs effectively on semantic segmentation, surface normal estimation, and monocular depth estimation tasks. In the future, we plan to extend UniPixTask to support additional tasks and modalities. ## References Ashutosh Agarwal and Chetan Arora. Depthformer: Multiscale vision transformer for monocular depth estimation with local global information fusion. *arXiv preprint arXiv:2207.04535*, 2022. Ashutosh Agarwal and Chetan Arora. Attention attention everywhere: Monocular depth prediction with skip attention. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, 2023. Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katie Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. *arXiv e-prints*, pp. arXiv–2204, 2022. Gwangbin Bae, Ignas Budvytis, and Roberto Cipolla. Estimating and exploiting the aleatoric uncertainty in surface normal estimation. In *Proceedings of the IEEE/CVF International Conference on Computer* Vision, pp. 13137–13146, 2021. Gwangbin Bae, Ignas Budvytis, and Roberto Cipolla. Irondepth: Iterative refinement of single-view depth using surface normal and its uncertainty. *arXiv preprint arXiv:2210.03676*, 2022. Aayush Bansal, Bryan Russell, and Abhinav Gupta. Marr revisited: 2d-3d alignment via surface normal prediction. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 5965– 5974, 2016. Shariq Farooq Bhat, Ibraheem Alhashim, and Peter Wonka. Adabins: Depth estimation using adaptive bins. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition*, pp. 4009–4018, 2021. Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence, 40(4):834–848, 2017a. Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. *arXiv preprint arXiv:1706.05587*, 2017b. Ting Chen, Saurabh Saxena, Lala Li, David J Fleet, and Geoffrey Hinton. Pix2seq: A language modeling framework for object detection. *arXiv preprint arXiv:2109.10852*, 2021. Ting Chen, Saurabh Saxena, Lala Li, Tsung-Yi Lin, David J Fleet, and Geoffrey Hinton. A unified sequence interface for vision tasks. *arXiv preprint arXiv:2206.07669*, 2022a. Xiaotian Chen, Xuejin Chen, and Zheng-Jun Zha. Structure-aware residual pyramid network for monocular depth estimation. In *Proceedings of the 28th International Joint Conference on Artificial Intelligence*, pp. 694–700, 2019. Zhe Chen, Yuchen Duan, Wenhai Wang, Junjun He, Tong Lu, Jifeng Dai, and Yu Qiao. Vision transformer adapter for dense predictions. *arXiv e-prints*, 2022b. Bowen Cheng, Alex Schwing, and Alexander Kirillov. Per-pixel classification is not all you need for semantic segmentation. *Advances in Neural Information Processing Systems*, 34:17864–17875, 2021. Bowen Cheng, Ishan Misra, Alexander G Schwing, Alexander Kirillov, and Rohit Girdhar. Masked-attention mask transformer for universal image segmentation. In *Proceedings of the IEEE conference on computer* vision and pattern recognition, 2022. Tien Do, Khiem Vuong, Stergios I Roumeliotis, and Hyun Soo Park. Surface normal estimation of tilted images via spatial rectifier. In *European Conference on Computer Vision*, pp. 265–280. Springer, 2020. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In *International Conference on Learning Representations*, 2020. David Eigen, Christian Puhrsch, and Rob Fergus. Depth map prediction from a single image using a multiscale deep network. *Advances in neural information processing systems*, 27, 2014. Patrick Esser, Robin Rombach, and Bjorn Ommer. Taming transformers for high-resolution image synthesis. In *Proceedings of the IEEE/CVF conference on computer vision and pattern recognition*, pp. 12873–12883, 2021. Mark Everingham, SM Eslami, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes challenge: A retrospective. *International journal of computer vision*, 111 (1):98–136, 2015. Yuxin Fang, Wen Wang, Binhui Xie, Quan Sun, Ledell Wu, Xinggang Wang, Tiejun Huang, Xinlong Wang, and Yue Cao. Eva: Exploring the limits of masked visual representation learning at scale. arXiv preprint arXiv:2211.07636, 2022. Junjie Hu, Mete Ozay, Yan Zhang, and Takayuki Okatani. Revisiting single image depth estimation: Toward higher resolution maps with accurate object boundaries. In *2019 IEEE Winter Conference on Applications* of Computer Vision (WACV), pp. 1043–1051. IEEE, 2019. Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch, Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, et al. Perceiver io: A general architecture for structured inputs & outputs. In *International Conference on Learning Representations*, 2021a. Andrew Jaegle, Felix Gimeno, Andy Brock, Oriol Vinyals, Andrew Zisserman, and Joao Carreira. Perceiver: General perception with iterative attention. In *International conference on machine learning*, pp. 4651– 4664. PMLR, 2021b. Iasonas Kokkinos. Ubernet: Training a universal convolutional neural network for low-, mid-, and high-level vision using diverse datasets and limited memory. In *Proceedings of the IEEE conference on computer* vision and pattern recognition, pp. 6129–6138, 2017. Alexander Kolesnikov, André Susano Pinto, Lucas Beyer, Xiaohua Zhai, Jeremiah Harmsen, and Neil Houlsby. Uvim: A unified modeling approach for vision with learned guiding codes. arXiv preprint arXiv:2205.10337, 2022. Iro Laina, Christian Rupprecht, Vasileios Belagiannis, Federico Tombari, and Nassir Navab. Deeper depth prediction with fully convolutional residual networks. In *2016 Fourth international conference on 3D vision* (3DV), pp. 239–248. IEEE, 2016. Jin Han Lee, Myung-Kyu Han, Dong Wook Ko, and Il Hong Suh. From big to small: Multi-scale local planar guidance for monocular depth estimation. *arXiv e-prints*, pp. arXiv–1907, 2019. Hao Li, Jinguo Zhu, Xiaohu Jiang, Xizhou Zhu, Hongsheng Li, Chun Yuan, Xiaohua Wang, Yu Qiao, Xiaogang Wang, Wenhai Wang, et al. Uni-perceiver v2: A generalist model for large-scale vision and vision-language tasks. *arXiv preprint arXiv:2211.09808*, 2022. Chen Liang-Chieh, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan Yuille. Semantic image segmentation with deep convolutional nets and fully connected crfs. In *International Conference on* Learning Representations, 2015. Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In *Proceedings of the IEEE/CVF* International Conference on Computer Vision, pp. 10012–10022, 2021. Ziwei Liu, Xiaoxiao Li, Ping Luo, Chen-Change Loy, and Xiaoou Tang. Semantic image segmentation via deep parsing network. In *Proceedings of the IEEE international conference on computer vision*, pp. 1377–1385, 2015. Chen-Chou Lo and Patrick Vandewalle. Depth estimation from monocular images and sparse radar using deep ordinal regression network. In *2021 IEEE International Conference on Image Processing (ICIP)*, pp. 3343–3347. IEEE, 2021. Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 3431–3440, 2015. Jiasen Lu, Christopher Clark, Rowan Zellers, Roozbeh Mottaghi, and Aniruddha Kembhavi. Unified-io: A unified model for vision, language, and multi-modal tasks. *arXiv preprint arXiv:2206.08916*, 2022. Vaishakh Patil, Christos Sakaridis, Alexander Liniger, and Luc Van Gool. P3depth: Monocular depth estimation with a piecewise planarity prior. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2022. Xiaojuan Qi, Renjie Liao, Zhengzhe Liu, Raquel Urtasun, and Jiaya Jia. Geonet: Geometric neural network for joint depth and surface normal estimation. In *Proceedings of the IEEE Conference on Computer Vision* and Pattern Recognition, pp. 283–291, 2018. Xiaojuan Qi, Zhengzhe Liu, Renjie Liao, Philip HS Torr, Raquel Urtasun, and Jiaya Jia. Geonet++: Iterative geometric neural network with edge-aware refinement for joint depth and surface normal estimation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. Nathan Silberman, Derek Hoiem, Pushmeet Kohli, and Rob Fergus. Indoor segmentation and support inference from rgbd images. In *European conference on computer vision*, pp. 746–760. Springer, 2012. Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. *Advances in neural* information processing systems, 2017. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. *Advances in neural information processing systems*, 30, 2017. Huiyu Wang, Yukun Zhu, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Max-deeplab: End-to-end panoptic segmentation with mask transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 5463–5474, 2021a. Jingdong Wang, Ke Sun, Tianheng Cheng, Borui Jiang, Chaorui Deng, Yang Zhao, Dong Liu, Yadong Mu, Mingkui Tan, Xinggang Wang, et al. Deep high-resolution representation learning for visual recognition. IEEE transactions on pattern analysis and machine intelligence, 43(10):3349–3364, 2020. Peng Wang, Xiaohui Shen, Bryan Russell, Scott Cohen, Brian Price, and Alan L Yuille. Surge: Surface regularized geometry estimation from a single image. *Advances in neural information processing systems*, 29, 2016. Peng Wang, An Yang, Rui Men, Junyang Lin, Shuai Bai, Zhikang Li, Jianxin Ma, Chang Zhou, Jingren Zhou, and Hongxia Yang. Ofa: Unifying architectures, tasks, and modalities through a simple sequence-tosequence learning framework. In *International Conference on Machine Learning*, pp. 23318–23340. PMLR, 2022. Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 568–578, 2021b. Xiaolong Wang, David Fouhey, and Abhinav Gupta. Designing deep networks for surface normal estimation. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 539–547, 2015. Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo. Segformer: Simple and efficient design for semantic segmentation with transformers. Advances in Neural Information Processing Systems, 34:12077–12090, 2021. Zhenda Xie, Zigang Geng, Jingcheng Hu, Zheng Zhang, Han Hu, and Yue Cao. Revealing the dark secrets of masked image modeling. *arXiv preprint arXiv:2205.13543*, 2022. Xianfa Xu, Zhe Chen, and Fuliang Yin. Multi-scale spatial attention-guided monocular depth estimation with semantic enhancement. *IEEE Transactions on Image Processing*, 30:8811–8822, 2021. Wei Yin, Yifan Liu, Chunhua Shen, and Youliang Yan. Enforcing geometric constraints of virtual normal for depth prediction. In *Proceedings of the IEEE/CVF International Conference on Computer Vision*, pp. 5684–5693, 2019. Wei Yin, Yifan Liu, and Chunhua Shen. Virtual normal: Enforcing geometric constraints for accurate and robust depth prediction. *IEEE Transactions on Pattern Analysis and Machine Intelligence*, 2021. Yuhui Yuan, Rao Fu, Lang Huang, Weihong Lin, Chao Zhang, Xilin Chen, and Jingdong Wang. Hrformer: High-resolution transformer for dense prediction. *arXiv preprint arXiv:2110.09408*, 2021. Zhenyu Zhang, Zhen Cui, Chunyan Xu, Yan Yan, Nicu Sebe, and Jian Yang. Pattern-affinitive propagation across depth, surface normal and semantic segmentation. In *Proceedings of the IEEE/CVF conference on* computer vision and pattern recognition, pp. 4106–4115, 2019. Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 2881–2890, 2017. Shuai Zheng, Sadeep Jayasumana, Bernardino Romera-Paredes, Vibhav Vineet, Zhizhong Su, Dalong Du, Chang Huang, and Philip HS Torr. Conditional random fields as recurrent neural networks. In Proceedings of the IEEE international conference on computer vision, pp. 1529–1537, 2015. Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In *Proceedings of the IEEE/CVF conference on computer vision and pattern* recognition, pp. 6881–6890, 2021. Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 633–641, 2017. ## A Appendix We provide detailed architectures of UniPixTask (Table ??) and the settings of training hyperparameters of three pixel-labeling tasks: semantic segementation (Table 9), surface normal estimation (Table 10) and monocular depth estimation (Table 11). ## A.1 Network Architecture A.2 Hyperparameters for Semantic Segmentation Training | Input | Layer | Output | Output Dimension | |------------------------------------------------|--------------------------------------------------------|-------------|--------------------| | image | - | - | H × W × 3 | | Encoded Mapping | | | | | image | Swin-B | z | H/16 × W/16 × 512 | |  | | | | | z | Conv2D(Cout=512, ks=3, stride=2, padding=1),  Tanh(), | | | |  Conv2D(Cout=64, ks=1, stride=1, padding=1) | | ′ | H/32 × W/32 × 64 | | | |  | z | | z ′ | tokenizer in Eq. 1 | e | H/32 × W/32 × 64 | | Decoded Mapping | | | | | e | 3-layer transformer | z˜1 | H/32 × W/32 × 512 | | z˜1 | ConvTranspose2D(Cout=512, ks=3, stride=2, padding=1), GroupNorm() | z˜2 | H/16 × W/16 × 512 | | z˜2 | 3-layer transformer | z˜3 | H/16 × W/16 × 512 | |  | | | | | z˜3 | Conv2D(Cout=512, ks=3, stride=2, padding=1),  Tanh(), | | | |  Conv2D(Cout=64, ks=1, stride=1, padding=1)  | | z˜ | H/16 × W/16 × 512 | | z˜ | Task Head | Task Output | - | | Hyperparameters | Values | |-----------------------|-----------| | Autoregressive Layers | 6 | | Restored Channel | 256 | | Hidden Size | 512 | | FFN Hidden Size | 2048 | | Attention Heads | 8 | | Dropout | 0.1 | | Pre-Norm | ✓ | | Patch Size | 16 × 16 | | Codebook Size | 1024 × 16 | | Input Size | 640 × 640 | | Batch size | 16 | | Adam | ✓ | | Peak Learning Rate | 0.00006 | | Minimal Learning Rate | 1e-6 | | Warmup Epochs | 1500 | | Gradient clipping | × | | Weight decay | 0.01 | | Random Flip | ✓ | | Random Crop | ✓ | Table 8: Detailed network architecture of UniPixTask. Table 9: Hyperparameters for Semantic Segmentation on ADE20k. | Hyperparameters | Values | |-----------------------|-----------| | Autoregressive Layers | 6 | | Restored Channel | 256 | | Hidden Size | 512 | | FFN Hidden Size | 2048 | | Attention Heads | 8 | | Dropout | 0.1 | | Pre-Norm | ✓ | | Patch Size | 8 × 8 | | Codebook Size | 1024 × 64 | | Input Size | 480 × 640 | | Batch size | 16 | | Adam | ✓ | | Learning Rate | 0.00036 | | Gradient clipping | 0.1 | | Weight decay | 0.01 | | Random Flip | ✓ | | Color Augmentation | ✓ | | Random Crop | ✓ | | Hyperparameters | Values | |-----------------------|-----------| | Autoregressive Layers | 6 | | Restored Channel | 256 | | Hidden Size | 512 | | FFN Hidden Size | 2048 | | Attention Heads | 8 | | Dropout | 0.1 | | Pre-Norm | ✓ | | Patch Size | 8 × 8 | | Codebook Size | 1024 × 64 | | Input Size | 480 × 640 | | Batch size | 16 | | Adam | ✓ | | Learning Rate | 0.0006 | | Gradient clipping | × | | Weight decay | 0.01 | | Random Flip | ✓ | | Random Rotation | ✓ | | Random Crop | ✓ | Table 10: Hyperparameters for Surface Normal Estimation on NYUv2. Table 11: Hyperparameters for Monucular Depth Estimation on NYU Depth v2.
Review 1: Summary: This work proposes a unified architecture, UniTask, for three pixel-wise tasks: semantic segmentation, surface normal estimation, and monocular depth estimation. The same encoder, latent coding, and decoder modules are applied to each task. The encoding backbone is taken from prior work, but the encoding of features into a latent discrete code differs from contemporary work on unified vision models (UViM and Unified-IO) that make use of VQ-GAN coding. The decoder is designed to restore channel and spatial dimensions of the output from the latent codes, and then further process the representation to improve accuracy (the so-called "semantic" restoration step). Results with the proposed encoder/auto-regressive discrete coding/decoder model improve on concurrent unified architectures but lag behind task-specific models. The main empirical contributions of this work are the comparison with other unified architectures and the demonstration that a discrete code model can work for this purpose without the VQ-GAN component. The technical contributions are less immediately apparent, given that the encoding architecture (Swin-B) and the coding objective (related to VQ-VAE) are taken from prior work, and the decoder makes use of common architectural components for pixel-wise decoding. That said, the particular design choices made, and the exact proposed decodeer architecture, seem fairly effective across the three tasks studied, at least for these two datasets. Strengths and Weaknesses: **Strengths** This work examines a timely topic, experiments with several tasks (as is necessary for work on unified modeling across tasks), and shows results that improve on concurrent methods (but not always with strong controls for comparability). - How to unify vision tasks is a current topic, and how to unify pixel-wise tasks deserves special attention due to the spatial precision and computational scale required. - The experiments cover a diverse choice of pixel-wise tasks: semantic segmentation, surface normals, and depth. These include a recognition/semantic task (semantic segmentation) and reconstruction/physical tasks (normals, depth). The tasks span two datasets, ADE20K and NYUDv2. - The accuracies of the proposed UniTask improve on the accuracies of other unified methods, specifically UViM and Unified-IO. However, note that they do not always control for backbone (depth estimation in Table 3), and as such are not comparable experiments. - While related to other unified architectures in its use of discrete codes, this work does differ by departing from VQ-GAN, and so in this way indicates an alternative approach to quantization for these types of models. - Sec 5. analyzes the quantization/coding dimensions of the proposed method for code length, codebook size, and code utilization rate and reports the computational cost of the proposed UniTask, the internal baseline for this work, and the existing Unified-IO method. **Weaknesses** This work requires attention to improve its experimental results, discussion of prior work, and clarity. The experimental results for UniTask are not competitive w.r.t. task-specific results and the proposed baselines are not convincing. - The task baselines are not up-to-date and not the state-of-the-art. - semantic segmentation: [EVA (arXiv'22)](https://arxiv.org/abs/2211.07636), [ViT-Adapter (ICLR'23, arXiv'22)](https://arxiv.org/abs/2205.08534) - surface normals: [IronDepth (BMVC'22)](https://arxiv.org/abs/2210.03676) - depth: [PixelFormer (WACV'23, arXiv)](https://arxiv.org/abs/2210.09071v1), [SwinV2-L 1K-MIM (arXiv)](https://arxiv.org/abs/2205.13543v2) - Each task is limited to a single dataset. To measure how unified the proposed architecture is, it would be more convincing to show that it works for more than one instance of each task. For example, semantic segmentation could also be evaluated on Cityscapes, and depth and normals could be evaluated on KITTI (although other choices are also possible and acceptable). - Limited analysis and ablation: while Sec. 5 takes on the key issues of code design and computation it does not sufficiently study them for the purposes of this work. - The quantization analysis in Tables 4 & 5 is only carried out for semantic segmentation. As the subject of this work is the unification of pixel-wise tasks, it is necessary to do this analysis for the three tasks. - The baseline provided by this work, with the sequential encoder and direct discretization of the output, controls for the size of codes but does not control for the amount of computation and choice of autoregressive encoding. Per Table 6 the computational cost of UniTask is 10x the computation of a non-autoregressive model, and so it is reasonable to wonder how a non-autogressive baseline that controls for computation would perform. That is, the decoder-less baseline could have a longer/denser code or a larger/longer codebook, and still be more computationally efficient than the proposed full model. As an alternative baseline, a Swin-B encoder _without_ discrete codes could have a longer/denser latent representation coupled with a shallow decoder for each task would be reasonable. - The encoding and decoding architectures are taken as fixed and neither the sequence learner or dense decoder architectures are ablated. The decoder has several stages, so knowing how much each contributes would guide further development of decoders by future work. - The results for each task have a specific tuning of the dictionary size and code length. If this depends on the task, dataset size, or both is not empirically investigated. However, if a different tuning is required for each task, then this weakens the claim of task unification. - The analysis suggests that UniTask may scale poorly to larger codes ("We analyze that longer codes and larger codebook predicted models" on pg. 10), although this may be a function of dataset size. Many architectures, such as the Swin-B backbone used in this work, exhibit results that improve with larger dimensions (such as their channel widths or layer depths). Related work is missing, and it is closely related to the purpose of this work in unifying visual tasks or discretely coding representations. - Unified modeling for pixel-wise tasks: [UberNet (CVPR'17)](https://arxiv.org/abs/1609.02132) designs not only a unified architecture but a unified, multi-task model for a variety of pixel-labeling tasks at once that include the set considered in this submission. - Single architectures for dense prediction: [HRNet PAMI'20](https://arxiv.org/abs/1908.07919) or [HRFormer NeurIPS'21](https://arxiv.org/abs/2110.09408) (if a focus on attention is desirable) both define a single architecture that handles a variety of dense tasks (detection, segmentation, keypoints) with simple decoders. - Unified architecture for vision and language tasks: [Uni-Perceiver v2 (arXiv)](https://arxiv.org/abs/2211.09808). This work includes several vision and language tasks, although this submission specializes in pixel-wise tasks, among which Uni-Perceiver v2 only looks at semantic segmentation. - The commitment loss in particular and the training in general (Sec. 3.3) needs to indicate novelty and prior work as the case may be. For instance, a commitment loss is part of the [VQ-VAE](https://arxiv.org/abs/1711.00937) but it is presented here without reference to prior work. There are issues of clarity with the overall interface for the model, that is how it is applied across tasks, the method details, and the self-containment of the work. - UniTask is a single architecture for multiple tasks, but it is not a multi-task model. That is, one learned set of parameters does not do the three tasks experimented with in this work. This could be spelled out early on, in the abstract or the introduction, and especially in Fig. 1 where the three tasks are summarized. - The training of the sequence learner/encoder component of the model is ambiguous. Is the objective shared across all tasks (Eq. 4) but the model is trained separately for each task---as understood for the purpose of this review---or are the encoder parameters shared while the decoder parameters are separate? - "However, this approach is limited by the structure and conversion precision of VQ-GAN. In this paper, we propose an alternative approach that models discrete representation in the intermediate feature space, allowing us to benefit from arbitrary well-established structures." What are these structures? - The task-specific output heads are not specified in their details, at least not in the text, and only identified by reference. The same goes for the Transformer blocks included in the encoder and decoder. These could at least be reproduced in the supplement for reference without pulling up the relevant papers. **Summary** This work proposes a particular architecture, UniTask, for unifying pixel-wise tasks through discrete latent codes. The variety of tasks selected is satisfactory, in that one is semantic (semantic segmentation) and two are physical (normals and depth), and that they cover two datasets (ADE20K, NYUDv2). Comparing UniTask with the concurrent work of UViM and Unified-IO shows accuracy improvements (at least on the subset of tasks selected across the union of the experiments in these papers). The results for all of the unified models do not yet compete with state-of-the-art specific models, but there is progress. At present the issues for acceptance are (1) the disagreement between the claims w.r.t. the task-specific models and (2) the lack of thorough analysis of UniTask (either in ablation of its own components or close comparison with its concurrent works). This work would be more informative if it could explain how its design results in the different results w.r.t. UViM and Unified-IO rather than simply report that they differ. **Questions** - How sensitive is each task to the tuning of the discrete coding? Is there a scheme for choosing the dictionary size and code length automatically? This would make the approach more unifying, if less model search were needed per task. - How much does each step of decoding (channel/spatial/semantic restoration) contribute? - What is the computational cost of each component of UniTask? More precisely, how much is needed for the backbone, encoding, and decoding? Table 6 is a good start, but does not report how much of the cost is due to auto-regressive encoding vs. backbone encoding, for instance, which is what would make UniTask differ from alternatives. - This is more pragmatic than conceptual, but what is the motivation for relying on discrete codes? Would a model be less unified if it were to rely on continuous latents and discrete or continuous decoders? Attaching a shallow, task-specific head on a shared representation is not so much work to require for each task. Requested Changes: **Critical Changes for Acceptance** Please consider the claims w.r.t. the state-of-the-art and provide further detail about the computation and ablation of the proposed model. - Revise the results claim to acknowledge the state-of-the-art is higher on the given benchmarks. The results in this paper are valid, in that they control for backbone (sometimes), but they do not rival the state-of-the-art. - Report a more detailed measurement of the computation required by the various components of the model. - Ablate the stages of the dense decoder, to understand the importance of each type of restoration. - Discuss related work and credit prior work where it is made use of, such as the commitment loss of the VQ-VAE (to highlight a particular example). **Minor Changes for Improvement** Please consider this feedback on the exposition to make the paper more accessible and informative to a broader audience. - The experiments (Sec. 4) could use a forward pointer to the analysis and discussion in Sec. 5. Many readers will want to know that the key factors like the codebook size and code length are examined, and may first look for this in the experiments section. - The qualitative results in Fig. 4 would be more informative if good (cherry-picked) and bad (lemon-picked) results were shown for the highest and lowest scoring inputs of the validation set. For precision, each result could be shown alongside its score to connect the qualitative result to the quantitative result. As a further step, it would be nice to see more qualitative results in the supplement, which the main text could then point to. **Miscellaneous Feedback** - "UniTask" is a quite broad name, and something more precise like "UniPixTask" might be more appropriate, given the focus on pixel-labeling tasks. - The wording in the figures in the text could be more specific: - Fig. 2 "first" vs. "second" mapping are generic names, which could be replaced with encoding and decoding. - "semantic restoration" is a vague and unscientific term, and should be replaced by a description of the operation as attention or of the purpose as context processing or the like. - COCO [Lin et al. 2014] is a strange reference for semantic segmentation. PASCAL VOC is an earlier and landmark benchmark, or ADE20K is a currently popular benchmark (as studied in this submission), so consider changing the citation. Broader Impact Concerns: None. This work is on the general topic of pixel-wise tasks in vision and it does not present any specific ethical issues in itself. ================================================== Review 2: Summary: This paper presents a sequence modeling method to unify vision tasks including surface normal estimation, monocular depth estimation and semantic segmentation. Different from closely related work unified-io, this paper proposes to use a more complex latent code to model the relations between input and output. The method achieves competitive performance on three tasks based on Swin-B. Strengths and Weaknesses: Strengths: - The paper overall is easy to follow. - The method can achieve better results than Unified-IO reproduced by the authors. The method also largely outperforms the baseline which suggests the basic design is effective. Weaknesses: - The technical contribution of this paper is relatively low. Adding a channel dimension to the discrete code used in Unified-IO is close to previous practices like multi-scale encoding used in VG-GAN (Esser et al., 2021). The overall framework is very close to Unified-IO. - The model is only compared with some reproduced baselines. The proposed method generally underperforms some widely used methods like MaskFormer. Some more advanced methods like Mask2Former are not compared. - Some important details are missing. For example, the detailed architectures for semantic/spatial/channel restoration are not mentioned. Requested Changes: - The paper can be stronger if better results are provided and more powerful baseline are compared. - I suggest the authors to add more details about architectures and training process to help readers to better understand the models. Code for reproduce results in the paper would be better. Broader Impact Concerns: N/A ================================================== Review 3: Summary: The paper proposes a two-step modeling approach for dense vision tasks. The first step is to train a deep model that maps an input image to the dense output mask. This model is called “dense decoder” and has a special feature: it applies a vector quantization procedure to the intermediate feature map using the methodology proposed in the [VQVAE paper](https://arxiv.org/abs/1711.00937). The part of the model before the quantization step is denoted as “encoder” $f$, and the part after the quantization step is denoted as “decoder” $g$. Then, as the second step, the paper proposes to train an autoregressive transformer-based model (“sequence learner”) to model the discrete sequence output of $f$. At test time “sequence learner” predicts the discrete sequence and then “decoder” $g$ maps the discrete code to the task output. The proposed model is evaluated on the three tasks: semantic segmentation, surface normal and depth estimation. Unfortunately, I think that the proposed model does not contribute to the field: it does not carry any new insight and is not useful in practice (see the explanation in the next section). Strengths and Weaknesses: Weaknesses: (1) The paper fails to appropriately cite the prior work. Large fraction of the paper’s technical content is based on the VQVAE paper, which is not even cited. More concretely, equation 1 in the paper is essentially the equation 2 of the VQVAE paper, and equation 2 of the paper is the equation 3 in the VQVAE paper. The paper should make a clear relation to the VQVAE paper. From the model unification angle, the highly related work, namely Unified-IO and UViM, is mentioned, but it is argued that “These works leverage VQ-GAN (Esser et al., 2021) to encode pixel-level labels as discrete tokens. However, this approach is limited by the structure and conversion precision of VQ-GAN.” It is not clear why VQ-GAN would be more limiting than VQVAE and, crucially, UViM does not even use VQ-GAN. It also uses VQVAE, the same approach as the paper uses. Finally, the paper's model is the special case of the UViM model, where “encoder” $f$ does not have access to the ground truth data. I argue below that such a special case is not a good idea. (2) I think the motivation behind the proposed approach is flawed. As the paper demonstrates, the “dense decoder” itself is capable of solving all the tasks considered in the paper. If needed, unification can be simply done via using separate output heads. So there is no need in “representation quantization” and an additional “sequence learner” model. The baselines with the heavy manual quantization lead to bad results, as the majority of ground-truth signal is lost. I do not think they support the proposed model. I would like to stress that the proposed approach would most likely fall apart for any task that requires high-level output coordination beyond just having strong pixel-level predictions. For example it will fail for the task of panoptic segmentation. The reason is that the “dense encoder” is a simple feed-forward model with pixel-level loss and is not equipped with the ability to coordinate structured outputs (or intermediate codes that encode these outputs). Papers like Unified-IO and UViM, which also tackle model unification, address this problem by letting the “encoder” $f$ to have access to the ground-truth label, while the proposed model is lacking access to ground-truth when producing the discrete code. Requested Changes: The paper appears to have flawed motivation, is a special case of the existing method (UViM) and also fails to credit prior research appropriately. Unfortunately, I do not have any suggestions that will make this paper publishable at TMLR. Broader Impact Concerns: N/A ================================================== Metareview: Recommendation: Reject Comment: This paper proposes an approach to perform many dense prediction tasks by first converting an input image to a sequence of discrete codes that does not depend upon the task, and then using a task-specific head to generate outputs based on this code. Although reviewers generally applauded the paper’s goal of unifying vision tasks, they raised concerns regarding the baselines, discussion of previous work, lack of ablations, lack of evidence for the claim that newer, better-performing task-specific heads can be used with the model, and lack of motivation for the use of discrete codes. In response, the authors addressed concerns regarding baselines by adding numbers obtained with recent SOTA approaches to the tables in the paper, and also expanded the discussion of related work. Although these additions strengthened the work, reviewers remained unconvinced regarding the remaining points, and all recommend or lean toward rejection. I concur with the reviewers’ recommendations. ==================================================
# Dropped Scheduled Task: Mitigating Negative Transfer In Multi-Task Learning Using Dynamic Task Dropping Aakarsh Malhotra aakarshm@iiitd.ac.in Department of Computer Science IIIT-Delhi, New Delhi, India 110020 Mayank Vatsa mvatsa@iitj.ac.in IIT Jodhpur, Rajasthan, India 342037 Richa Singh richa@iitj.ac.in IIT Jodhpur, Rajasthan, India 342037 Reviewed on OpenReview: *https: // openreview. net/ forum? id= myjAVQrRxS* ## Abstract In Multi-Task Learning (MTL), K distinct tasks are jointly optimized. With the varying nature and complexities of tasks, few tasks might dominate learning. For other tasks, their respective performances may get compromised due to a *negative transfer* from dominant tasks. We propose a *Dropped-Scheduled Task* (DST) algorithm, which probabilistically "drops" specific tasks during joint optimization while scheduling others to reduce negative transfer. For each task, a scheduling probability is decided based on four different metrics: (i) task depth, (ii) number of ground-truth samples per task, (iii) amount of training completed, and (iv) task stagnancy. Based on the scheduling probability, specific tasks get joint computation cycles while others are "*dropped*". To demonstrate the effectiveness of the proposed DST algorithm, we perform multi-task learning on three applications and two architectures. Across unilateral (single input) and bilateral (multiple input) multi-task networks, the chosen applications are (a) face (AFLW), (b) fingerprint (IIITD MOLF, MUST, and NIST SD27), and (c) character recognition (Omniglot) applications. Experimental results show that the proposed DST algorithm has the minimum negative transfer and overall least errors across different state-of-the-art algorithms and tasks. ## 1 Introduction Machine learning and deep learning aim to optimize an objective to achieve an end goal. Depending on the use-case scenario, the goal may vary from a regression task to a classification task. However, in the real world, there are scenarios where many objectives need to be solved together. For example, a self-driving car needs to decipher a road sign while tracking the car in front of it while simultaneously avoiding an incoming pedestrian on the road (Yang et al., 2018; Chowdhuri et al., 2019; Chang et al., 2021). Similarly, an explainable deep model can predict if an organ's X-ray/CT/MRI is infected while segmenting the disease to assist the doctor (Amyar et al., 2020; Zhang et al., 2020; Malhotra et al., 2022a). In such scenarios, algorithms need to process an input data, like a road view from a lidar sensor or an organ X-ray/CT/MRI scan, to perform multiple tasks. In the scenarios defined above, Multi-Task Learning (MTL) (Caruana, 1997; Zhang et al., 2021a; Vandenhende et al., 2021) is an ideal choice. MTL is a joint optimization of K distinct tasks. The aim is to share information across related tasks by utilizing shared representations. In a deep convolutional neural network (CNN), tasks in MTL often share network parameters or layers to design scalable and robust solutions. In MTL, these K tasks can be placed for training at different stages (depth) of the network. However, at some ![1_image_0.png](1_image_0.png) Figure 1: Some tasks can dominate learning in MTL, resulting in negative transfer to other tasks. The proposed Dropped Scheduled Task (DST) algorithm reduces negative transfer by dynamically selecting dominating tasks and "dropping" them. This way, other tasks get more compute cycles and learns without negative transfer. level, different tasks share parameters and use the shared representations to perform the respective Kth end task. The shared representations enable the generalization of the solution (Caruana, 1997; Ndirango & Lee, 2019) while saving time and cost to deploy each of the K task models separately. MTL offers flexibility with tasks getting trained together at different stages (depth) and even different loss functions such as MSE or cross-entropy. With different depths, tasks requiring coarse features may be trained with a smaller network depth than more intricate tasks that require considerable network depth and more epochs. However, these variabilities in joint optimizations may lead to negative transfer (Wang et al., 2019; Zhang et al., 2021b). ## 1.1 Background And Problem Formulation In this subsection, we provide the notations, background, and problem definition for multi-task learning and negative transfer. In MTL, the aim is to optimize for a set of K tasks simultaneously on an i th input Xi. Xiis an instance in a z-dimensional input dataset X ∈ RN×z with a task-specific labels Yt ∈ Y N×K. Note that 1 ≤ |Yt| ≤ N translates to the fact that each task may have a different number of labeled data samples. However, each sample has at least one task with labeled ground truth. The MTL network is denoted by f(X; θ k), where θ k are the network parameters at k th epoch, consisting of shared and task-specific parameters, given as θ k sh and θ k t respectively. Here, t refers to individual tasks, where 1 ≤ t ≤ K. MTL aims to learn the network parameters θ by simultaneously optimizing all K task's losses. Hence, the net optimization for the i th instance becomes Li =PK t=1 Lti , where Lti is the individual loss term for the t th task. In a more general sense, the net optimization can be written as a linear combination of individual losses as Li =PK t=1 wtLti . The weighting term wt can be used for loss scaling or task prioritization (Gong et al., 2019). While jointly optimizing with individual task's objectives, source and target domains are learned together. During this joint learning, tasks can assist each other for improved learning and generalization. However, due to imbalanced learning between tasks, overall MTL performance or performance for a subset of task(s) can occasionally be sub-par compared to its single task learning (STL) counterpart due to a negative transfer (Ruder, 2017). In a general sense, a negative transfer can be defined as a scenario of transfer learning where the target task demonstrates a lower performance due to knowledge transfer from a source task compared to the case where the target task is trained individually. In the context of MTL, source and target domains are trained together and interchangeably knowledge is updated. With multiple tasks optimized together, a subset of task(s) may dominate training. Here, the performance for these dominant tasks improves while the tasks outside the dominant group observe lower performance (Liu et al., 2019a), referred to as negative transfer in MTL. We describe negative transfer in MTL as a scenario where a subset of target task(s) reports sub-optimal performance compared to their respective performance when trained in the absence of source task(s). More specifically, the absence of a source task can be defined as a scenario where the target task Table 1: Correlation of task-specific gradients at the shared layer on the five tasks of the AFLW database (Koestinger et al., 2011). The five tasks are: T1: gender prediction, T2: wearing spectacles or not prediction, T3: landmark localization, T4: pose estimation, and T5: denoising. | T1 | T2 | T3 | T4 | T5 | | |------|-------|--------|-------|-------|--------| | T1 | 1.0 | 0.012 | 0.001 | 0.005 | 0.006 | | T2 | 0.012 | 1.0 | 0.001 | 0.006 | -0.007 | | T3 | 0.001 | 0.001 | 1.0 | 0.117 | 0.044 | | T4 | 0.005 | 0.006 | 0.117 | 1.0 | 0.004 | | T5 | 0.006 | -0.007 | 0.044 | 0.004 | 1.0 | is trained individually (single task learning: STL), or the target task is trained in an MTL setup without the source task in consideration. This can be seen in Figure 1 under the MTL setup. For instance, outliers in an already learned, well-performing, easier task can negatively affect another challenging task that is still underperforming. Alternatively, incorrect predictions from complex tasks may negatively affect correctly predicting easier tasks (Lee et al., 2018). Furthermore, some unrelated tasks might get left out during the training. To formally persuade the problem of negative transfer, let us consider task interference on the shared parameters θ k sh. During parameter updates for each sample i (or minibatch), the gradients ▽θ flow backwards from task-specific θ k t to the shared parameters θ k sh. The parameters θ k sh are updated by a linear combination of individual task's gradients, as given by: ▽ sh θ L =PK t=1 ▽θLti . However, at these shared layers, the gradients of different tasks may interfere with opposite update directions. The disagreement in the gradient directions between the tasks may nullify the overall gradient, limiting performance for a subset of task(s). For instance, as seen for MTL in Figure 1, gradients from TA nullify gradients for TB and TC at the shared layer. To motivate the task interference with respect to counter directions of task gradients, we showcase vanilla MTL of five tasks of the AFLW database (Koestinger et al., 2011) using the architecture shown in Figure 2. While more details follow in Section 2.2, the five tasks are: T1: gender prediction, T2: wearing spectacles or not prediction, T3: landmark localization, T4: pose estimation, and T5: denoising. We obtain gradients with respect to each task for each minibatch throughout training for a randomly selected parameter in the shared encoder layer. This yields a vector of gradient values for each task. Using these vectors, we quantify the correlation of gradients across each pair of tasks (Dwivedi & Roig, 2019). As seen in Table 1, there is a limited consensus in task gradients, which supports the impact of negative transfer caused by interfering gradients. Recent studies aim to achieve global optima and address negative transfer by manipulating the training process. For limiting negative transfer and controlling information sharing while training an MTL network, the existing approaches can be categorized under three categories: (i) task grouping, (ii) task prioritization, and (iii) curriculum learning. The upcoming subsection elaborates on each of these methods. ## 1.2 Literature Review The commonly used approaches to optimize training process includes: (i) task grouping (Kumar & Daume III, 2012), (ii) task prioritization (Gong et al., 2019), and (iii) curriculum learning (Bengio et al., 2009). Each method aims to control the priority of the tasks to improve the overall performance. For these existing approaches, we describe each of these three hoods is below. Task Grouping: In this approach, algorithms aim to group tasks by identifying their *relatedness*. Post grouping, the optimization is done by selecting a group of tasks or sub-network for better multi-task training. Research studies compute grouping by measuring affinities (Zhang & Yeung, 2014; Standley et al., 2019), cross-task consistencies (Zamir et al., 2020), or probability of concurrently simple/difficult tasks (Lu et al., 2017). Post grouping, the algorithm may give different sub-networks (Lu et al., 2017; Standley et al., 2019) or orchestrate MTL (Zhang & Yeung, 2014; Zamir et al., 2020). Instead of a single level, a few studies (Han & Zhang, 2015; Chen et al., 2018a; Zamir et al., 2018) further segregated task grouping into different levels to model complex relationships amongst tasks. Though not exactly on the lines of grouping, Maninis et al. 3 (2019) proposed attentive single-tasking while training a multi-task network. The idea was to select a single task to execute using a residual adapter so that the MTL network could learn focussed features relevant to the task and disregard irrelevant features. In 2020, Chen et al. (2020) suggested dropping gradients of a group of tasks based on a positive sign purity metric. The idea was to drop either negative or positive gradients from different tasks so that they do not neutralize each other during training. Similarly, Navon et al. (2022) formulated MTL as a Nash-MTL algorithm. Nash-MTL performed learning as a bargaining game, where tasks negotiate to obtain consensus for the gradient direction. Recently, Liu et al. (2022) built a dynamic task relationship based on meta-loss during training. The association of tasks is dynamically decided based on the validation loss values. The result is a dynamic task-specific weighting parameter λ against each task's loss. Weight based Task Prioritization in MTL: In previous subsection, we defined MTL as Li =PK t=1 Lti . To prioritize tasks, research studies weigh each task individually and optimize as: L˜i =PK t=1 wtLti . The term wt is altered based on incompleteness/hardness of each task. Assuming task-specific loss is informative enough, studies use loss value to dynamically balance training. GradNorm (Chen et al., 2018b) altered the gradients of the network to prioritize tasks. They calculated the ratio of current loss and the starting loss for all the tasks. Each task's gradients are altered based on the calculated task-wise ratio against the expected ratio value across all tasks. LBTW (Liu et al., 2019a) uses the ratio of current loss and the starting loss to determine completeness. The term (ratio)α acts as a weight for each task. Other weighting strategies include studies by Sener & Koltun (2018) that finds weights leading to a Pareto-optimal solution, and Kendall et al. (2018) that uses homoscedastic uncertainty for task weighing. Similarly, Liu et al. (2019b) introduced Dynamic Weight Average (DWA) to calculate relative descending rate. DWA is then used to weigh individual tasks. Liebel & Körner (2018) added task-wise weights into learnable parameters. They constrained these weights with a regularization term to enforce non-trivial solutions. Other than loss values, studies (Guo et al., 2018; Jean et al., 2019) also utilize train or validation set performance to determine completeness or hardness of the task. In some scenarios, weights are dynamically modified to achieve performance closer to pre-computed Single Task Learning (STL). Curriculum Learning: In 1993, Elman (1993) discussed the concept of *starting small* to improve the training process for multiple task subsets. However, the term "*curriculum learning*" was coined by Bengio et al. (2009). The idea was to learn easier examples/samples followed by introducing more challenging cases. Results showed a speed up in the training process by finding good local minima for non-convex learning. Lee & Grauman (2011) use the idea to sequentially discover difficult categories using the earlier discovered easier ones without supervision. Pentina et al. (2015) performed MTL by sequentially learning individual tasks. They regularized parameters of each introduced task to be similar to just previously learned tasks. The idea was that consecutive related tasks in the order of difficulty should have similar parameter representation. Recently, Graves et al. (2017) utilized two signals as a reward to tune curriculum learning. These signals were the amount of increase in accuracy and increase in model complexity. Despite advancements in task grouping, task prioritization, and curriculum learning, negative transfer remains a predominant issue in MTL. The limitations of existing approaches are: (i) they seldom consider network depth while training that can cause a negative transfer. Further exacerbated negative transfer may be caused by a task-wise varying count of ground-truth annotated training samples (Ge et al., 2014; Wu et al., 2020), (ii) the weighted approaches may leave some tasks in a stagnant condition, and lastly, (iii) a negligible weight to early completed tasks can result in their catastrophic forgetting. Hence, this research aims to discover potential issues that can cause a negative transfer and address them using the proposed optimal training approach. Research Contributions: In this research, we propose Dropped-Scheduled Task (DST) to address negative transfer by dynamically selecting dominating tasks and "dropping" them. Our approach selects four factors that cause negative transfer and resolves them using the corresponding four metrics. These include (i) network depth, (ii) ground-truth availability count, and current loss values to determine (iii) task-wise learning completeness, and lastly, (iv) task-wise stagnation. Using these parameters, the DST occasionally "drops" a subset of tasks by a task-specific activation probability. The term "dropping" refers to not considering a subset of tasks during joint optimization, i.e., preventing error propagation through the dropped task(s). As shown in Figure 1, holding/dropping quick learners gives a fair chance to complex tasks, and all the tasks are learned without negative transfer. Dropping can also prevent dominance/overfitting (Wan et al., 2013; Srivastava et al., 2014; Ghiasi et al., 2018) of the completed tasks. Along these lines, a recent work by Sun et al. (2021) suggested performing one task at a time during MTL optimization. However, different combinations of tasks learning together can act as a regularization method and result in the generalization of the solution (Caruana, 1997; Ndirango & Lee, 2019). The related tasks may further assist other data scarce tasks and assist in their learning as well (Kapidis et al., 2021). The contributions of the DST algorithm are as follows: - The DST algorithm considers negative transfer caused due to task-wise varying network depths and limited samples for some tasks. Due to network depth as a parameter, DST is shown to work in unilateral and bilateral models. - The DST algorithm computes completeness and stagnation of the task, allowing only a subset of tasks to remain active. Further, DST allows prolonged stagnated earlier finished tasks to be occasionally active in later training stages, reducing catastrophic forgetting. - Due to task *dropping*, 2 K combinations from K tasks are possible. Different combinations during training act as implicit regularization to move tasks out of local minima. - For experimental results, three applications are chosen related to faces, (latent) fingerprints, and character recognition. The applications are chosen considering: (i) their diverse nature and complexities (classification, image-to-image translation, regression, contrastive loss, segmentation), (ii) different output depths (encoder/FC/decoder) and architecture (unilateral/bilateral), (iii) varying difficulty of similar tasks (segmentation for fingerprints easier than latent fingerprints), and (iv) large number of tasks (Omniglot). ## 2 Dropped-Scheduled Task (Dst) Negative transfer in MTL can be due to a variety of factors. The proposed DST algorithm1is based on four important factors that can negatively affect learning in MTL. Based on the four factors, the proposed DST algorithm devises four metrics, based on which a task-specific activation probability is computed. Consequently, during training, the DST algorithm occasionally "drops" a subset of tasks based on the computed task-specific activation probability. The four factors are network depth, ground-truth sample count, task incompleteness, and task stagnation. For each t th task in MTL, these four factors are quantified by a respective metric to quantify the drop rate. For t th task, P(d,t) quantifies drop rate based on task depth and P(c,t) quantifies drop rate based on training sample count. Additionally, at k th epoch, P(*u,k,t*) and P(*r,k,t*) quantifies drop rate based on task incompleteness and stagnancy, respectively. These individual metrics tell us how a certain task is overpowering or underpowered. These metrics are combined to define a task-wise activation probability P(k,t), where P(k,t) ranges in [0, 1]. P(k,t) tells what are the chances of t th task to remain active on k th epoch. The following section explains the proposed DST algorithm and the four metrics. It is followed by details of the chosen tasks and respective architectures. ## 2.1 Dropping Mechanism To Hold Overpowering Tasks In the proposed DST algorithm, a task t can remain active at k th epoch by a probability P(k,t). Otherwise, the tasks are *dropped* by a probability (1 − P(k,t)). P(k,t)is a weighted combination of five different metrics (one being a regularizer). The following subsections explain how the factors like network depth, groundtruth sample count, task incompleteness, and task stagnation affect MTL. Further, we explain how these adverse factors can be translated into individual metrics, which eventually are combined to get task activation probability P(k,t). 1The source code is available at: https://github.com/aakarshmalhotra/DST.git. ## 2.1.1 Metric Based On Network Depth He et al. (2016) highlighted that increasing the layers in a deep network may alleviate the problem of vanishing gradients. Vanishing gradients refer to a scenario during backpropagation where the gradient diminishes as the network depth increases. Few studies utilizing multi-task networks have addressed the concerns using a residual connection (Subramanian et al., 2018; Ding et al., 2019; Li et al., 2020) or some additional loss terms (Qiu et al., 2022). These approaches work well when all tasks are placed at the same depth. In an MTL setup with tasks of different depths, the effect of gradients can differ on the initial layers. For a shallower task, the gradient would dominate the initial layers. On the other hand, gradients would relatively vanish for deeper tasks. To give an equal chance, one way is to increase the gradient. GradNorm (Chen et al., 2018b) showed a mechanism to alter gradients for faster training. Considering task-wise network depths, our study gives more computation cycles (keeping tasks active) for deeper tasks. It reduces the dominance of shallower tasks. Based on network depth d for task t, the metric P(d,t)is: $$\mathcal{P}_{(d,t)}=\frac{d_{t}}{\operatorname*{max}_{1\leq t\leq K}(d_{t})}.$$ $$\text{(1)}$$. A higher value of P(d,t) represents that the task considered is deeper and increases the chances of computation cycles. ## 2.1.2 Metric Based On Training Sample Count While training a deep network, the model may overfit if the training samples are low and trained for a long duration (higher number of epochs). On the contrary, the network may underfit if it is trained for lesser epochs with larger number of training samples. For MTL, not all tasks may have an equal number of ground-truth labels. The task with fewer annotated samples might benefit (positive transfer) from the large corpus of samples provided by another task with more labeled samples. However, a target task with more labeled samples might undergo a negative transfer due to a source task with fewer instances (Wu et al., 2020). This can be seen from Lee et al. (2016) and our experiments, where a highly confident task faces a negative transfer due to a low-confident task trained with fewer training samples. Hence, each task requires computing cycles proportional to the number of labeled instances. We propose to consider task wise ground-truth count to decide computation cycles for each task. It ensures a reduction in computation cycles for tasks with fewer annotated training samples by dropping them more often. On the other hand, it increases computation cycles for the task with more annotated training samples. The metric P(c,t)is given as: $${\mathcal{P}}_{(c,t)}={\frac{c_{t}}{\operatorname*{max}_{1\leq t\leq K}(c_{t})}}.$$ $$\left(2\right)$$ . (2) Here, P(c,t)is the ratio of the ground-truth count ct of the considered t th task divided by the maximum ground-truth availability count of all tasks. A higher value of P(c,t) represents that the task has more labeled instances, resulting into task having more computation cycles. ## 2.1.3 Metric Based On Task Incompleteness To dynamically perform task scheduling, the proposed algorithm assumes that task-specific losses are descriptive for task balancing. A ratio of each task's current loss to its initial loss shows how much the task has learned. The expected value of this ratio across tasks denotes the average completion rate. Using the expected ratio, we can establish a relative completeness/incompleteness for each task. Let the value of loss for task t at the k th epoch be V(k,t). The initial loss value after the 1 st epoch is represented as: V(1,t). Hence, the amount of "incompleteness" during training for task t at the k th epoch can be defined as: $$I_{(k,t)}=\frac{V_{(k,t)}}{V_{(1,t)}}.\tag{1}$$ $$(3)$$ $$\left(4\right)$$ For a task whose learning is incomplete with a negligible decrease in loss, the value for I(k,t) would be close to 1. On the contrary, a task that has completely learned would have a small value towards 0. Further, it could be a case where a task has digressed and has its V(k,t) ≥ V(1,t). This would result in I(k,t) ≥ 1. Using I(k,t), the relative incompleteness of each task t can be found as: $${\cal P}_{(u,k,t)}=\min\left(1,\frac{I_{(k,t)}}{E(I_{(k)})}\right).\tag{1}$$ Here, E(I(k)) is the expected value of I(k,t) across all tasks at k th epoch. The variable u in P(*u,k,t*)is an alias for incompleteness measure, as defined by I(k,t). P(*u,k,t*) penalizes faster learning tasks but does not reward a slow task as the value is upper bound to 1. It makes all tasks that are "uncompleted" and slower than estimated E(I(k)) to obtain the highest activation chance while reducing the compute cycles of faster tasks. ## 2.1.4 Metric Based On Task Being Stagnant While training, some tasks may become stagnant in an MTL setting. Stagnancy is defined as a phase where the rate of fall of training loss is negligible. An easy, quick learning task may become stagnant due to training completion. Such quick learning tasks should be refrained from further training to avoid overfitting. On the other hand, a few tasks may get left out due to not getting priority in MTL. Such tasks require more explicit emphasis with more compute cycles. Hence, the metric presented in this subsection aims to empower incomplete stagnant tasks. We now devise a metric to quantify incompleteness and stagnance together. For each task, stagnancy can be computed by monitoring the decline in loss values over a few epochs. For the same, we calculate the local rate of change of losses using the loss value in the current and previous epoch. The local rate of change of loss R(k,t)for t th task at k th epoch can be defined as: $$R_{(k,t)}=\frac{1}{{\cal P}_{(u,k,t)}}\times\frac{V_{(k,t)}-V_{(k-1,t)}}{V_{(k-1,t)}}\qquad\forall k\quad k\geq2.\tag{1}$$ $$\left(5\right)$$ Here, V(k,t) represents the loss value for task t at the k th epoch. The term P(*u,k,t*)is taken from Eq. 4 to encode task incompleteness. The multiplication by 1 P(*u,k,t*) ensures that for two equally stagnant tasks, priority is given to the relatively incomplete one. On the other hand, the term V(k,t)−V(k−1,t) V(k−1,t)is responsible to encode stagnancy across two simultaneous epochs. Next, we need to compute if an incomplete task is in a stagnant phase rather than being stagnant in just two simultaneous epochs. Using the local rate of change R(k,t), we compute the global exponential moving average as: $$R_{(k,t)}^{\prime}=\begin{cases}R_{(k,t)}&\text{if$k=2$;}\\ \beta R_{(k,t)}+(1-\beta)R_{(k-1,t)}^{\prime}&\text{if$k\geq3$.}\end{cases}$$ $$(6)$$ Here, β ∈ [0, 1] is the discount factor. Larger values of β prioritizes more recent rate of change. R′(k,t) is assigned value of R′(k−1,t) if R(k,t) ≤ 0. Here, R′(k,t) ∈ (0, ∞), where a value close to 0 indicates an incomplete and stagnant task. The metric based on loss stagnancy is defined as: $$\mathcal{P}_{(r,k,t)}=\begin{cases}1&\text{if}k=1;\\ \operatorname*{min}\left(1,\frac{E(R_{(k)}^{\prime})}{R_{(k,t)}^{\prime}}\right)&\text{if}k\geq2.\end{cases}$$ if k ≥ 2.(7) $$\left(7\right)$$ Here, E(R′(k) ) denotes the expected value of R′(k) across all tasks at the k th epoch. The variable r in P(*r,k,t*) is an alias for stagnancy measure, as defined by R′(k,t) . Stagnant and incomplete tasks obtain a value of P(*r,k,t*) closer to 1. ## 2.1.5 Regularization The above four metrics control chances of task activation based on network depth, ground-truth sample count, task incompleteness, and task stagnation. To prevent a task to completely remain OFF, resulting in catastrophic forgetting, each task needs to get some chance to be active. To do so, a regularization metric is given as P(b,t) = 1. ## 2.1.6 Final Metric For Dropping And Scheduling Using the five metrics defined above, the final probability to schedule a particular task t at k th epoch is: $$P_{(k,t)}=\lambda_{d}{\mathcal{P}}_{(d,t)}+\lambda_{c}{\mathcal{P}}_{(c,t)}+\lambda_{u}{\mathcal{P}}_{(u,k,t)}+\lambda_{r}{\mathcal{P}}_{(r,k,t)}+\lambda_{b}{\mathcal{P}}_{(b,t)}.$$ Here, λ are non-negative weights given to individual metrics such that Pλi = 1. These λi can be altered to address specific variations of data, network, and learning in MTL setup. For our experiments, details and ablation around λi are shown in Section 3.2 and 4.4 respectively. Using P(k,t) defined above, G(k,t)is sampled as: $\left(\mathfrak{S}\right)$. $$G_{(k,t)}\sim\mathrm{Bernoulli}(P_{(k,t)}).$$ $$({\mathfrak{g}})$$ G(k,t) ∼ Bernoulli(P(k,t)). (9) G(k,:) is a 1×K vector of independent Bernoulli random variables for K tasks. For a task t such that 1 ≤ t ≤ K, the t th value in the vector denotes an ON/OFF bit for the t th task at k th epoch (during training). $$\tilde{\mathcal{L}}_{(k,t)}=G_{(k,t)}\odot\mathcal{L}_{(k,t)}.$$ $\left(10\right)$. L˜(k,t) = G(k,t) ⊙ L(k,t). (10) Here, ⊙ denotes element-wise multiplication. The vector G(k,t)is sampled and multiplied element-wise with individual task losses. The multiplication accounts for sampling and scheduling tasks from all sets of tasks at each epoch. The proposed DST algorithm schedules and gives compute cycles to one or more tasks. The advantages of the proposed DST algorithm is as follows: - Dynamic scheduling according to task-wise loss values. - With K tasks being ON or OFF, each combination from 2 K combinations is possible. This acts as an implicit regularizer that may take a particular task out of its local minima due to varying combinations of active tasks. - For two stagnant tasks, DST provides more compute cycles to the relatively incomplete task. - The DST method considers network depth and ground-truth training sample count for each task. - The occasional OFF may take easier tasks backward and again take them to their minima when they are ON. This prevents their overfitting. In later stages of training, the learning allows the network to gradually switch ON the completed tasks at the very end (since they have been stagnant over time) avoiding their catastrophic forgetting. Next, we discuss the applications considered in this study and their corresponding architectures. We show MTL on faces, (latent) fingerprints, and character recognition. The face and character recognition use the hard parameter sharing MTL approach. On the other hand, (latent) fingerprint recognition uses a soft parameter sharing MTL approach. We refer to the face application architecture as unilateral MTL. In unilateral MTL, an image input is fed, and the tasks segregate out after a few shared layers. The same idea is followed in the application of character recognition. (Latent) fingerprints use bilateral MTL for various tasks. In bilateral MTL, two images are taken as input and processed with soft parameter sharing. We elaborate on the details of these architectures in the following two subsections. ![8_image_0.png](8_image_0.png) $$(11)$$ Figure 2: The Encoder-Decoder MTL architecture for face applications. The five tasks are: (i) gender prediction, (ii) spectacles prediction, (iii) 21 point (x,y) landmark prediction, (iv) pose estimation, and (v) image denoising. ## 2.2 Unilateral Mtl: Face Attribute Analysis For application of attribute analysis in faces, deep MTL has been explored (Han et al., 2017; Ranjan et al., 2017). Unilateral MTL takes a face image as input and performs MTL. For MTL using face images, the selected tasks are (i) gender, (ii) wearing spectacles or not, (iii) landmarks, (iv) pose estimation, and (v) image denoising. Let the i th input to the network shown in Figure 2 be a noisy face image X′Fi . Let f1 represent the sub-network that predicts the gender probability P(gi|X′Fi ) of the i th noisy input X′Fi . Then, the loss function for the first task T1Fi of gender prediction is: $$T_{1F_{i}}=-g_{i}l o g(P(g_{i}|X_{F_{i}}^{\prime}))-(1-g_{i})l o g(P(g_{i}|X_{F_{i}}^{\prime})),$$ where, gi ∈ {0, 1}. Similarly, the loss for the second task of predicting if the face is "wearing spectacles/or not" can be given as: $$T_{2F_{i}}=-s_{i}log(P(s_{i}|X^{r}_{F_{i}}))-(1-s_{i})log(P(s_{i}|X^{r}_{F_{i}})),\tag{12}$$ where, $s_{i}\in\{0,1\}$. The above two tasks $T_{1F_{i}}$ and $T_{2F_{i}}$ are binary classification tasks. The other three tasks are regression tasks. The task T3Fi predicts 21 distinct facial landmarks, each represented as a {*x, y*} tuple. Hence, for each input X′Fi , 42 values are predicted using a sub-network f3 as: $$\hat{Y_{l_{j}}}=f_{3}(X_{F_{i}}^{\prime})\qquad\quad\forall j\quad1\leq j\leq42.$$ ) ∀j 1 ≤ j ≤ 42. (13) These values are optimized using Mean Squared Error (MSE) for the third task T3Fi , given as: $$T_{3F_{i}}=\frac{1}{\sum p_{j}}\sum_{j=1}^{42}(p_{j}(Y_{l_{j}}-\hat{Y_{l_{j}}}))^{2}.\tag{1}$$ $$(12)$$ $$(13)$$ $$(14)$$ Here, Ylj are the ground truth landmarks and Yˆ lj are the predicted landmarks. Due to facial pose or a partial face, some landmarks may be missing. To ensure such cases keep the loss unaffected, the error is multiplied with pj (1 if the j th landmark is present, else 0). The error is normalized by the total number of landmarks present (Ppj ). The fourth task T4Fi predicts pose angular values. The head pose is defined as three rotation angles: yaw, pitch, and roll. Unlike landmarks, each of the three angles is present. Hence, the MSE for the fourth task T4Fi , given as: ![9_image_0.png](9_image_0.png) $$(15)$$ $$(16)$$ Figure 3: Different task associated with latent fingerprint analysis. $$T_{4F_{i}}=\frac{1}{3}\sum_{j=1}^{3}(Y_{a_{j}}-\hat{Y_{a_{j}}})^{2}.\tag{1}$$ Here, Yaj is the ground-truth while Yˆaj is the predicted angle. The error is normalized by total pose types, i.e., 3. Lastly, T5Fi is a regression task to denoise the noisy input X′Fi . Denoising is achieved using the sub-network f5. For each pixel j, T5Fi is given as: $$T_{5F_{i}}=\frac{1}{n}\sum_{j=1}^{n}(X_{F_{i j}}-f_{5}(X_{F_{i j}}^{\prime}))^{2},$$ where n is the total pixel count and XFi is the clean face image. Overall Loss Function: For images with unavailable ground truth labels for a task, respective subnetworks may not be active during training. Further, the proposed DST algorithm may "switch OFF" (or drop) a task. Hence, the final loss Liis computed as: $$\tilde{\mathcal{L}}_{i}=\sum_{t=1}^{5}G_{t}w_{t}Z_{ti}T_{tF_{i}}.\tag{1}$$ $\mathrm{e}$ image. $$(17)$$ Here, Zti are the switches to denote the presence of the ground-truth label for i th image of the t th task. Further, Gt is a gate to control training for t th task by the DST algorithm. The values of these switches (gates) are either 0 or 1. wt is a static weight normalization for each task by scaling the loss values to the same expected starting loss value. The term wt is optional, and the proposed DST algorithm also works for varied starting loss values across tasks. ## 2.3 Bilateral Mtl: (Latent) Fingerprint Analysis Bilateral MTL inputs a pair of images to simultaneously process them for performing joint MTL. We chose latent fingerprint analysis as it requires important tasks (Malhotra et al., 2018) of recognition, orientation classification, and segmentation. These tasks are explained in Figure 3. The selected tasks are (i) fingerprint orientation estimation, (ii) fingerprint segmentation, (iii) latent fingerprint orientation estimation, (iv) latent fingerprint segmentation, and (v) pairwise matching. The orientation of the (latent) fingerprint is a pattern in which the ridges flow. They are classified into six categories, as shown in Figure 10 in appendix. As shown in Figure 4, let the i th input to the Siamese network be a pair of images, fingerprint XPi and latent fingerprint XLi . Let f ′ 1 be the sub-network that predicts the fingerprint orientation probability P(oi|XPi ) in one of the pre-defined six orientations. Then, the first task can be defined as: ![10_image_0.png](10_image_0.png) $$(18)$$ Figure 4: The MTL architecture for fingerprint applications. The tasks are (i) fingerprint orientation estimation, (ii) Fingerprint segmentation, (iii) latent fingerprint orientation estimation, (iv) Latent fingerprint segmentation, and (v) matching. $$T_{4F_{i}}=-\sum_{i=1}^{6}o_{i}l o g(P(o_{i}|X_{P_{i}})).$$ $$(19)$$ )). (18) Similarly, using P(oi|XLi ), loss function for latent fingerprint orientation prediction (T3Li ) can also be defined. The second and fourth tasks are semantic segmentation of fingerprint XPi and latent fingerprint XLi respectively. For fingerprint segmentation, let ground truth segmentation mask be SPi while the predicted mask be SbPi . Then, the second task T2Pi is defined as: $$T_{2P_{i}}=-\sum_{x,y}\big[\mathbf{S}_{P_{i}}(x,y)\log({\hat{\mathbf{S}}}_{\mathbf{P}_{i}}(x,y))+(1-\mathbf{S}_{P_{i}})\log(1-{\hat{\mathbf{S}}}_{P_{i}}(x,y))\big].$$ Similarly, T4Li can be defined for latent fingerprint segmentation. Each of the two segmentation tasks, T2Pi and T4Li , operate at pixel level (*x, y*). The classification for each pixel is a 2-class problem, where the masks are predicted using sub-networks f ′ 2 and f ′ 4 (with identical weights). Lastly, T5i calculates pairwise contrastive loss using Euclidean distance Di between encoder representations of XPi and XLi as: $$T_{5_{i}}=(Y_{i})\frac{1}{2}(D_{i})^{2}+(1-Y_{i})\frac{1}{2}\mathrm{max}(0,m-D_{i})^{2}.$$ Here, m denotes the margin parameter. Yi = 1 for a genuine pair, while Yi = 0 for an imposter pair. Overall Loss Function: Taking into account the missing ground truth labels (Z), proposed task gating (G), and loss value normalization (w), the net loss L˜′iis computed as: $$\hat{\cal L}^{\prime}{}_{i}=G_{1}w_{1}Z_{1i}T_{1P_{i}}+G_{2}w_{2}Z_{2i}T_{2P_{i}}+G_{3}w_{3}Z_{3i}T_{3L_{i}}+G_{4}w_{4}Z_{4i}T_{4L_{i}}+G_{5}w_{5}Z_{5i}T_{5i}.$$ . (21) ## 3 Experimental Details 3.1 Databases And Protocols In this study, two kinds of experiments are performed. For the first experiment with **unilateral MTL**, we have taken two case studies with two different datasets. The first case study is on faces, while the second is $$(20)$$ $$(21)$$ | Task No. | Task | Task | Training | Testing | | |------------|------------|--------|------------|-----------|------| | | Depth | Count | (%) | (Count) | | | 1 | Gender | 17 | 8434 | 50 | | | 2 | Spectacles | 17 | 12731 | 75 | | | 3 | Landmark | 17 | 12727 | 75 | 7384 | | 4 | Pose angle | 17 | 6692 | 40 | | | 5 | Denoising | 26 | 17000 | 100 | | Table 2: Train-test split for the AFLW database, with unequal ground-truth label count selected for each task. | Task | Training | | Testing | | | |--------|------------------|------------|-----------|-------|---------| | No. | Task | Task Depth | Count | (%) | (Count) | | 1 | FP Orientation | 17 | 33340 | 79.12 | | | 2 | FP Segmentation | 26 | 33340 | 79.12 | | | 3 | LFP Orientation | 17 | 32308 | 76.76 | 13577 | | 4 | LFP Segmentation | 26 | 9756 | 23.15 | | | 5 | Matching | 13 | 42140 | 100 | | Table 3: Consolidated fingerprint database used for experiments. The labels counts are as per the source availability. on character recognition, with experiments performed on the AFLW and OmniGlot datasets, respectively. The second experiment of **Bilateral MTL** is performed on latent fingerprints. A summary of the datasets is given below. 1. Unilateral MTL: For **faces**, we use the **AFLW dataset (Koestinger et al., 2011)** having 24,384 usable faces. We use 70% (17,000) for training and 30% (7,384) for testing. The cropped face images are deteriorated by adding speckle noise to 15% of pixels. Table 2 shows that a varying proportion of training labels are selected for each task. For the testing set, no tags are discarded. Omniglot database (et al., 2015) consists of 50 handwritten alphabets, each of which has its respective character recognition tasks. Omniglot is a relevant database for the application of MTL since a large number of classes can illustrate the performance of the proposed method as a function of the number of classes. Furthermore, the tasks are related as knowledge of the alphabets can help classes to learn from each other. The dataset consists of grayscale images of resolution 105×105, with 20 instances for each character. We follow the standard MTL protocol as suggested in the literature (Liang et al., 2018; Meyerson & Miikkulainen, 2018; Prellberg & Kramer, 2020). A fixed random training and testing split is created by selecting a split of 20% as the test set from each alphabet, with the remaining 80% considered training. The architecture and experimental details are highlighted in Section 4.3. 2. Bilateral MTL: We use a consolidated set from three fingerprint datasets: **NIST SD 27 (NISTSD-27, 2000), IIITD MOLF (Sankaran et al., 2015), and MUST (Malhotra et al., 2022b)**, with numbers shown in the Table 3. The pairs for the fifth task are considered in a subject-disjoint split. Details for each of the database is listed below: NIST SD 27 (NIST-SD-27, 2000) has 258 latent fingerprints with respective inked fingerprint, resulting in 258 genuine pairs. An equal number of imposter pairs are added, making a total of 516 pairs. In NIST SD 27, there are segmentation masks for latent impressions. Further, each fingerprint and latent fingerprint are manually annotated for orientation. All of the 516 pairs are included in training set, with labels available for only four tasks (T1, T3, T4, and T5). IIITD MOLF (Sankaran et al., 2015) has 4,400 latent fingerprints (DB4). A genuine and an imposter pair with a fingerprint is formed for each latent fingerprint, totalling 8,800 pairs. Each pair has only the label for the fifth task (match/non-match) and all 8,800 pairs are included in training set. IIITD MUST Latent Fingerprint database (Malhotra et al., 2022b): As per the defined protocol for the MUST database, there is a subject disjoint train-test split. Using the train identities, 32,824 train pairs are formed (with an equal number of genuine and imposter pairs). The knowledge of genuine and imposter pairs affirms the match/non-match information for the fifth task. Finally, the MUST database's test set is used for the testing procedure for the multi-task network. The test set has 13,577 query latent fingerprints, which are matched against all the test gallery fingerprints. The ground-truth labels for the testing set have information for all pairs for orientation (T1, T3) and matching (T5). However, for a few pairs, the segmentation masks are missing. ## 3.2 Implementation Details The pseudo-code for task-wise sampling of activation bits using the DST algorithm is in the appendix. The models are trained on a machine with Intel Core i7 with 128 GB RAM and NVIDIA GeForce RTX 2080Ti GPU in a PyTorch implementation. Learning rate is set at 5 × 10−5 with Adam optimizer. The encoder in MTL is initialized with VGG16 (Simonyan & Zisserman, 2014) pre-trained weights of the ImageNet dataset. During training, error backpropagation and weight update are performed from the second epoch to obtain initial loss estimates. β in Eq. 6 is set as 0.1 to ensure a slower change for the 'stagnant' parameter. Further, all λiin Eq. 8 are kept as 0.2 to provide equal weight to each metric. For face MTL, the input is a cropped face image of size 224×224×3. The model is trained for 100 epochs with a batch size of 16. For fingerprint MTL, the input is a fingerprint-latent fingerprint image pair at resolution 340×280×3. The model is trained for 75 epochs with a batch size of 4. ## 4 Results And Analysis This section shows the efficacy of the proposed DST algorithm. The chosen applications are: (a) multitask face (AFLW (Koestinger et al., 2011)), (b) multi-task fingerprint (IIITD MOLF (Sankaran et al., 2015), MUST (Malhotra et al., 2022b), and NIST SD27 (NIST-SD-27, 2000)), and (c) multi-task character recognition (Omniglot (et al., 2015)). Subsequently, in Section 4.4, we present an ablation study to study the effects of each selected metric, λi, wt, network depths and initialization, and varying sample counts. As seen in Table 4 to, Table 5, and Table 7, the proposed DST algorithm reports minimum average errors across all the three applications (face: 10.75%, fingerprint: 18.87%, character: 10.41%). We compare the results against STL, MTL and random task drop. Furthermore, the results are also compared against other task prioritization or scheduling algorithms (Lee et al., 2018; Chen et al., 2018b; Guo et al., 2018; Jean et al., 2019; Liu et al., 2019a; Maninis et al., 2019; Chen et al., 2020; Liu et al., 2022) with varying necessary parameters. Furthermore, the comparative results show that α = 0.5 are the desired parameters for GradNorm (Chen et al., 2018b) and LBTW (Liu et al., 2019a). After the best performanc by the proposed DST, we also observe that LBTW (Liu et al., 2019a), Gradient Drop (Chen et al., 2020), and Auto-λ (Liu et al., 2022) result in competitive performance across the three applications. We derive information from the train set for all algorithms that require task-wise performance/loss values to weigh/schedule tasks. ## 4.1 Unilateral Mtl: Faces When MTL is performed for different tasks with input as face images, the results are shown in Table 4. Visually, prediction outputs for denoising and landmark prediction are shown in Figure 8 and 9 of the appendix, and briefly in Figure 7 on this main paper. We observe that the regression tasks (T3, T4, and T5) undergo negative transfer compared to STL. On the contrary, gender classification improves by 1.15% over corresponding STL. The gender prediction task has 40% labeled samples. Hence, learning from other tasks helps in a performance gain for gender task. By allowing a negligible drop in gender classification performance, DST improves performance for all the other four tasks and reports the least average error. For landmark localization, the DST algorithm provides a 1.3% lower error than the STL. This can be seen from loss and task activation plots in Figure 6. The relatively more computation cycles for landmark localization with the occasional absence of others help task 3 move towards its minima. Concurrently, the occasional ON/OFF of tasks 1, 2, and 4 limits trained tasks from overfitting. Once trained towards the end, the DST algorithm also reduces the activation probability of T3. Further, to intuitively illustrate the effect of DST, we study two tasks using their T-Sne plot in Figure 5. When tasks of gender classification (T1) and "wearing spectacles" (T2) are trained as a vanilla MTL, we get ![13_image_0.png](13_image_0.png) Figure 5: t-SNE plot for gender classification (T1) and "wearing spectacles" (T2) in a vanilla MTL & and with the proposed DST algorithm. The axis represent a 2D projection of high dimensional features (encoder representation of size 1×512), as obtained by the t-SNE algorithm. Notice the two green clusters in the right t-SNE plot. As the gender task dominates, we see that it overpowers the T2 of "wearing spectacles", resulting in three clusters for T2: (i) not wearing spectacles (red), (ii) females with spectacles (left green), and (iii) males with spectacles (right green). Without gender classification, we would have seen just the two groups of clusters. Using the proposed DST algorithm, we observe the lower blue-yellow representation points. While gender classes are separated similarly (left t-SNE plot), the wearing vs. non-wearing spectacles is now just two clusters (right t-SNE plot). the upper kidney-like representation cloud (green-red points). As gender task dominates, it overpowers the "wearing spectacles" task. In the T2 plot on the right, green points illustrate wearing spectacles using the vanilla MTL algorithm, while red is not wearing spectacles. Hence, when the person is "wearing spectacles", two clusters are formed (one for men with spectacles and the other for women with spectacles). The consequence is that for spectacles, there are three clusters of data, (i) not wearing spectacles, (ii) females with spectacles, and (iii) males with spectacles. Without gender classification, we would have seen just the two groups of clusters. Using the proposed DST algorithm, P(c,t) metric reduces the dominance of T1 and T2 gets more chance. T2 then makes relevant weight updates with limited influence of T1, allowing T2 to separate the "wearing spectacles" class as one cluster. Hence, we now observe in Figure 5 the lower blue-yellow representation points. While gender classes are separated similarly, the wearing vs. non-wearing spectacles is now just two clusters. Compared to other task prioritization algorithms, the proposed DST algorithm has the best overall performance and the least negative transfer. However, for α ≥ 1, GradNorm and LBTW drift away from the optimal solution and fail to work on the easier tasks (Gender and Spectacles). DTP (Guo et al., 2018) operates on key performance indicators. On the other hand, Deep Asymmetric MTL by Lee et al. (2018) aims to focus more on reliable predictors from easy tasks. Hence, the results for Deep Asymmetric MTL is much improved upon easier tasks of gender and spectacles. However, overall, the average error deteriorates to 11.52, mainly due to lower performance on the difficult task of landmark localization. Even though a task may have saturated due to an upper bound on performance, DTP still prioritizes tasks with lesser accuracy (as it has lower performance than others). While DTP has overall higher errors, we observe that it provides the near-to-best accuracy of 79.87% for the lower-performing task of gender recognition. While the overall performance of Adaptive Schedule (Jean et al., 2019) is competitive, the performance plateaus out when a task is getting closer to its STL performance. This limits the performance gain, even if there could be a scope for improvement (e.g., landmark localization). Compared with other scheduling or dropping-based studies, Maninis et al. (2019) suggested attentive singletask scheduling while Chen et al. (2020) suggested Gradient drop. As seen by the performance of Attentive Tasking (Maninis et al., 2019), scheduling single tasks results in close to optimal outcomes for easier tasks (as they are fast learners). However, a difficult task such as T3 of landmark localization remains incomplete. Finally, a dominant task causing negative transfer can have a high gradient, increasing the chances of its gradient propagation in Gradient Drop (Chen et al., 2020). To counter the effect of the dominant task, DST identifies such tasks by their properties (depth, data count, incompleteness, and stagnation). Then, DST reduces its dominance by dropping them stochastically. Furthermore, occasional switching "ON" of a task with opposite gradient can also assist in regularization, which DST achieves by its stochasticity. Experimentally, Gradient Drop (Chen et al., 2020) has a net error of 11.07% while DST outperforms with a 10.75% error on the AFLW database. Table 4: Classification accuracy (Gender and Spectacles) and normalized error (Coordinates, Pose, and Denoising) on the AFLW test set. (↓) signifies that a lower value is desired, while (↑) signifies that higher value is desired. Training Method Experiment Name | Normalized Error (%) (↓) | ± | | | | |-----------------------------------------------------------------------------|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|-----------------------------------------------|-----------------------------------------------------------------------------| | 0.03 ± 0.01 10.87 ± 0.01 20.83 ± 0.01 0.18 8.21 ± | | | | | | 0.12 ± 0.01 11.29 ± 0.04 21.09 ± 0.29 0.27 10.31 ± | | | | | | 0.31 ± 0.03 11.52 ± 0.05 21.17 ± 0.67 0.37 10.93 ± | | | | | | 0.56 ± 0.14 11.39 ± 0.65 21.06 ± 1.49 0.62 10.73 ± | | | | | | 0.11 ± 0.05 12.24 ± 0.21 21.17 ± 0.03 1.87 13.74 ± | | | | | | | 0.11 ± 0.13 15.08 ± 0.04 21.28 ± 0.05 13.73 13.85 ± | | | | | | 0.02 ± 0.01 11.01 ± 0.00 21.05 ± 0.17 0.30 8.53 ± | | | | | | 0.06 ± 0.00 12.34 ± 0.06 21.23 ± 0.29 2.23 13.99 ± | | | | | | 0.27 ± 0.01 11.01 ± 0.02 21.20 ± 1.39 0.25 8.94 ± | | | | | | 0.09 ± 0.01 10.98 ± 0.02 21.10 ± 0.04 0.24 8.37 ± | | | | | | 0.23 ± 0.02 11.38 ± 0.03 21.10 ± 0.71 0.28 10.22 ± | | | | | | 0.16 ± 0.02 11.07 ± 0.03 21.08 ± 0.17 0.26 9.35 ± | | | | | | 0.11 ± 0.00 10.82 ± 0.02 21.06 ± 0.41 0.26 7.13 ± | | | | | | 0.34 ± 0.13 11.39 ± 0.13 21.23 ± 1.07 0.43 9.87 ± | | | | | | 0.03 ± 0.00 11.21 ± 0.01 21.09 ± 0.12 0.25 8.59 ± | | | | | | 0.08 ± 0.01 10.75 ± 0.02 21.05 ± 0.32 0.24 6.91 | | | | | T1: Gender T2: Spectacles T3: Landmark T4: Pose T5: Denoising Average Error | | | | | | Classification Accuracy (%) (↑) | ± | | | | | 0.01 ± 0.13 96.82 78.05 ± | | | | | | 0.22 ± 0.43 96.00 79.20 ± | | | | | | 0.14 ± 0.59 95.95 78.90 | ± | | | | | | 0.44 ± 0.51 95.94 78.87 ± | | | | | | 0.04 ± 0.04 95.68 80.09 ± | | | | | | 0.25 ± 0.24 95.48 79.87 ± | | | | | | 0.11 ± 0.53 96.02 78.77 | ± | | | | | 0.21 ± 0.44 96.05 79.27 ± | | | | | | 0.17 ± 0.27 96.21 78.16 ± | | | | | | 0.23 ± 0.63 95.93 78.66 ± | | | | | | 0.32 ± 0.59 96.14 77.48 ± | | | | | | 0.05 ± 0.13 96.18 78.26 | | | | | ± | | | | | | 0.26 ± 0.46 95.99 α = 0.5) (Chen et al., 2018b) 79.48 Jointly GradNorm ( ± | | | | | | 0.23 ± 0.63 95.42 α = 1.0) (Chen et al., 2018b) 80.16 Jointly GradNorm ( ± | | | | | | | 0.30 ± 0.45 94.05 α = 1.5) (Chen et al., 2018b) 79.41 Jointly GradNorm ( | ± | | | | | 0.29 ± 0.62 96.17 Jointly Attentive Tasking (Maninis et al., 2019) 78.51 | | | | | Individually Trained (STL) | Jointly Asymmetric MTL (Lee et al., 2018) | α = 0.5) (Liu et al., 2019a) Jointly LBTW ( α = 1.0) (Liu et al., 2019a) Jointly LBTW ( | Jointly Adaptive Schedule (Jean et al., 2019) | Jointly Gradient Drop (Chen et al., 2020) Jointly Auto-λ (Liu et al., 2022) | | | Jointly DTP (Guo et al., 2018) | P(k,t) = 0.50) Jointly Random ( P(k,t) = 0.75) Jointly Random ( Jointly DST (Proposed) | | | | Jointly MTL | | | | | ![16_image_0.png](16_image_0.png) Figure 6: For AFLW database, (a) the training loss, (b) the task activation probability, and (c) the task-wise activation using DST algorithm. | EER (%) (↓) Average Error (%) (↓) | ± | | | |--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| | 0.65 ± 0.24 23.76 ± 1.17 15.83 79.43 ± | | | | | 0.88 ± 0.33 20.66 ± 0.01 22.25 83.06 | ± | | | | | 1.07 ± 0.45 26.21 ± 0.62 35.43 82.94 ± | | | | | 3.30 ± 1.04 37.91 ± 0.35 33.98 80.97 ± | | | | | 0.20 ± 1.55 20.47 ± 0.49 21.65 83.12 ± | | | | | 0.19 ± 0.30 25.92 ± 3.02 37.68 80.67 ± | | | | | 0.20 ± 0.10 20.98 ± 0.06 22.36 81.07 ± | | | | | 1.10 ± 1.50 20.63 ± 0.57 23.30 82.70 ± | | | | | 0.38 ± 0.82 19.30 ± 0.51 21.69 82.48 ± | | | | | 0.92 ± 1.22 20.02 ± 0.48 21.25 83.12 ± | | | | | 0.12 ± 0.13 19.47 ± 0.64 20.72 81.69 ± | | | | | 0.62 ± 0.14 20.68 ± 1.17 23.37 79.80 ± | | | | | 0.45 ± 0.39 19.74 ± 1.05 22.22 82.74 ± | | | | | 0.42 ± 0.53 18.87 ± 1.18 20.28 82.69 | | | | | ± | | | | | 0.21 ± 0.80 19.32 ± 0.21 21.24 ± 0.11 83.35 94.62 | | | | ± | | | | | 1.03 ± 0.93 21.72 ± 0.77 30.47 ± 0.23 83.06 94.72 | | | | | T2: Fingerprint Segmentation T4: Latent Segmentation T5: Siamese Verification | | | | | IoU (×100) (↑) | ± | | | | 1.02 90.96 ± | | | | | 0.10 94.37 | ± | | | | | 0.32 94.71 ± | | | | | 0.49 93.14 ± | | | | | 0.28 94.35 ± | | | | | 0.41 94.39 ± | | | | | 0.16 93.61 ± | | | | | 0.15 94.44 ± | | | | | 0.01 94.37 ± | | | | | 0.23 94.29 ± | | | | | 0.08 94.01 ± | | | | | 0.48 93.50 ± | | | | | 0.05 94.39 ± | | | | | 0.32 94.45 | | | | ± | | | | | 0.43 44.24 ± | | | | | 1.24 55.77 ± | | | | | 1.42 57.81 ± | | | | | | 0.90 58.01 ± | | | | | 1.10 50.28 ± | | | | | 2.76 24.45 ± | | | | | 0.90 55.92 ± | | | | | 0.47 51.95 ± | | | | | 0.64 57.67 ± | | | | | 1.14 56.61 ± | | | | | 1.19 59.40 ± | | | | | 0.81 57.18 ± | | | | | 0.94 59.31 ± | | | | | 0.32 58.23 ± | | | | | 0.02 59.54 ± | | | | | 0.75 59.66 | | | | Classification Accuracy (%) (↑) T1: Orientation Fingerprint T3: Orientation Latent ± | | | | | 0.58 82.40 ± | | | | | 2.91 85.78 ± | | | | | 1.17 86.30 | ± | | | | | 0.66 85.90 ± | | | | | 2.93 81.05 ± | | | | | 0.34 85.12 ± | | | | | 2.15 86.42 ± | | | | | 0.78 88.93 ± | | | | | 3.07 86.57 ± | | | | | 0.63 88.35 ± | | | | | 4.27 88.43 ± | | | | | 0.76 86.86 ± | | | | | 1.29 89.14 | | | | | ± | | | | | 0.33 α = 0.5) (Chen et al., 2018b) 88.66 Jointly GradNorm ( ± | | | | | 5.62 α = 1.0) (Chen et al., 2018b) 76.47 Jointly GradNorm ( ± | | | | | 4.90 α = 1.5) (Chen et al., 2018b) 45.88 Jointly GradNorm ( | | | | Individually Trained (STL) | Jointly Attentive Tasking (Maninis et al., 2019) | | | | Jointly Asymmetric MTL (Lee et al., 2018) | α = 0.5) (Liu et al., 2019a) Jointly LBTW ( α = 1.0) (Liu et al., 2019a) Jointly LBTW ( | Jointly Adaptive Schedule (Jean et al., 2019) | Jointly Gradient Drop (Chen et al., 2020) Jointly Auto-λ (Liu et al., 2022) | | | Jointly DTP (Guo et al., 2018) | P(k,t) = 0.50) Jointly Random ( P(k,t) = 0.75) Jointly Random ( Jointly DST (Proposed) | | | Jointly MTL | | | | Table 5: Classification accuracy (Orientation), IoU (Segmentation), and EER (Pairwise matching) on the IIITD MUST test set. (↓) signifies that a lower value is desired, while (↑) signifies that higher value is desired. Training Method Experiment Name | SegNet | UNet | | | | |-------------------------------|----------------------------|-----------|-----------|-----------| | (Badrinarayanan et al., 2017) | (Ronneberger et al., 2015) | MTL | DST | | | Fingerprint | 0.91±0.01 | 0.92±0.01 | 0.94±0.00 | 0.94±0.00 | | Latent | 0.79±0.01 | 0.80±0.02 | 0.83±0.00 | 0.83±0.01 | Table 6: Segmentation performance (IoU) for DST compared against different encoder-decoder deep architectures. ## 4.2 Bilateral Mtl: Fingerprints When MTL is performed for different tasks with input as pair of fingerprint images, the results are shown in Table 5, followed by segmentation task results in Table 6. Visually, prediction outputs for latent and fingerprint segmentation is shown in Figure 12 and 13 of the appendix and briefly in Figure 7. Figure 14 in appendix shows the ROC curve for the fifth task of latent fingerprint comparison. Under bilateral MTL with application on fingerprints, the fifth task of pairwise matching has the largest number of annotated ground-truth samples. Training other tasks in presence of pairwise matching task improves their performances. However, the fifth task (pairwise matching) undergoes a negative transfer due to the segmentation tasks, which have far lower samples. The DST algorithm ensures performance gain in orientation and verification tasks with a negligible drop in the performance of latent fingerprint segmentation task (T4). Overall, with improvement in four tasks, the proposed DST algorithm reports the least overall error across algorithms. Visually, as seen in Figure 7, DST gives good segmentation results for fingerprint segmentation (T2) and sufficient latent fingerprint segmentation results (T4). We compare results of the DST algorithm with MTL and other encoder-decoder algorithms for segmentation, as shown in Table 6. We observe that the proposed DST algorithm reports the best IoU for fingerprint segmentation. Further, similar to MTL, the DST algorithm also overpowers the standard SegNet and U-Net for latent fingerprint segmentation. Hence, with a minimal reduction in the performance of latent segmentation, the DST algorithm limits negative transfer. The training graphs of DST for fingerprints are shown in Figure 11 in the appendix. The proposed DST algorithm has the overall best performance of 18.87% compared to other task prioritization algorithms for fingerprint applications. Similar to faces, GradNorm and LBTW provide competitive performances when α = 0.5. However, they report higher errors for α ≥ 1, where possibly the solution drifted away from the optima. Asymmetric MTL, while considering easier tasks as reliable, does give one of the best results for segmentation tasks. However, it has the highest overall error due to sub-par performance on the difficult task of verification (T5). DTP aims to prioritize lower-performing tasks. Thus, DTP provides a near-to-best performance of 57.67% for latent fingerprint orientation classification (T3) as it is the worst-performing task across five tasks of fingerprints (when trained in MTL setting). However, due to T3, well-performing tasks T1, T2, and T4 observe a higher drop in performance. Hence, DTP reports an overall error of 20.98% compared to 18.87% by DST. Attentive single-tasking and Auto-λ provide one of the best performances after the proposed DST algorithm. This can be attributed to better disentangling and reduced interference, as unlike faces and character recognition, the tasks are more diverse in fingerprints. Gradient Drop provides an overall error of 20.02%. While T2, T4, and T5 are comparable, DST outperforms due to higher accuracy in T1 and T3. This possibly results from more "ON" time for T3 (latent orientation) in DST, which is similar to T1 (fingerprint orientation) and improves its performance as well(refer to Figure 11(c) of the appendix). ## 4.3 Unilateral Mtl: Character Recognition We illustrate the results of multi-task character recognition using the Omniglot dataset, which is commonly used to highlight performance on a high number of tasks in MTL. In this study, since face and fingerprint had architecture similar to VGG16, we also utilized VGG (encoder only) based architecture for this application. Given all the tasks are classification tasks for Omniglot character recognition, all tasks are placed at the same depth. A VGG encoder is used as the shared backbone, followed by a branch for each task after the last encoder layer to classify a character in the MTL setup. The branch consists of three dense layers, with the Noisy Face Denoising Landmarks Localization Latent FP Segmentation FP Segmentation ![19_image_1.png](19_image_1.png) ![19_image_0.png](19_image_0.png) Figure 7: Sample outputs from the proposed DST and other comparative algorithms for face denoising, landmark localization, and segmentation tasks. Additional instances are shown in the appendix. | Algorithm | Avg. Error (%) | |------------------------------------------|------------------| | MTL | 11.26 | | Asymmetric MTL (Lee et al., 2018) | 10.81 | | GradNorm (α = 0.5) (Chen et al., 2018b) | 10.84 | | LBTW (α = 0.5) (Liu et al., 2019a) | 10.59 | | DTP (Guo et al., 2018) | 10.77 | | Adaptive Schedule (Jean et al., 2019) | 10.74 | | Attentive Tasking (Maninis et al., 2019) | 10.67 | | Gradient Drop (Chen et al., 2020) | 10.61 | | Auto-λ (Liu et al., 2022) | 10.52 | | DST (Proposed) | 10.41 | | Details | Accuracy (%)(↑) | Normalized Error (%)(↓) | | | | | |---------------|-------------------|---------------------------|------|------|-------|-------| | T1 | T2 | T3 | T4 | T5 | Avg. | | | Proposed | 78.26 | 96.18 | 6.91 | 0.24 | 21.05 | 10.75 | | Small MTL | 70.31 | 96.11 | 5.69 | 0.29 | 25.56 | 13.02 | | Small DST | 70.51 | 96.47 | 5.28 | 0.25 | 24.61 | 12.63 | | Early stop | 77.97 | 91.71 | 8.99 | 0.26 | 21.05 | 12.12 | | Just P(u,k,t) | 79.43 | 96.23 | 8.97 | 0.47 | 21.02 | 10.96 | | P′ (c,t) | 77.89 | 95.67 | 8.47 | 0.29 | 21.09 | 11.26 | Table 7: Average error (%)(↓) on the Omniglot dataset. Table 8: Ablation results on AFLW dataset. T1: gender, T2: spectacles, T3: landmark, T4: pose, & T5: denoising. dense output layer having units equal to the number of classes. As mentioned earlier, the shared encoder in MTL is initialized with VGG16 (Simonyan & Zisserman, 2014) pre-trained weights of the ImageNet dataset. Using this architecture, MTL yields an error of 11.26%. Table 7 also shows the performance of other task prioritization algorithms. Compared to just 10.41% error by the proposed DST algorithm, other task prioritization algorithms have a relatively higher error in the range of 10.52% to 10.84%. For reference, with a fixed ResNet18 architecture, Prellberg & Kramer (2020) illustrated the average baseline error on Omniglot as ∼10.70%. ## 4.4 Ablation Study The proposed DST algorithm involves multiple variability points that need to be tested to validate the effectiveness of DST. Table 8 and Table 9 highlight ablation results under different settings. With the ablation study, we check the impact of weight initialization, network depths, data count, wt in Eq. 17, varying λ (from Eq. 8) and, consequently, the effect of each of the four metrics. We also check a closely possible extension of DST, where the tasks get dropped with a fixed static probability. Each of these ablations is presented in this subsection. These ablation experiments are conducted on the AFLW dataset. ## 4.4.1 Random Drop A static random drop is closer to the dynamic task dropping of DST for comparison. To perform ablation and check if a random drop can achieve a good performance, we drop tasks with a probability of 0.25 and 0.50. This implies that with a throughout fixed activation probability P(k,t), the tasks are stochastically dropped with a constant probability 1 − P(k,t). Static dropping gives slightly better performance than MTL, but not that of DST, as highlighted in the bottom three rows of Table 4 and 5. Random drop reports the second-best results after the DST algorithm for a few tasks. For instance, T2 of AFLW (wearing spectacles?) has just 0.04% lower performance for random drop than DST. Likewise, T4 of latent fingerprint segmentation also has a difference of 0.05% in IoU. One reason could be the fact that for these tasks, the DST algorithm has E(P(k,t)) closer to the static random drop probability. However, of overall performance, DST outperforms static random drop. Table 9: Ablation study on the AFLW (Koestinger et al., 2011) test set by leaving out or keeping certain metrics. Classification accuracy (Gender and Spectacles) and normalized error (Coordinates, Pose, and Denoising) reported different probability weights. A (↓) signifies that a lower value is desired, while (↑) signifies that higher value is desired. Only µ values reported here in interest of space. | 11.29 11.15 11.04 11.25 11.03 11.13 11.16 11.33 10.96 10.96 11.07 10.93 11.52 11.03 11.22 10.75 | | |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| | Denoising | | | Average Error T5: 0.27 21.09 0.26 21.10 0.29 21.07 0.27 21.07 0.29 21.06 0.29 21.05 0.34 21.09 0.32 21.10 0.47 21.02 0.27 21.06 0.30 21.09 0.27 21.05 0.34 21.07 0.31 21.06 0.29 21.07 0.24 21.05 | | | Normalized Error (%) (↓) | Coordinates | | T4: Pose T3: 10.31 9.11 8.86 9.89 8.99 9.80 9.65 9.60 8.97 8.75 8.41 8.68 10.90 8.39 9.82 6.91 T2: Spectacles 96.00 96.37 96.18 96.10 96.05 96.38 96.22 96.45 96.23 96.27 96.30 95.93 96.14 96.25 96.11 96.18 | | | Classification Accuracy (%) (↑) T1: Gender 79.20 0.00 0.25 0.25 0.25 0.25 78.37 0.25 0.00 0.25 0.25 0.25 78.86 0.25 0.25 0.00 0.25 0.25 78.85 0.25 0.25 0.25 0.00 0.25 79.14 0.25 0.25 0.25 0.25 0.00 79.10 1.00 0.00 0.00 0.00 0.00 79.06 0.00 1.00 0.00 0.00 0.00 77.92 0.00 0.00 1.00 0.00 0.00 79.43 0.00 0.00 0.00 1.00 0.00 79.04 0.20 0.20 0.30 0.30 0.00 78.14 0.10 0.10 0.40 0.40 0.00 79.42 0.40 0.40 0.10 0.10 0.00 78.56 0.15 0.15 0.30 0.30 0.10 78.36 0.30 0.30 0.15 0.15 0.10 78.96 0.20 0.20 0.20 0.20 0.20 78.26 Individual Probability Weights λd λc λu λr λb Traditional MTL Regularization ✔ ✔ ✔ ✔ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✔ ✔ ✔ Details Leave-one metric out Only static metrics Only dynamic metrics Varying weights w/o regularization Varying weights with regularization Proposed | | ## 4.4.2 Network Initialization We used encoder with VGG16 ImageNet pre-trained weights for stable initialization (to mitigate high initial loss (V(1,t)). Alternatively, we also estimate initial loss with N = 10 different initializations and observe that it slightly reduces the effect of randomness. It yields similar average error of 10.70%. ## 4.4.3 Varying Network Depth Negative transfer is more likely when a task creates dominance due to being shallower. To show stability for different network structure, T1 FC branch is preponed to 7 th conv instead of original 13th. Position of other tasks remain the same. With MTL (Row-2, Table 8), we observe an adverse effect on the deepest task T5. T1 gets deteriorated due to information loss (larger GAP resolution). T3 got improved with less interference in learning at encoder. With proposed DST (Row-3, Table 8), the dominance of shallower task T1 gets reduced on the deepest task T5. Overall, with other network architectures, we observe improved performance with DST. ## 4.4.4 Overfitting A cause for negative transfer could be overfitting. To counter overfitting, we: (i) early stop, or (ii) probabilistically drop early completed tasks (only P(*u,k,t*) as metric). For first case, completed tasks are early stopped when its MTL loss value reaches its optimal STL loss value (Row 4, Table 8). Here, classification tasks suffer as other regression tasks (T3, T5) stay longer to make undesirable weight updates for T1 and T2. Secondly, with only P(*u,k,t*), we observe overall sub-par performance with T3 being the most affected (Row 5, Table 8). T3 got limited ON time despite its stagnation (due to absence of P(*r,k,t*)). ## 4.4.5 Inverse Case Of Data Count We also perform ablation for the inverse case where a task with lower ground-truth labeled samples is preferred over a task with more labeled samples (against the original assumption of Eq. 2 where a task with more labeled samples is preferred). If the performance turns out to be better than the proposed DST, this could mean that a task with lower ground-truth labeled samples leads to positive transfer. The selection criterion is updated as follows: $${\mathcal{P}}^{\prime}{}_{(c,t)}={\frac{\operatorname*{min}_{1\leq t\leq K}(c_{t})}{c_{t}}}.$$ $$(22)$$ ct. (22) The results from the above formula are reported in row 6 of Table 8. We observed a higher average error of 11.26% than 10.75% from the proposed DST. Hence, our original assumption holds that tasks with fewer samples can hamper generalizability while higher sample tasks improve generalization (also shown by (Wu et al., 2020)). ## 4.4.6 Wt **In Eq. 17** wt scales losses to a standard initial value such that task-wise losses are in the same range for Figure 6a. Removing it has a minimal effect on the DST algorithm as both task incompleteness (Section 2.1.3) and stagnation (Section 2.1.4) operate on loss ratios. With wt, the error of MTL reduces by 0.54% while without wt, the reduction is by 0.40% only. ## 4.4.7 Varying Λ **And Metrics** A detailed ablation on varying λ values in Eq. 8 is shown in Table 9. It also includes keeping certain λ = 0 (not considering a metric) and keeping a specific λ = 1 (considering only one metric). As we see in the rows titled "*Only dynamic metrics*qq, the greatest contribution towards performance is due to dynamic parameters (P(*u,k,t*) and P(*r,k,t*)). In these cases, one of the lowest errors of 10.96% is observed. While other static metrics encode intrinsic properties of model and amount of training labels, P(*u,k,t*) and P(*r,k,t*) dynamically favors tasks during training that require more computational cycles. We observe the same behavior when λu and λr are relatively given higher weights, and an even lower error of 10.93% is seen. ## 5 Conclusion Due to joint optimization in Multitask Learning, some task(s) may face a *negative transfer*. We propose Dropped Scheduled Task (DST) algorithm to reduce the impact of negative transfer. Based on the scheduling probability, the DST algorithm gives computation cycles to specific tasks while the others are "*dropped*". For each task, the scheduling probability is decided based on four different metrics. These metrics rely on: (i) task depth, (ii) the number of ground-truth samples per task, (iii) task training completion, and (iv) task stagnancy. For experimental results, three MTL applications are chosen related to faces, (latent) fingerprints, and character recognition. Due to the occasional task *dropping* of learned or dominating tasks, more computation cycles are given to stagnant/slower/weaker tasks, helping them to move towards their minima. In the process, the *dropped* task(s) refrain from overfitting, resulting in a generalizable solution. Overall, the results show minimum negative transfer and overall least error across different algorithms and tasks. This research focuses on the metrics defined in the DST algorithm for vanilla MTL. As for future implications of this study, these metrics can also have broader implications and use cases. For instance, task incompleteness and task stagnation metrics can be extended for the case of single-task classification models, where the aim is to increase the performance for a weaker class. Similarly, the metric on task depth and training sample count can become vital in MTL with auxiliary tasks. In such a scenario, these metrics can be used as it is or altered to prioritize the main task more compared to other auxiliary tasks. ## Acknowledgments A. Malhotra acknowledges IIT Jodhpur for hosting him during this research. A. Malhotra is partially supported through Visvesvaraya Ph.D. Scheme by MEITY, Govt. of India. M. Vatsa is supported through the Swarnajayanti Fellowship by the Government of India. ## References Amine Amyar, Romain Modzelewski, Hua Li, and Su Ruan. Multi-task deep learning based ct imaging analysis for covid-19 pneumonia: Classification and segmentation. *Computers in Biology and Medicine*, 126:104037, 2020. Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation. *IEEE Transactions on Pattern Analysis and Machine Intelligence*, 39(12):2481–2495, 2017. Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum Learning. In *International Conference on Machine Learning*, pp. 41–48, 2009. Rich Caruana. Multitask learning. *Machine learning*, 28(1):41–75, 1997. Xuepeng Chang, Huihui Pan, Weichao Sun, and Huijun Gao. Yoltrack: Multitask learning based real-time multiobject tracking and segmentation for autonomous vehicles. IEEE Transactions on Neural Networks and Learning Systems, 32(12):5323–5333, 2021. Junkun Chen, Kaiyu Chen, Xinchi Chen, Xipeng Qiu, and Xuanjing Huang. Exploring Shared Structures and Hierarchies for Multiple NLP Tasks. *arXiv preprint arXiv:1808.07658*, 2018a. Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee, and Andrew Rabinovich. Gradnorm: Gradient Normalization for Adaptive Loss Balancing in Deep Multitask Networks. In *International Conference on Machine* Learning, pp. 794–803, 2018b. Zhao Chen, Jiquan Ngiam, Yanping Huang, Thang Luong, Henrik Kretzschmar, Yuning Chai, and Dragomir Anguelov. Just pick a sign: Optimizing deep multitask models with gradient sign dropout. *arXiv preprint* arXiv:2010.06808, 2020. Sauhaarda Chowdhuri, Tushar Pankaj, and Karl Zipser. Multinet: Multi-modal multi-task learning for autonomous driving. In *2019 IEEE Winter Conference on Applications of Computer Vision (WACV)*, pp. 1496–1504. IEEE, 2019. Xinghao Ding, Yunshu Chen, Zhen Tang, and Yue Huang. Camera identification based on domain knowledgedriven deep multi-task learning. *IEEE Access*, 7:25878–25890, 2019. Kshitij Dwivedi and Gemma Roig. Representation similarity analysis for efficient task taxonomy & transfer learning. In *IEEE/CVF Conference on Computer Vision and Pattern Recognition*, pp. 12387–12396, 2019. Jeffrey L Elman. Learning and development in neural networks: The importance of starting small. Elsevier Cognition, 48(1):71–99, 1993. Lake et al. Human-level concept learning through probabilistic program induction. *Science*, 350(6266): 1332–1338, 2015. Liang Ge, Jing Gao, Hung Ngo, Kang Li, and Aidong Zhang. On Handling Negative Transfer and Imbalanced Distributions in Multiple Source Transfer Learning. Statistical Analysis and Data Mining: The ASA Data Science Journal, 7(4):254–271, 2014. Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Dropblock: A Regularization Method for Convolutional Networks. In *Advances in Neural Information Processing Systems*, pp. 10727–10737, 2018. Ting Gong, Tyler Lee, Cory Stephenson, Venkata Renduchintala, Suchismita Padhy, Anthony Ndirango, Gokce Keskin, and Oguz H Elibol. A comparison of loss weighting strategies for multi task learning in deep neural networks. *IEEE Access*, 7:141627–141632, 2019. Alex Graves, Marc G Bellemare, Jacob Menick, Rémi Munos, and Koray Kavukcuoglu. Automated Curriculum Learning for Neural Networks. In *International Conference on Machine Learning*, pp. 1311–1320, 2017. Michelle Guo, Albert Haque, De-An Huang, Serena Yeung, and Li Fei-Fei. Dynamic Task Prioritization for Multitask Learning. In *European Conference on Computer Vision*, pp. 270–287, 2018. Hu Han, Anil K Jain, Fang Wang, Shiguang Shan, and Xilin Chen. Heterogeneous face attribute estimation: A deep multi-task learning approach. *IEEE transactions on pattern analysis and machine intelligence*, 40 (11):2597–2609, 2017. Lei Han and Yu Zhang. Learning Multi-Level Task Groups in Multi-Task Learning. In AAAI Conference on Artificial Intelligence, pp. 2638–2644, 2015. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. Sébastien Jean, Orhan Firat, and Melvin Johnson. Adaptive Scheduling for Multi-Task Learning. arXiv preprint arXiv:1909.06434, 2019. Georgios Kapidis, Ronald Poppe, and Remco C Veltkamp. Multi-dataset, multitask learning of egocentric vision tasks. *IEEE Transactions on Pattern Analysis & Machine Intelligence*, (01):1–1, 2021. Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics. In *IEEE Conference on Computer Vision and Pattern Recognition*, pp. 7482–7491, 2018. Martin Koestinger, Paul Wohlhart, Peter M Roth, and Horst Bischof. Annotated Facial Landmarks in the Wild: A Large-scale, Real-world Database for Facial Landmark Localization. In *IEEE International* Conference on Computer Vision Workshops, pp. 2144–2151, 2011. Abhishek Kumar and Hal Daume III. Learning Task Grouping and Overlap in Multi-Task Learning. *arXiv* preprint arXiv:1206.6417, 2012. Giwoong Lee, Eunho Yang, and Sung Hwang. Asymmetric Multi-task Learning Based on Task Relatedness and Loss. In *International Conference on Machine Learning*, pp. 230–238, 2016. Hae Beom Lee, Eunho Yang, and Sung Ju Hwang. Deep asymmetric multi-task feature learning. In *International Conference on Machine Learning*, pp. 2956–2964. PMLR, 2018. Yong Jae Lee and Kristen Grauman. Learning the Easy Things First: Self-paced Visual Category Discovery. In *IEEE Conference on Computer Vision and Pattern Recognition*, pp. 1721–1728, 2011. Yinshuo Li, Jianyong Song, Wenkai Lu, Patrice Monkam, and Yile Ao. Multitask learning for super-resolution of seismic velocity model. *IEEE Transactions on Geoscience and Remote Sensing*, 59(9):8022–8033, 2020. Jason Liang, Elliot Meyerson, and Risto Miikkulainen. Evolutionary architecture search for deep multitask networks. In *Genetic and Evolutionary Computation Conference*, pp. 466–473, 2018. Lukas Liebel and Marco Körner. Auxiliary Tasks in Multi-task Learning. *arXiv preprint arXiv:1805.06334*, 2018. Shengchao Liu, Yingyu Liang, and Anthony Gitter. Loss-Balanced Task Weighting to Reduce Negative Transfer in Multi-Task Learning. In *AAAI Conference on Artificial Intelligence*, volume 33, pp. 9977– 9978, 2019a. Shikun Liu, Edward Johns, and Andrew J Davison. End-to-end multi-task learning with attention. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1871–1880, 2019b. Shikun Liu, Stephen James, Andrew J Davison, and Edward Johns. Auto−λ: Disentangling dynamic task relationships. *Transactions on Machine Learning Research*, 2022. Yongxi Lu, Abhishek Kumar, Shuangfei Zhai, Yu Cheng, Tara Javidi, and Rogerio Feris. Fully-adaptive Feature Sharing in Multi-task Networks with Applications in Person Attribute Classification. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 5334–5343, 2017. Aakarsh Malhotra, Anush Sankaran, Mayank Vatsa, and Richa Singh. Learning Representations for Unconstrained Fingerprint Recognition. *Deep Learning in Biometrics*, pp. 197–221, 2018. Aakarsh Malhotra, Surbhi Mittal, Puspita Majumdar, Saheb Chhabra, Kartik Thakral, Mayank Vatsa, Richa Singh, Santanu Chaudhury, Ashwin Pudrod, and Anjali Agrawal. Multi-task driven explainable diagnosis of covid-19 using chest x-ray images. *Pattern Recognition*, 122:108243, 2022a. Aakarsh Malhotra, Mayank Vatsa, Richa Singh, Keith B. Morris, and Afzel Noore. Multi-Surface MultiTechnique (MUST) Latent Fingerprint Database. *http://iab-rubric.org/old/resources/must.html*, 2022b. Kevis-Kokitsi Maninis, Ilija Radosavovic, and Iasonas Kokkinos. Attentive single-tasking of multiple tasks. In *IEEE/CVF Conference on Computer Vision and Pattern Recognition*, pp. 1851–1860, 2019. Meyerson and Miikkulainen. Beyond shared hierarchies: Deep multitask learning through soft layer ordering. In *International Conference on Learning Representations*, 2018. Aviv Navon, Aviv Shamsian, Idan Achituve, Haggai Maron, Kenji Kawaguchi, Gal Chechik, and Ethan Fetaya. Multi-task learning as a bargaining game. *International Conference on Machine Learning*, 2022. Anthony Ndirango and Tyler Lee. Generalization in multitask deep neural classifiers: a statistical physics approach. *Advances in Neural Information Processing Systems*, 32, 2019. NIST-SD-27. Fingerprint minutiae from latent and matching tenprint images. In National Institute of Standards and Technology. https://www.nist.gov/srd/nistsd27, 2000. Anastasia Pentina, Viktoriia Sharmanska, and Christoph H Lampert. Curriculum Learning of Multiple Tasks. In *IEEE Conference on Computer Vision and Pattern Recognition*, pp. 5492–5500, 2015. Prellberg and Kramer. Learned weight sharing for deep multi-task learning by natural evolution strategy and stochastic gradient descent. In *International Joint Conference on Neural Networks*, 2020. Yuanhang Qiu, Ruili Wang, Feng Hou, Satwinder Singh, Zhizhong Ma, and Xiaoyun Jia. Adversarial multitask learning with inverse mapping for speech enhancement. *Applied Soft Computing*, 120:108568, 2022. Rajeev Ranjan, Vishal M Patel, and Rama Chellappa. Hyperface: A deep multi-task learning framework for face detection, landmark localization, pose estimation, and gender recognition. *IEEE transactions on* pattern analysis and machine intelligence, 41(1):121–135, 2017. Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional Networks for Biomedical Image Segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 234–241. Springer, 2015. Sebastian Ruder. An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098, 2017. Anush Sankaran, Mayank Vatsa, and Richa Singh. Multisensor Optical and Latent Fingerprint Database. IEEE Access, 3:653–665, 2015. Ozan Sener and Vladlen Koltun. Multi-Task Learning as Multi-Objective Optimization. In *Advances in* Neural Information Processing Systems, pp. 527–538, 2018. Karen Simonyan and Andrew Zisserman. Very Deep Convolutional Networks for Large-scale Image Recognition. *arXiv preprint arXiv:1409.1556*, 2014. Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A Simple Way to Prevent Neural Networks from Overfitting. *The Journal of Machine Learning Research*, 15(1):1929–1958, 2014. Trevor Standley, Amir R Zamir, Dawn Chen, Leonidas Guibas, Jitendra Malik, and Silvio Savarese. Which Tasks Should Be Learned Together in Multi-task Learning? *arXiv preprint arXiv:1905.07553*, 2019. Sandeep Subramanian, Adam Trischler, Yoshua Bengio, and Christopher J Pal. Learning general purpose distributed sentence representations via large scale multi-task learning. In *International Conference on* Learning Representations, 2018. Guolei Sun, Thomas Probst, Danda Pani Paudel, Nikola Popović, Menelaos Kanakis, Jagruti Patel, Dengxin Dai, and Luc Van Gool. Task switching network for multi-task learning. In *Proceedings of the IEEE/CVF* International Conference on Computer Vision, pp. 8291–8300, 2021. Simon Vandenhende, Stamatios Georgoulis, Wouter Van Gansbeke, Marc Proesmans, Dengxin Dai, and Luc Van Gool. Multi-task learning for dense prediction tasks: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. Li Wan, Matthew Zeiler, Sixin Zhang, Yann Le Cun, and Rob Fergus. Regularization of Neural Networks using DropConnect . In *International Conference on Machine Learning*, pp. 1058–1066, 2013. Zirui Wang, Zihang Dai, Barnabás Póczos, and Jaime Carbonell. Characterizing and Avoiding Negative Transfer. In *IEEE Conference on Computer Vision and Pattern Recognition*, pp. 11293–11302, 2019. Sen Wu, Hongyang R Zhang, and Christopher Ré. Understanding and Improving Information Transfer in Multi-Task Learning. In *International Conference on Learning Representations*, 2020. Zhengyuan Yang, Yixuan Zhang, Jerry Yu, Junjie Cai, and Jiebo Luo. End-to-end multi-modal multi-task vehicle control for self-driving cars with visual perceptions. In *2018 24th International Conference on* Pattern Recognition (ICPR), pp. 2289–2294. IEEE, 2018. Amir R Zamir, Alexander Sax, William Shen, Leonidas J Guibas, Jitendra Malik, and Silvio Savarese. Taskonomy: Disentangling Task Transfer Learning. In *IEEE Conference on Computer Vision and Pattern* Recognition, pp. 3712–3722, 2018. Amir R Zamir, Alexander Sax, Nikhil Cheerla, Rohan Suri, Zhangjie Cao, Jitendra Malik, and Leonidas J Guibas. Robust Learning Through Cross-Task Consistency. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 11197–11206, 2020. Ranran Zhang, Xiaoyan Xiao, Zhi Liu, Yujun Li, and Shuo Li. Mrln: Multi-task relational learning network for mri vertebral localization, identification, and segmentation. IEEE journal of biomedical and health informatics, 24(10):2902–2911, 2020. Rui Zhang, Hongyuan Zhang, and Xuelong Li. Robust multi-task learning with flexible manifold constraint. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43(6):2150–2157, 2021a. doi: 10.1109/ TPAMI.2020.3007637. Wen Zhang, Lingfei Deng, Lei Zhang, and Dongrui Wu. A survey on negative transfer. arXiv preprint arXiv:2009.00909, 2021b. Yu Zhang and Dit-Yan Yeung. A Regularization Approach to Learning Task Relationships in Multitask Learning. *ACM Transactions on Knowledge Discovery from Data*, 8(3):1–31, 2014. ## A Appendix Algorithm 1: Sampling Task-wise activation bits (ON/OFF) with Dropped Scheduled Task (DST) Algorithm Result: G(k,:): a 1×K vector of independent Bernoulli random variables for activating/dropping individual tasks Given K tasks, task-wise network depth dt, and task-wise annotated sample count ct Initialize network weights W Initialize a value for β ∈ [0, 1] Initialize λd, λc, λu, λr, λb ∈ [0, 1] such that λd + λc + λu + λr + λb = 1 for *each task* t do Set the probability based on network depth P(d,t) =dt max 1≤t≤K (dt) Set the probability based on training sample count P(c,t) =ct max 1≤t≤K (ct) Set regularization probability P(*b, t*) = 1 end for *each epoch* k do for *each task* t do if k == 1 **then** Calculate task-wise loss value without weight update and store as V(1,t) Set P(*u,k,t*) = 1 Set P(*r,k,t*) = 1 else I(k,t) = V(k,t) V(1,t) Calculate task incompletness probability P(*u,k,t*) = min(1, I(k,t) E(I(k)) ) Calculate local rate of change R(k,t) =1 P(*u,k,t*) × V(k,t)−V(k−1,t) V(k−1,t) if k == 2 **then** Set global rate of change R′(k,t) = R(k,t) else Update global rate of change R′(k,t) = βR(k,t) + (1 − β)R′(k−1,t) end Calculate task stagnancy probability P(*r,k,t*) = min(1, E(R ′ (k) ) R′(k,t) ) end Calculate the final probability for task scheduling P(k,t) = λdP(d,t) + λcP(c,t) + λuP(u,k,t) + λrP(r,k,t) + λbP(b,t) Sample task ON/OFF bit G(k,t) = Bernoulli(P(k,t)) end end ![29_image_0.png](29_image_0.png) Figure 8: Landmark localization results from the DST algorithm for the AFLW database. ![29_image_1.png](29_image_1.png) Figure 9: Image denoising results from the DST algorithm for the AFLW database. ![30_image_1.png](30_image_1.png) ![30_image_0.png](30_image_0.png) Figure 11: For the consolidated latent fingerprint database, the task-wise (a) training loss, (b) activation probability, and (c) activation using DST algorithm. ![31_image_0.png](31_image_0.png) Figure 12: Few sample outputs for fingerprint segmentation (task 2), compared against the ground-truth masks. ![31_image_1.png](31_image_1.png) Figure 13: Few sample outputs for latent fingerprint segmentation (task 4), compared against the ground-truth masks. ![32_image_0.png](32_image_0.png)
Review 1: Summary: This paper proposes a multi-task learning framework, which differs from previous work in that the authors define several metrics for "dropping" the task in the multi-task training framework so that the tasks are dynamically dropped. The authors claim that this dropped scheduled task can help remove the negative transfer from dominant tasks. The four metrics are (1) task depth, (2) number of ground-truth samples per task, (3) amount of training completed, (4) task stagnancy. Based on these metrics, a scheduling probability is decided then the tasks can be dropped during training. Then the authors conduct experiments on three types of applications with multiple tasks. The results show that the method is effective compared to previous works. Strengths and Weaknesses: Strengths: 1. The auhtors propose a different way for multi-task training. The novel point is from the task "dropping", which is different from previous works. In this drop way, the tasks can be dynamically decided to be training or not. 2. The authors define different metrics for deciding the probability of the task drop, and these metrics are reasonably defined by considering the different aspects of the task and the training status. 3. The experiments show effectiveness in some applications. Weaknesses: 1. Though the four metrics are reasonably defined by considering the different views. One feeling is that these metrics are somehow heuristic and straightforward. It's hard to see the technique's novelty in terms of these metrics. 2. One big concern of the paper is the definition of "negative transfer". While the authors claim the negative transfer needs to be avoided and this is the main motivation for this method. It is important to mathematically define what "negative transfer" is. The best way is with some statistical measurement. 3. In terms of writing, there are some typos that need to be revised. For example, "Furthermore, The xxx". Besides, $k$ and $K$ represents differently. It is highly suggested to use unified notation. For example, $k$ and $K$ for layer, and $t$ and $T$ for tasks. 4. It is also noted in Table 3, the results of multi-task training are not good as individual training. Therefore, this is not to show the effectiveness of multi-task training. Besides, compared to some previous works, the improvements are not consistent. This is a serious problem, but more modifications of the method are encouraged to achieve better performance. Figure 5 is not so clear, for example, the legend in the figure, and the comparison of the figure is not so obvious. It can be removed then. Requested Changes: See above. Broader Impact Concerns: N/A ================================================== Review 2: Summary: This paper deals with the negative transfer problem in multi-task learning. The authors tackle the problem from a training tasks schedule perspective and propose the Dropped Scheduled Task (DST) algorithm. Specifically, for each training task, the drop probability is determined by four metrics (two statics and two dynamics): network depth, ground-truth samples, training incompleteness, and training stagnancy. The former two are static ones according to the model and dataset statistics, and the latter two are dynamic ones either based on the per-epoch loss values or on the first-order difference between consecutive epoch loss values. In addition, a constant regularization metric is given. The final dropping probability is calculated from the weighted sum of all five metrics. Three sets of experiments are performed to verify the proposed algorithm: unilateral multi-task face applications, multilateral fingerprint applications, and multi-task Omniglot character recognition. Comparison with several baseline methods shows the effectiveness of the proposed DST algorithm. Ablation studies give intuitions about each designed metric in mitigating negative transfer. Overall, the contribution lies in two aspects: (1) the designed metrics to determine the dropping probability in the multi-task setting, (2) experiments on three multi-task settings show the effectiveness. Strengths and Weaknesses: ## Strengths - The main strength is the comprehensive investigation of the proposed DST algorithm. A series of experiments and analyses are conducted to investigate the DST algorithm. - The proposed DST algorithm is verified to be effective compared with several reported MTL algorithms. The overall average performance exceeds the baselines. - Ablation and visualization give some insights into the proposed five metrics and their effect. ## Weaknesses - From the algorithm and method perspective, the proposed DST is simple and ad-hoc, involving the manually designed metrics at training time or based on training statistics. I am concerned about whether these metrics can be generalized when the test statistics are different from the training. - Although DST outperforms several baselines, except for Gradient Drop, all others are before 2020. The authors mentioned several other related methods of mitigating negative transfer, e.g., Liu et al. (2022), Sun et al. (2021), and Lee et al. (2018) (earlier one, but also focus on negative transfer). Is it possible to compare any of these new/related methods in the experiment? - There is a lacking of Omniglot settings and experiment details either in the method, experiment, or appendix section. - Formulation Equation issues: (1) Incorrect formulation, Eq. (11), (12), and (18) are incorrect. For example, Eq. (11) should be $T_{1F_i} = -g_i \log (P(g_i|X_{F_i}^{'})) -(1-g_i) \log (1-P(g_i|X_{F_i}^{'}))$, or alternatively define $g_i \in \mathbb{R}^{2}$ as a 2-dim formation. (2) No definition for symbols, e.g., before sec 2.1, $P_{(d,t)}, P_{(c,t)}, P_{(u,k,t)}$, and $P_{(r,k,t)}$ used before defined. Also, it is unclear what are $u$ and $r$ mean in the metrics. (3) There is no punctuation after each equation. (4) In Eq. (20), how is $D_i$ implemented? - Typos: For example, "easier tasks(Lee et al., 2018)", and " explored(Han et al., 2017; Ranjan et al., 2017)." miss a space before the left parentheses. - Formation issues: (1) Figure 2 is not in the proper place; (2) Unexpected space areas on Pages 11, 13, and 16; (3) The rotated results table is OK but seems a little uncomfortable for the audience. I acknowledge the efforts regarding experiments the authors made in this paper, but I think the proposed method is kind of simple and ad-hoc. Also, there remain several issues that show the paper is not ready. Requested Changes: - Recent and most related comparison methods - Correct the formulations - Correct other formations and typos Others, please refer to the above weaknesses. Broader Impact Concerns: N/A ================================================== Review 3: Summary: The authors propose a number of heuristic rules for dynamically removing the influence of specific tasks during multi-task learning (MTL). This is claimed to limit the effect of "negative transfer"---situations where the learning of one task contributes adversely to the learning of another. The heuristics are used to define a probability that the influence of a task is paused during one epoch of training. In a series of MTL experiments, the authors find that the proposed method compares favourably to baselines from the literature. Strengths and Weaknesses: Strengths: The method is simple to implement and yields good results on considered tasks. Weakness: The approach targets only limitations of MTL that are due to the training procedure, which could be overcome by scheduling the tasks. More precisely, it does not reason about potential incompatibilities between tasks which would render joint training a lost cause. In other words, should we expect there to exist _any_ algorithm without negative transfer? This limitation is reflected in the four metrics used for scheduling, none of which are directly concerned with the compatibility of learning targets. Naturally, such compatibility is hard to measure a priori, but in its absence it is difficult to assess _when_ we should expect the proposed method to work, and why. The justification for the proposed approach is very informal, for example, by referring broadly to concepts like vanishing gradients due to network depth. Similarly, "task incompleteness" is defined as the ratio of the loss in the first epoch and the loss in the kth epoch, normalized by on the "expectation" of this ratio over tasks. It is is not clear to me that the different losses in 2.2 have comparable scales/units which would make such a normalization justified. (+ a few clarity issues in the next section) Questions: Related to the previous point, the ablation study on AFLW indicates that using only p(u,k,t) (task incompleteness) for scheduling achieves performance close to the full model. A potential take-away is the most important factor is to make sure that no task is left behind. Does this hold also for other datasets/MTL tasks? Do other MTL algorithms target this idea? In some sense, it appears opposite to the curriculum learning idea of focusing on easier tasks in the beginning of training. Requested Changes: The concept of "negative transfer" is fundamental to the paper yet never formally defined. The authors cite Wang et al (2019) who attempt to define negative transfer, but, as a reader less familiar with the details of the MTL literature, I am not sure whether this definition is agreed upon in the community. Nevertheless, I think it would be appropriate to state _a_ definition in the paper. In Figure 1, negative transfer is illustrated in terms of transfer between pairs of tasks A and B in the context of another task C, where A can have a negative effect on B and B has a positive effect on C. This type of transfer is never defined in the context of multiple (>2) tasks, and never estimated from what I can tell. A clarification would be useful. In Figure 7, examples of the output from the DST algorithm are given, but no examples from other algorithms. This makes comparison difficult. Perhaps a few examples from other algorithms could be added? Broader Impact Concerns: None ================================================== Metareview: Recommendation: Accept with minor revision Comment: This paper proposes a multi-task learning framework, in which the authors define several metrics for "dropping" the task in the multi-task training framework so that the tasks are dynamically dropped. While the specific technical design is a little bit heuristic (multiple reviewers raised their concerns that the technical novelty and depth of the paper is limited, and its implication to more general tasks and its value to general audience are questionable), this is not the main evaluation criteria of TMLR. In terms of the two key criteria (claims and evidence, audience), the authors have done a reasonably good job. Therefore, I believe this paper is acceptable, provided that the authors can make necessary changes according to the detailed review comments. ==================================================
# Chasing Better Deep Image Priors Between Over- And Under-Parameterization Qiming Wu *qimingwu@cs.ucsb.edu* University of California, Santa Barbara Xiaohan Chen *xiaohan.chen@alibaba-inc.com* Decision Intelligence Lab, Damo Academy, Alibaba Group (U.S.) Yifan Jiang *yifanjiang97@utexas.edu* University of Texas at Austin Zhangyang Wang *atlaswang@utexas.edu* University of Texas at Austin Reviewed on OpenReview: *https: // openreview. net/ forum? id= EwJJks2cSa* ## Abstract Deep Neural Networks (DNNs) are well-known to act as **over-parameterized** deep image priors (DIP) that regularize various image inverse problems. Meanwhile, researchers also proposed extremely compact, **under-parameterized** image priors (e.g., deep decoder) that are strikingly competent for image restoration too, despite a loss of accuracy. These two extremes push us to think whether there exists a better solution in the middle: between over- and under-parameterized image priors, can one identify "intermediate" parameterized image priors that achieve better trade-offs between performance, efficiency, and even preserving strong transferability? Drawing inspirations from the lottery ticket hypothesis (LTH), we conjecture and study a novel "lottery image prior" (LIP) by exploiting DNN inherent sparsity, stated as: *given an over-parameterized DNN-based image prior, it will* contain a sparse subnetwork that can be trained in isolation, to match the original DNN's performance when being applied as a prior to various image inverse problems. Our results validate the superiority of LIPs: we can successfully locate the LIP subnetworks from overparameterized DIPs at substantial sparsity ranges. Those LIP subnetworks significantly outperform deep decoders under comparably compact model sizes (by often fully preserving the effectiveness of their over-parameterized counterparts), and they also possess high transferability across different images as well as restoration task types. Besides, we also extend LIP to compressive sensing image reconstruction, where a *pre-trained* GAN generator is used as the prior (in contrast to *untrained* DIP or deep decoder), and confirm its validity in this setting too. To our best knowledge, this is the first time that LTH is demonstrated to be relevant in the context of inverse problems or image priors. Codes are available at https://github.com/VITA-Group/Chasing-Better-DIPs. ## 1 Introduction Deep neural networks (DNNs) have been powerful tools for solving various image inverse problems such as denoising Zhang et al. (2017); Guo et al. (2019); Lehtinen et al. (2018); Jiang et al. (2022), inpainting Pathak et al. (2016); Yu et al. (2018; 2019b), and super-resolution Ledig et al. (2017); Lim et al. (2017); Zhang et al. (2018). Conventional wisdom believes that is owing to DNNs' universal approximation ability and learning from massive training data. However, a recent study Ulyanov et al. (2018) discovered that degraded images can be restored independently using randomly initialized and untrained convolutional neural networks (CNNs) without the supervised training phase, which is called *Deep Image Prior* (DIP). A series of works Cheng et al. (2019); Gandelsman et al. (2019) have been proposed to improve CNN-based DIPs, which indicates that specific architectures of CNNs have the inductive bias to represent and generate natural images well. Despite the advantageous performance, most DIP methods use highly **over-parameterized** CNNs with a massive number of parameters (we show this in Table 3 in appendices). Over-parameterization causes computational inefficiency and overfitting (and thus proneness) to noises. This trend has naturally invited the curious question: *does DIP have to be heavily parameterized?* That question is partially answered by Heckel & Hand (2018) by proposing the first **under-parameterized**, non-convolutional neural network for DIP named "deep decoder". Deep decoder shares across all pixels a linear combination over feature channels in each layer and thus has an extremely compact parameterization. Thanks to its under-parameterization, deep decoder alleviates the "noise overfitting noise" in DIP. However, the empirical performance of deep decoder is often not on par with overparameterized DIP models, especially on tasks like inpainting and super-resolution. This is potentially attributed to the extremely restricted capacity of deep decoder from the very beginning. The dissatisfaction on both extremes, that is using either over-parameterized CNN DIPs or under-parameterized deep decoders, pushes us to think if there is a better "middle ground": *Between overand under-parameterized image priors, can one identify "intermediate" parameterization better trade-offs* between performance, efficiency, as well as even preserving strong transferability? In this work, we adopt *sparsity* as our main tool for the above question. We seek more compactly parameterized subnetworks by pruning superfluous parameters from the dense over-parameterized CNN DIPs (overview of our work paradigm is shown in Figure 1), essentially viewing pruning as a way to smoothly and flexibly "interpolate" between over- and under-parameterization. We have several motivations for choosing sparsity and pruning from over-parameterization. On one hand, compared with dense and overparameterized DIP models, sparsity saves computations during inference and DIP fitting. Moreover, sparsity can serve as an effective prior that regularizes DNNs to have better robustness to noise Chen et al. (2022), that is important for DIP which is tasked to distinguish image content from noise. These two blessings combined make sparsity a promising "win-win" for not only DIP efficiency but also performance. On the other hand, unlike deep decoder which sticks to a compact design, exploiting sparsity follows a different "first redundant then compact" training route, which is widely found to enhance performance compared to training a compact model directly from scratch Zhou et al. (2020). Since overparameterized (especially wide) DNNs have smoother loss surfaces while smaller ones have more rugged landscapes, starting from overparameterization can ease the training difficulty Safran et al. (2021) and may particularly help the "chaotic" early stage of training Frankle et al. (2020c). The recently emerged *Lottery Ticket Hypothesis* (LTH) Frankle & Carbin (2018); Frankle et al. (2020a) suggests that every dense DNN has an extremely sparse "matching subnetwork", that can be trained in isolation to match the original dense DNN's accuracy. While the vanilla LTH studies training from random scratch, the latest works also extend similar findings to fine-tune the pre-trained models Chen et al. (2020a; 2021b). LTH has widespread success in image classification, language modeling, reinforcement learning and multi-modal learning, e.g., Yu et al. (2019a); Renda et al. (2020); Chen et al. (2020a); Gan et al. (2021). Drawing inspirations from the LTH literature, we conjecture and empirically study a novel "lottery image prior" (LIP), stated as: Given an (untrained or trained) over-parameterized DIP, it will have a sparse subnetwork that can be trained in isolation, to match the original DIP's performance when being applied as a prior to regularizing various image inverse problems. Moreover, its performance shall surpass underparameterized priors of similar parameter counts. Diving into this question has two-fold appeals. On the algorithmic side, as the first attempt to investigate LTH in the DIP scenario, it could help us understand how the topology and connectivity of CNN architectures encode natural image priors, and whether "overparameterization + sparsity" make the best DIP recipe. On the practical side, the affirmative answer to this question can lead to finding compact DIP models that are more performant than the deep decoder, hence yielding more computationally efficient solutions for image inverse problems without sacrificing performance. ![2_image_0.png](2_image_0.png) Figure 1: Overview of our work. Between the **over-** and **under-**parameterized image priors, we aim to find the sparse matching networks with better performances, efficiency and strong transferability. ## 1.1 Summary Of Contributions We now state our intended contributions from two angles: how our work might affect the deep image prior research (application), and the lottery ticket hypothesis research (methodology). To avoid misunderstandings, we want to state again: efficiency is definitely not the key target or motivation. Our key target instead is to verify the existence of a "compact" DIP model that is free from severe overfitting but at the same time different from the deep decoder. We want it partially because the deep decoder is bad in terms of performance (e.g., inpainting and super-resolution). Efficiency is also a natural byproduct that results from pruning and sparsity. Improving efficiency could reduce the single-image inference time of DIP to accelerate restoration and reconstruction, which could be helpful in latency-sensitive applications. For DIP research community, In between over- and under-parameterized image prior models, we aim to use sparsity to find an intermediate parameterized network. Specifically, compared to **over-parameterized** CNN DIPs: - We successfully locate the "matching subnetworks" 1from over-parameterized DIP models by iterative magnitude pruning. Their prevailing existence demonstrates that sparsity, as arguably the most classical natural image prior, remains relevant as a component in DIPs. - Beyond "matching", our found LIP subnetworks can even outperform DIP models on several image restoration tasks (shown in Figure 2), which is in line with the previous findings that the sparsity can enhance DNN robustness to noise and degradations Chen et al. (2022). - Also, the sparse LIP subnetworks are found with powerful transferability across both test images and restoration tasks. Importantly, that amortizes the extra cost of finding the subnetwork per DIP network, by extensively reusing the found sparse mask. It is also neatly aligned with the recent study of LTH transferability Redman et al. (2022). Meanwhile, regarding **under-parameterized** image priors such as the deep decoder: 1A matching subnetwork Frankle & Carbin (2018) is defined as a pruned subnetwork whose performance can match the original dense one, when separately trained from scratch - Our found LIP subnetworks perform remarkably better than the deep decoder of comparable parameter counts, regardless of test images or restoration tasks. It strongly signifies that pruning from over-parameterization is more promising than sticking to under-parameterization: perhaps the first time indicated in the DIP field up to our best knowledge. - Besides untrained DIP scenarios (over- and under-parameterized), we extend our method to the pre-trained GAN generator as an image prior used in compressive sensing, which further validates the prevalence of LIPs. It is beyond the existing scope of deep decoder. For the LTH research community, studying this new LIP problem is also NOT a naive extension from the existing LTH methods, owing to several technical barriers that we have to cross: We summarize the contributions as follows: - Till now, LTH has not been demonstrated for image inverse problems or DNN-based priors, to our best knowledge. Most LTH works studied discriminative tasks, with few exceptions Chen et al. (2021d). It is therefore uncertain whether high-sparsity DNN is still viable for low-level vision tasks such as DIPs. Interestingly though, despite that we demonstrate the existence of LIP, we also find that the LIP matching subnetworks cannot directly transfer to high-level vision tasks such as classification. - Existing LTH works typically require a training set to locate the sparse subnetwork. In stark contrast, owing to the nature of DIP, we train a DNN to overfit one specific image. While a handful of papers studied LTH in "data diet" settings Chen et al. (2021a); Paul et al. (2022), this paper pushes the extreme to "one-shot lottery ticket finding" for the first time. We also develop a multi-image variant of LIP which boosts performance in the cross-domain fitting. - DIP fitting practically relies on early-stopping to avoid over-fitting noise in images. The same risk exists in our iterative pruning, and we demonstrate how to robustly find the sparse matching subnetwork from one noisy image, without needing a clean reference image. ## 2 Background Work 2.1 Over-Parameterized Image Priors Despite CNNs' tremendous success on various imaging tasks, their outstanding performance is often attributed to massive data-driven learning. DIP Ulyanov et al. (2018) pioneered to show that CNN architecture alone has captured important natural image priors: by over-fitting a randomly initialized untrained CNN to a single degraded image (plus some early stopping), it can restore the clean output without accessing ground truth. Follow-up work Mataev et al. (2019) strengths DIP performance by incorporating it with the regularization by denoising (RED) framework and a series of works Mastan & Raman (2020; 2021) use the contextual feature learning method to achieve the same goal of DIP. Besides natural image restoration, DIP was successfully applied to PET image reconstruction Gong et al. (2018), dynamic magnetic resonance imaging Jin et al. (2019), unsupervised image decomposition Gandelsman et al. (2019) and quantitative phase imaging Yang et al. (2021). There have been several efforts toward customizing DIP network architectures. Liu et al. (2019) extends the DIP framework with total variation (TV) and this combination leads to considerable performance gains. Jo et al. (2021) further propose the "stochastic temporal ensemble (STE)" method to prevent DIP models from overfitting noises and thus improving performances. Chen et al. (2020c) proposed a neural architecture search (NAS) algorithm, which searches for an optimal DIP neural architecture from a search space of upsampling cell and residual connections. The searched 'NAS-DIP' model can be reused across images and tasks. Arican et al. (2022) observe that different images and restoration tasks often prefer different architectures, and hence design the image-specific NAS to find an optimal DIP network architecture for each specific image. While our work also pursues better DIPs, it substantially differs from those prior arts in terms of model compactness (approaching the under-parameterization end) and reusability. The simple pruning-based recipe also overcomes any extra design hassle (search space or algorithm) caused by NAS. We compare the results with them in the paragraph "**Comparisons with NAS-DIP and ISNAS-DIP models**" in Appendix B. ![4_image_0.png](4_image_0.png) Figure 2: LIP visual results: inpainting (row 1), super-resolution (rows 2/3) and denoising (row 4). The last column (in blue) intends to display the results with the most extremely sparse subnetwork. ## 2.2 **Under-Parameterized Image Priors** Recall that, classical image regularizers in the spatial or frequency domains often rely on no or little learning component. For example, Tomasi & Manduchi (1998) first proposed a bilateral filtering method to smooth images while preserving edges by combining image values in a nonlinear way. After that, Sardy et al. (2001) proposed a wavelet-based estimator with a robust loss function to recover signals from noises. Later, Dabov et al. (2007b) proposed a strategy based on enhancing the sparsity through grouping similar 2-D image fragments into 3-D data arrays, followed by a collaborative filtering procedure. And this algorithm achieves state-of-the-art performances in terms of both peak signal-to-noise ratio and subjective visual quality. In addition to these traditional methods, Cao et al. (2008) proposed a Gaussian mixture model for image denoising that partitions an image into overlapping patches and estimates the noise-free image patch parameters using expectation maximization (EM) and Minimum mean square error (MMSE) techniques. Elad & Aharon (2006) also presented an approach to remove Gaussian noises based on sparse and redundant representations using trained dictionaries obtained with the K-SVD algorithm. As another important concern, while over-parameterized DIPs are prone to overfitting the corrupted image, they can generate almost uncorrupted images surprisingly after a few iterations of gradient descent. Inspired by those, Heckel & Hand (2018) pioneered to design a concise and non-convolution neural network as the "prior for image restoration tasks. Such under-parameterized DIPs not only improve the efficiency of DIPbased restoration but also enable researchers to theoretically analyze the signal process. Besides, they find the architecture's simplicity could effectively avoid overfitting in the restoration process. Heckel & Soltanolkotabi (2019) further analyzed the dynamics of fitting a two-layer convolutional generator to a noisy signal and prove that early-stopped gradient descent denoises/regularizes. ## 2.3 **Lottery Ticket Hypothesis** The lottery ticket hypothesis (LTH) Frankle & Carbin (2018) states that the dense, randomly initialized DNN contains a sparse matching subnetwork, which could reach the comparable or even better performance by independently being trained for the same epoch number as the full network do. Since then, the statement has been verified in a variety of fields. In natural language processing (NLP), Gale et al. (2019) established the first rigorous baselines for model compression by evaluating state-of-the-art methods on transformer Vaswani et al. (2017) and ResNet He et al. (2016). Later, Chen et al. (2020a) successfully found trainable, transferrable subnetworks in the pre-trained BERT model. In reinforcement learning (RL), Yu et al. (2019a) confirmed the hypothesis both in NLP and RL tasks, showing that "winning ticket" initializations generally outperform randomly initialized networks, even with extreme pruning rates. In lifelong learning, Chen et al. (2020b) first demonstrated the existence of winning tickets via bottom-up pruning. In graph neural networks (GNNs), Chen et al. (2021c) first defined the graph lottery ticket and developed an unified GNN sparsification (UGS) framework to prune graph adjacency matrices and model weights. And in adversarial robustness research, Cosentino et al. (2019) evaluated the LTH with adversarial training and they successfully proved this approach can find sparse, robust neural networks. Simultaneously, many researchers started to rethink the network pruning techniques and build a rigorous baseline benchmark Liu et al. (2018); Evci et al. (2019). Some researchers explore the sparse subnetwork at the initialization stage (e.g., Wang et al. (2020) proposed the "GraSP" algorithm, which leverages the gradient flow.). And some try to find the winning tickets at early iterations Frankle et al. (2020d); Savarese et al. (2019). For example, You et al. (2019) found the "early-bird" tickets via low-cost training schemes with a large learning rate. However, as the original LTH paper Frankle & Carbin (2018) said, the proposed method cannot scale to large model and datasets. Rewinding was proposed by Frankle et al. (2019) to solve this dilemma. The found matching subnetworks also demonstrate transferability across datasets and tasks Morcos et al. (2019); Desai et al. (2019). Ma et al. (2021) thought the rewinding stage is not the only way to solve this problem and proposed a simpler yet more powerful approach called "Knowledge Distillation ticket". ## 3 Preliminaries And Approach 3.1 Finding Lottery Tickets Networks For simplicity, we formulate the dense network output as f(*z, θ*), where z is the input tensor and θ ∈ R dis the model parameters. In the same way, a subnetwork is defined as f(*z, m*⊙θ) with the binary mask m ∈ {0, 1} d, where ⊙ means element-wise product. | | Algorithm 2 Weight-sharing IMP | | | |----|----------------------------------|-------------------------|------------| | Algorithm 1 Single Image-based IMP Input: The desired sparsity s, the random code z, the untrained model fu. Output: A sparse DIP model f(z; θ ⊙ m) with image prior property. Initialization: Set mu = 1 ∈ R ||θ||0 . Set iteration i = 0, training epochs N and j ∈ [0, N]. while the sparsity of mu < s do 1. Train the fu(z; θ0 ⊙ mu) for N epochs; 2. Create the mask m′ u ; 3. Update the mask mu = m′ u ; 4. Set the model parameters: f(z; θj ); 5. create the sparse model: f(z; θj ⊙ mu); 6. i++; end while | Input: | The desired sparsity s, | the random | | | code z, the untrained model fu, x˜ denotes the degraded image and images from n domains xa ∈ {x1, x2, ..., xn}. Output: A sparse DIP model f(z; θ ⊙ m) with image prior property. Initialization: Set mu = 1 ∈ R ||θ||0 . Set iteration i = 0, training epochs N and j ∈ [0, N]. while the sparsity of mu < s do 1. loss = Pn a=1 E(f(z; θ ⊙ m); ˜xa); 2. Train the fu(z; θ0 ⊙ mu) by Backpropagation (loss) for N epochs; 3. Update the mask mu = m′ u ; 4. Set the model parameters f(z; θj ); 5. create the sparse model f(z; θj ⊙ mu); 6. i++; end while | | | Pruning Methods We use the classic *iterative magnitude-based pruning* (IMP) method Frankle & Carbin (2018), which iteratively prunes the 20% of the model weight each time. In each IMP iteration, models are trained towards the standard DIP objective to fit the *degraded observations* for a certain number of training steps following the original DIP Ulyanov et al. (2018). Our basic algorithm performs IMP over just one degraded image, and the algorithm is summarized in Algorithm 1. We further design an extended algorithm, that can perform IMP for DIP over multiple degraded images, through backbone weight sharing: the algorithm is outlined in Algorithm 2 (neither algorithm requires clean images). To show the non-triviality of the identified *matching* subnetworks, we also compare LIP with random pruning and SNIP Lee et al. (2018), a pruning-at-initialization method. We also derive a new method based on empirical observations to decide when to stop IMP iterations to find matching networks with maximal sparsities without any reference to the clean ground truths. More details are in Appendix B. Experimental Setup For evaluation models, we use hourglass architecture Ulyanov et al. (2018) and deep decoder Heckel & Hand (2018), as two representative untrained DNN image priors in the over- and underparameterization ends, respectively. For evaluation datasets, we use the popular Set5 Bevilacqua et al. (2012) and Set14 Zeyde et al. (2010). We also evaluate the transferability of subnetworks on image classification datasets such as ImageNet-20 Deng et al. (2009) and CIFAR10 Krizhevsky et al. (2009). For metrics, we mainly compare the PSNR and/or SSIM results between the restored image and the ground truth, as in Fig. 11. The parameter count of the original DIP model is 2.2 million (M); and that of the deep decoder is 0.1 M for denoising and super-resolution experiments, and 0.6 M for inpainting experiments, all following the original settings of Heckel & Hand (2018). The model sizes are plotted as horizontal coordinates in the figures. We run all experiments with 10 different random seeds: every solid curve is plotted over the 10-time average, and the accompanying shadow regions indicate the 10-time variance. Most plots see consistent results across random seed experiments and hence small variances. All images used are summarized in Fig. 17. ![7_image_0.png](7_image_0.png) Figure 3: Experimental results of finding LIP subnetworks. The first row of the figure summarizes the LTH IMP training loops and the second row denotes the evaluation of found LIP. Note that we compare the LTH IMP with Random Prune (Random) and SNIP Lee et al. (2018) prune methods, on images from different (F16 and Woman) or same domains (Face2 and Face4). Background task is denoising. ![7_image_1.png](7_image_1.png) Figure 4: Experimental Results of Multi LIP on images from same/different domains. We compare Multi LIP with LIP and random prune methods. The background task is denoising. ## 4 Lip In Untrained Image Priors Existence of LIPs In over-parameterized image priors, we first find the matching subnetworks with LIP property by implementing the single-image IMP on the DIP model. We apply the implemented Algorithm 1 on Set5 and Set14 to obtain the sparse subnetworks2 and evaluate these subnetworks on the denoising task. Results of single-image IMP in Fig. 3 (curves in gray colors) verify the existence of LIPs. To be specific, during the IMP finding process, we can find the LIP subnetworks on untrained DIPs at sparsity as high as 86.58%. While at the evaluation stage, the found LIP subnetworks with the modified objectives are still applicable, matching the dense performance at sparsity as high as 83.23%. We also compare the singleimage IMP with Random Pruning, and SNIP Lee et al. (2018). We observe from the first row in Fig. 3 that single-image IMP outperforms them at a wide sparsity range [20%, 96%]. Is Multi-image IMP A Good Extension for Finding LIPs? Like the original DIP, single-image IMP over-fits an untrained DNN on a single image and learns the features in that specific image during iterative magnitude pruning loops. To obtain the LIP subnets with more general features, we propose a new *multi-*2We prune 20% of the remaining weights in each IMP iteration, resulting in sparsity ratios si = 1 − 0.8 i. image IMP (Algorithm 2) for DIP where we replace the DIP objective with the average of multiple images. Note that all images will share the same fixed random code during IMP. We evaluate the multi-image IMP in two different settings: (i) *cross-domain* setting where we apply the multi-image IMP to the five images from Set5 Bevilacqua et al. (2012); (2) *single-domain* setting where we apply the multi-image IMP to five images of human faces with glasses. We think images from Set 5 are more diversified because they include bird, butterfly and human face contents. We compare single-image IMP winning tickets found on the F16 and the Woman images from Set5 with the cross-domain ticket, and the single-image IMP winning tickets found on Face-4 and Face-2 images with the single-domain ticket. Results presented in Fig. 4 show that multi-image LIP subnetworks can achieve better performances than dense DIP models and randomly pruned ones in the cross-domain setting. To What Extent Can LIP tickets Be Transferred? In this part, we evaluate the transferability of LIP for DIP models from three perspectives, i.e., across images, *across image restoration task types*, and from low-level to high-level tasks. Observation 1: LIP can transfer across images. As we obtained the multi-image LIPs from Set5, we evaluate them on different images in Fig.4. For instance, Fig. 4(a) shows the evaluation results on F16.png and we found the multi LIPs perform comparably well (better at extreme sparsities) with LIP dedicatedly found on the F16.png (the same phenomenon is reflected on the face-4.png (Fig.4(c)) and face-2.png (Fig.4(d))). This shows that LIP has reasonable transferability across images, even for those coming from slightly different domains. Observation 2: LIP can transfer across image restoration tasks but not to other high-level tasks. We conduct experiments to verify if a LIP matching subnet identified on one restoration task can be *re-used* in another. Furthermore, if the above question has an affirmative answer, is such transferability sustainable when transferring to or from some high-level tasks such as classification? To evaluate the transferability of LIP between image restoration tasks, we first find three LIPs for the denoising, inpainting and super-resolution tasks respectively and then transfer between them, as shown in Fig. 5. We observe that a LIP winning ticket transferred from another image restoration task always yields restoration performance comparable with the single-image LIP found on the original task, sometimes even better, for examples in Fig. 5(a) and 5(g). We then evaluate the transferability of LIP between the denoising task and image classifications on CIFAR-10 and ImageNet-20 datasets. We show the results of transferring the denoising LIP to ImageNet-20 in Fig. 6(c) and CIFAR-10 in 6(a); the CIFAR-10 LIPs to denoising task in Fig. 6(b) and ImageNet LIPs to denoising in Fig.6(d). We find transferring denoising LIP to classification is unsuccessful. Moreover, transferring winning tickets on CIFAR-10 back to the denoising DIP task also fails to generate winning tickets that are comparable with denoising LIPs. Why is the LIP Subnetwork Special and Good? To answer this, we investigate the inner structures of different subnetworks in Fig. 7. The structure of the LIP subnetwork is drastically different from those found by SNIP and random pruning, in particular the distribution of layer-wise sparsity ratios. LIP tends to preserve weights of the earlier layers (closer to the input), while pruning the later layers more aggressively (e.g, Fig. 7(a)). In contrast, SNIP tends to prune much more of the earlier layers compared to the later ones. Random pruning by default prunes each layer at approximately the same ratio. Comparing the three methods seem to suggest that for finding effective and transferable LIP subnetworks, specifically keeping more weights at earlier layers is important. That is an explainable finding, since for image restoration tasks, the low-level features (color, texture, shape, etc.) presumably matter more and are more transferable, than the high-level features (object categories, etc.). The earlier layers are known to capture more low-level image features, hence contributing more to retraining the image restoration performance with DIP. We summarize and plot the lawyer-wise sparsity ratio result of classification tickets in Figure 7(c) and Figure 7(f). Note that these 6 tickets are directly pruned by LTH on CIFAR10 dataset with the sparsity ratio of 36%, 59%, 89% and 95%. In contrast to the inner architecture of LIP subnetworks, we have observed an interesting trend in LTH that it tends to preserve more weights in the middle layers and prune weights in the ![9_image_0.png](9_image_0.png) Figure 5: Transferability (cross tasks) experimental results. We study the transferability of denoising LIP on the restoration tasks such as inpainting and super-resolution (SR); we also study the inpainting and SR LIP on the denoising task. We consider two SR scale factors = 4, 8. We evaluate Multi-LIP subnetworks here. ![9_image_1.png](9_image_1.png) ![9_image_2.png](9_image_2.png) Figure 6: High- and low-level task transferability experiments. We test the denoising LIP on ImageNet-20 (a subset of ImageNet with images resized to 256*256) and CIFAR10 datasets. Note that we replace the last convolutional layer of DIP models with the linear layer and load the same initial weights. We also evaluate the classification LIP on the denoising task. earlier and later layers (closer to input and output). This phenomenon may partially explain the challenges in transferring LIP subnetworks from restoration tasks to classifications, and vice versa. The failure of transferring LIP subnetworks to image classification could also be partially explained by the aforementioned sparsity distribution discrepancy: LIP subnetwork tends to prune more weights from later layers, which might damage the network's capability in capturing semantic features (usually needing midto-high network layers). However, we observe that the bottleneck layers with presumably higher levels of pruning/sparsity will carry more contextual information and would lead to better downstream classification. Also, we could finetune on top of the intermediate layers of the model when more level information is needed. We assume that if we want the DIP model to transfer better to the image classification task, adding and finetuning linear layers on top of the intermediate layers (i.e., transferring only the winning tickets of the encoder) will help. ![10_image_0.png](10_image_0.png) Figure 7: Layer-wise sparsity ratio results of LIP, SNIP, randomly pruned tickets, and classification tickets directly pruned by LTH. Note that we summarize the sparsity ratio of each layer: the ratio of the number of parameters whose values are equal to zero to the number of total parameters of the layer. And the x-axis of these figures is composed of the serial numbers of model layers. We sampled subnetworks with four different sparsities in LIP (sparsity = 36%, 59%, 89%, 95%), and six different sparsities in classification tickets (sparsity = 36%, 49%, 59%, 83%, 89%, 95%) to observe. Why do the LIP Subnetworks Outperform the Dense Model with fewer Parameters at the Beginning? Our initial conjecture is that pruning at low sparsities does not hurt the model capacity or only at a small level but rather enhances it with stronger robustness against noisy signals, a phenomenon that has been observed in Ulyanov et al. (2018).In fact, it has been widely observed that LTH-pruned subnetworks can outperform dense models in the low sparsity range, such as when 10% to 50% of parameters are pruned. This phenomenon was first observed in Frankle & Carbin (2018) and has been consistently observed in various machine learning tasks, spanning vision Chen et al. (2021b), languages Chen et al. (2020a), and reinforcement learning Yu et al. (2019a). ## 5 Extending Lip To Pre-Trained Neural Network Priors Although the implementation process of the GAN CS task and the DIP restoration task is different, we still find them related and could be unified for two reasons: 1) current research on LTH consists of two main streams, networks with weights with randomly initialized weights Frankle & Carbin (2018) and networks with pre-trained weights Chen et al. (2021b); 2) network structures with random weights or pre-trained weights can be priors, which is the commodity we view as the two could be unified. However, we do not intend to put the GAN CS part in a parallel position to the DIP part. We just want to demonstrate the effectiveness of our pruning method as an "extension" from training-from-scratch deep image prior to using pre-trained neural networks as image priors. Compressive Sensing using Generative Models Compressive Sensing (CS) reconstructs an unknown vector from under-sampled linear measurements of its entries Foucart & Rauhut (2013), by assuming the unknown vector to admit certain structural priors. The most common structural prior is to assume that the vector is k-sparse in some known bases Candes et al. (2006); Donoho (2006), and more sophisticated statistical assumptions were also considered Baraniuk et al. (2010). However, those priors are inevitably oversimplified to depict the high-dimensional manifold of natural images. Bora et al. (2017) presented the first algorithm that used pre-trained generative models such as GANs, as the prior for compressed sensing. As a prior, the pre-trained generator encourages CS to produce vectors close to its output distribution, which approximates its training image distribution. Significant research has since followed to better understand the behaviors and theoretical limits of CS using generative priors, e.g., Hand & Voroninski (2018); Bora et al. (2018); Hand et al. (2018); Kamath et al. (2019); Liu & Scarlett (2020); Jalal et al. (2020). Table 1: Results of GAN LIP. We evaluate the LIPs found in PGGAN on the compressed sensing (CS) and the inpainting (I) restoration tasks. The results are based on celebA-HQ dataset Lee et al. (2020). Note that we use the MSE (Mean Squared Error, per pixel) to evaluate the LIP effectiveness and we also compare the performance of LIP with random pruning results. | Sparsity | 0% | 20% | 36% | 49% | 59% | 67% | 74% | |------------|--------|--------|--------|---------|--------|--------|--------| | Random-CS | 0.0725 | 0.0963 | 0.1165 | 0.1276 | 0.2184 | 0.2086 | 0.3655 | | LIP-CS | 0.0725 | 0.0744 | 0.0732 | 0.0737 | 0.0711 | 0.0728 | 0.0728 | | Random-I | 0.0541 | 0.0682 | 0.0748 | 0.08101 | 0.1142 | 0.1904 | 0.2195 | | LIP-I | 0.0541 | 0.0542 | 0.0504 | 0.0514 | 0.0506 | 0.0524 | 0.0509 | ![11_image_0.png](11_image_0.png) ![11_image_1.png](11_image_1.png) Figure 8: Visual results of compressed sensing and inpainting using LIPs. The images framed in red are the reconstruction results of sparse subnetworks, which are better than those of the full model. Existence of LIP in GANs for Compressive Sensing We use PGGAN Karras et al. (2017) pre-trained on CelebA-HQ dataset Lee et al. (2020) as the model in this section. To obtain LIP tickets in pre-trained GANs, we apply the IMP algorithm. In each IMP iteration, PGGAN is first fine-tuned on 40% of images in CelebA-HQ for 30 epochs, has 20% of its remaining weights pruned, and then reset to the pre-trained weights. We only prune the generator in the IMP process because it is found in Chen et al. (2021d) that pruning discriminator only has a marginal influence on the quality of the winning tickets. We then evaluate the tickets on the compressive sensing task following the setting in Jalal et al. (2020): we fix the number of measurements to 1,000 with 20 corrupted measurements, and minimize the MOM objective (Median-ofMeans, an algorithm proposed by Jalal et al. (2020)) for 1,500 iterations to recover the images. We compare the performance (measured in per-pixel reconstruction error) of LIP with the dense baselines in the first row of Table. 1 and provide a visual example in Fig. 8(a). Tickets with higher sparsities can match the reconstruction performance of the dense model, confirming the existence of the winning tickets. Transfer to other image restoration tasks - inpainting Besides the experiments on the compressed sensing restoration tasks, we also evaluate the effectiveness of GAN LIP on the inpainting task: masking the image and then optimizing the input tensor of the generator in the GAN LIP range to reconstruct the pristine image. More formally, consider the input tensor z ′ ∈ R 1×512, the pristine image x sampled from CelebAHQ, inpainting mask A (binary mask), masked image y = Ax and a generator G, then the optimization loss function is: ||AG(z) − y||2. The results are summarized in Table. 1 and Fig. 8(b), demonstrating the transferability of GAN LIP. ## 6 **Limitations And Future Work** Although the LIP subnetworks outperform the dense DIP model and Deep Decoder on many image restoration tasks, we also find some limitations of LIP. Firstly, the LIP subnetworks cannot directly transfer from low-level (image restorations) to high-level vision tasks (image classifications) and we conjecturally attribute this to the sparsity distribution discrepancy in the inner structure of LIP subnetworks. Secondly, LIP subnetworks fail to achieve comparable performances of the dense DIP model when at extreme sparsities (as high as 99.53%). Thirdly, we observe that the LIP subnetworks do not perform very well on specific restoration tasks such as super resolution because of the inherent difficulty for the deep image prior models to generate high-quality textures. In the future, we will keep exploring more efficient ways to construct more sparse and trainable image prior models with powerful transferability. ## 7 Conclusion This paper identifies the new intermediate solution between the under- and over-parameterized DIP regimes. Specifically, we validate the lottery image prior (LIP), a novel, non-trivial extension of the lottery ticket hypothesis to the new domain. We empirically demonstrate the superiority of LIP in image inverse problems: those LIP subnetworks often compare favorably with over-parameterized DIPs, and significantly outperform deep decoders under comparably compact model sizes. They also possess high transferability across different images as well as restoration task types. ## References Metin Ersin Arican, Ozgur Kara, Gustav Bredell, and Ender Konukoglu. Isnas-dip: Image-specific neural architecture search for deep image prior. In *Proceedings of the IEEE/CVF Conference on Computer Vision* and Pattern Recognition, pp. 1960–1968, 2022. Richard G Baraniuk, Volkan Cevher, Marco F Duarte, and Chinmay Hegde. Model-based compressive sensing. *IEEE Transactions on information theory*, 56(4):1982–2001, 2010. Marco Bevilacqua, Aline Roumy, Christine Guillemot, and Marie Line Alberi-Morel. Low-complexity singleimage super-resolution based on nonnegative neighbor embedding. Proceedings of the British Machine Vision Conference, 2012. Ashish Bora, Ajil Jalal, Eric Price, and Alexandros G Dimakis. Compressed sensing using generative models. In *International Conference on Machine Learning*, pp. 537–546. PMLR, 2017. Ashish Bora, Eric Price, and Alexandros G Dimakis. Ambientgan: Generative models from lossy measurements. In *International Conference on Learning Representations*, 2018. Emmanuel J Candes, Justin K Romberg, and Terence Tao. Stable signal recovery from incomplete and inaccurate measurements. Communications on Pure and Applied Mathematics: A Journal Issued by the Courant Institute of Mathematical Sciences, 59(8):1207–1223, 2006. Yang Cao, Yupin Luo, and Shiyuan Yang. Image denoising with gaussian mixture model. In 2008 Congress on Image and Signal Processing, volume 3, pp. 339–343. IEEE, 2008. Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Zhangyang Wang, and Michael Carbin. The lottery ticket hypothesis for pre-trained bert networks. *arXiv preprint arXiv:2007.12223*, 2020a. Tianlong Chen, Zhenyu Zhang, Sijia Liu, Shiyu Chang, and Zhangyang Wang. Long live the lottery: The existence of winning tickets in lifelong learning. In *International Conference on Learning Representations*, 2020b. Tianlong Chen, Yu Cheng, Zhe Gan, Jingjing Liu, and Zhangyang Wang. Data-efficient gan training beyond (just) augmentations: A lottery ticket perspective. *Advances in Neural Information Processing Systems*, 34:20941–20955, 2021a. Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Michael Carbin, and Zhangyang Wang. The lottery tickets hypothesis for supervised and self-supervised pre-training in computer vision models. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition*, pp. 16306–16316, 2021b. Tianlong Chen, Yongduo Sui, Xuxi Chen, Aston Zhang, and Zhangyang Wang. A unified lottery ticket hypothesis for graph neural networks. In *International Conference on Machine Learning*, pp. 1695–1706. PMLR, 2021c. Tianlong Chen, Zhenyu Zhang, Santosh Balachandra, Haoyu Ma, Zehao Wang, Zhangyang Wang, et al. Sparsity winning twice: Better robust generalization from more efficient training. In International Conference on Learning Representations, 2022. Xuxi Chen, Zhenyu Zhang, Yongduo Sui, and Tianlong Chen. Gans can play lottery tickets too. *arXiv* preprint arXiv:2106.00134, 2021d. Yun-Chun Chen, Chen Gao, Esther Robb, and Jia-Bin Huang. Nas-dip: Learning deep image prior with neural architecture search. In *Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK,* August 23–28, 2020, Proceedings, Part XVIII 16, pp. 442–459. Springer, 2020c. Zezhou Cheng, Matheus Gadelha, Subhransu Maji, and Daniel Sheldon. A bayesian perspective on the deep image prior. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition*, pp. 5443–5451, 2019. Justin Cosentino, Federico Zaiter, Dan Pei, and Jun Zhu. The search for sparse, robust neural networks. arXiv preprint arXiv:1912.02386, 2019. Kostadin Dabov, Alessandro Foi, and Karen Egiazarian. Video denoising by sparse 3d transform-domain collaborative filtering. In *2007 15th European Signal Processing Conference*, pp. 145–149. IEEE, 2007a. Kostadin Dabov, Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian. Image denoising by sparse 3-d transform-domain collaborative filtering. *IEEE Transactions on image processing*, 16(8):2080–2095, 2007b. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In *2009 IEEE conference on computer vision and pattern recognition*, pp. 248–255. Ieee, 2009. Shrey Desai, Hongyuan Zhan, and Ahmed Aly. Evaluating lottery tickets under distributional shifts. *arXiv* preprint arXiv:1910.12708, 2019. David L Donoho. Compressed sensing. *IEEE Transactions on information theory*, 52(4):1289–1306, 2006. Michael Elad and Michal Aharon. Image denoising via sparse and redundant representations over learned dictionaries. *IEEE Transactions on Image processing*, 15(12):3736–3745, 2006. Utku Evci, Fabian Pedregosa, Aidan Gomez, and Erich Elsen. The difficulty of training sparse neural networks. *arXiv preprint arXiv:1906.10732*, 2019. Simon Foucart and Holger Rauhut. An invitation to compressive sensing. In A mathematical introduction to compressive sensing, pp. 1–39. Springer, 2013. Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. *arXiv preprint arXiv:1803.03635*, 2018. Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M Roy, and Michael Carbin. Stabilizing the lottery ticket hypothesis. *arXiv preprint arXiv:1903.01611*, 2019. Jonathan Frankle, Gintare Karolina Dziugaite, Daniel Roy, and Michael Carbin. Linear mode connectivity and the lottery ticket hypothesis. In *International Conference on Machine Learning*, pp. 3259–3269. PMLR, 2020a. Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M Roy, and Michael Carbin. Pruning neural networks at initialization: Why are we missing the mark? *arXiv preprint arXiv:2009.08576*, 2020b. Jonathan Frankle, David J Schwab, and Ari S Morcos. The early phase of neural network training. In International Conference on Learning Representations, 2020c. Jonathan Frankle, David J Schwab, and Ari S Morcos. The early phase of neural network training. arXiv preprint arXiv:2002.10365, 2020d. Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. *arXiv preprint* arXiv:1902.09574, 2019. Zhe Gan, Yen-Chun Chen, Linjie Li, Tianlong Chen, Yu Cheng, Shuohang Wang, and Jingjing Liu. Playing lottery tickets with vision and language. *arXiv preprint arXiv:2104.11832*, 2021. Yosef Gandelsman, Assaf Shocher, and Michal Irani. " double-dip": Unsupervised image decomposition via coupled deep-image-priors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11026–11035, 2019. Kuang Gong, Ciprian Catana, Jinyi Qi, and Quanzheng Li. Pet image reconstruction using deep image prior. IEEE transactions on medical imaging, 38(7):1655–1665, 2018. Shi Guo, Zifei Yan, Kai Zhang, Wangmeng Zuo, and Lei Zhang. Toward convolutional blind denoising of real photographs. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition*, pp. 1712–1722, 2019. Paul Hand and Vladislav Voroninski. Global guarantees for enforcing deep generative priors by empirical risk. In *Conference On Learning Theory*, pp. 970–978. PMLR, 2018. Paul Hand, Oscar Leong, and Vladislav Voroninski. Phase retrieval under a generative prior. arXiv preprint arXiv:1807.04261, 2018. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. Reinhard Heckel and Paul Hand. Deep decoder: Concise image representations from untrained nonconvolutional networks. *arXiv preprint arXiv:1810.03982*, 2018. Reinhard Heckel and Mahdi Soltanolkotabi. Denoising and regularization via exploiting the structural bias of convolutional generators. *arXiv preprint arXiv:1910.14634*, 2019. Ajil Jalal, Liu Liu, Alexandros G Dimakis, and Constantine Caramanis. Robust compressed sensing using generative models. *Advances in Neural Information Processing Systems*, 2020. Yifan Jiang, Bart Wronski, Ben Mildenhall, Jon Barron, Zhangyang Wang, and Tianfan Xue. Fast and high-quality image denoising via malleable convolutions. *arXiv preprint arXiv:2201.00392*, 2022. Kyong Hwan Jin, Harshit Gupta, Jerome Yerly, Matthias Stuber, and Michael Unser. Time-dependent deep image prior for dynamic mri. *arXiv e-prints*, pp. arXiv–1910, 2019. Yeonsik Jo, Se Young Chun, and Jonghyun Choi. Rethinking deep image prior for denoising. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 5087–5096, 2021. Akshay Kamath, Sushrut Karmalkar, and Eric Price. Lower bounds for compressed sensing with generative models. *arXiv preprint arXiv:1912.02938*, 2019. Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. *arXiv preprint arXiv:1710.10196*, 2017. Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. *Technical* report, University of Toronto, 2009. Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photo-realistic single image superresolution using a generative adversarial network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4681–4690, 2017. Cheng-Han Lee, Ziwei Liu, Lingyun Wu, and Ping Luo. Maskgan: Towards diverse and interactive facial image manipulation. In *IEEE Conference on Computer Vision and Pattern Recognition (CVPR)*, 2020. Namhoon Lee, Thalaiyasingam Ajanthan, and Philip HS Torr. Snip: Single-shot network pruning based on connection sensitivity. *arXiv preprint arXiv:1810.02340*, 2018. Jaakko Lehtinen, Jacob Munkberg, Jon Hasselgren, Samuli Laine, Tero Karras, Miika Aittala, and Timo Aila. Noise2noise: Learning image restoration without clean data. *arXiv preprint arXiv:1803.04189*, 2018. Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Kyoung Mu Lee. Enhanced deep residual networks for single image super-resolution. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pp. 136–144, 2017. Jiaming Liu, Yu Sun, Xiaojian Xu, and Ulugbek S Kamilov. Image restoration using total variation regularized deep image prior. In *ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and* Signal Processing (ICASSP), pp. 7715–7719. Ieee, 2019. Zhaoqiang Liu and Jonathan Scarlett. Information-theoretic lower bounds for compressive sensing with generative models. *IEEE Journal on Selected Areas in Information Theory*, 1(1):292–303, 2020. Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. Rethinking the value of network pruning. *arXiv preprint arXiv:1810.05270*, 2018. Haoyu Ma, Tianlong Chen, Ting-Kuei Hu, Chenyu You, Xiaohui Xie, and Zhangyang Wang. Good students play big lottery better. *arXiv preprint arXiv:2101.03255*, 2021. Indra Deep Mastan and Shanmuganathan Raman. Dcil: Deep contextual internal learning for image restoration and image retargeting. In *Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision*, pp. 2366–2375, 2020. Indra Deep Mastan and Shanmuganathan Raman. Deepcfl: Deep contextual features learning from a single image. In *Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision*, pp. 2897–2906, 2021. Gary Mataev, Peyman Milanfar, and Michael Elad. Deepred: Deep image prior powered by red. In *Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops*, pp. 0–0, 2019. Ari S Morcos, Haonan Yu, Michela Paganini, and Yuandong Tian. One ticket to win them all: generalizing lottery ticket initializations across datasets and optimizers. *arXiv preprint arXiv:1906.02773*, 2019. Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2536–2544, 2016. Mansheej Paul, Brett W Larsen, Surya Ganguli, Jonathan Frankle, and Gintare Karolina Dziugaite. Lottery tickets on a data diet: Finding initializations with sparse trainable networks. arXiv preprint arXiv:2206.01278, 2022. William T Redman, Tianlong Chen, Zhangyang Wang, and Akshunna S Dogra. Universality of winning tickets: A renormalization group perspective. In *International Conference on Machine Learning*, pp. 18483–18498. PMLR, 2022. Alex Renda, Jonathan Frankle, and Michael Carbin. Comparing rewinding and fine-tuning in neural network pruning. *arXiv preprint arXiv:2003.02389*, 2020. Itay M Safran, Gilad Yehudai, and Ohad Shamir. The effects of mild over-parameterization on the optimization landscape of shallow relu neural networks. In *Conference on Learning Theory*, pp. 3889–3934. PMLR, 2021. Sylvain Sardy, Paul Tseng, and Andrew Bruce. Robust wavelet denoising. IEEE Transactions on Signal Processing, 49(6):1146–1152, 2001. Pedro Savarese, Hugo Silva, and Michael Maire. Winning the lottery with continuous sparsification. *arXiv* preprint arXiv:1912.04427, 2019. Hidenori Tanaka, Daniel Kunin, Daniel L Yamins, and Surya Ganguli. Pruning neural networks without any data by iteratively conserving synaptic flow. *Advances in Neural Information Processing Systems*, 33: 6377–6389, 2020. Carlo Tomasi and Roberto Manduchi. Bilateral filtering for gray and color images. In *Sixth international* conference on computer vision (IEEE Cat. No. 98CH36271), pp. 839–846. IEEE, 1998. Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In *Proceedings of the IEEE* conference on computer vision and pattern recognition, pp. 9446–9454, 2018. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. *Advances in neural information processing systems*, 30, 2017. Chaoqi Wang, Guodong Zhang, and Roger Grosse. Picking winning tickets before training by preserving gradient flow. *arXiv preprint arXiv:2002.07376*, 2020. Max Welling and Yee W Teh. Bayesian learning via stochastic gradient langevin dynamics. In *Proceedings* of the 28th international conference on machine learning (ICML-11), pp. 681–688, 2011. Fangshu Yang, Thanh-An Pham, Nathalie Brandenberg, Matthias P Lütolf, Jianwei Ma, and Michael Unser. Robust phase unwrapping via deep image prior for quantitative phase imaging. IEEE Transactions on Image Processing, 30:7025–7037, 2021. Haoran You, Chaojian Li, Pengfei Xu, Yonggan Fu, Yue Wang, Xiaohan Chen, Richard G Baraniuk, Zhangyang Wang, and Yingyan Lin. Drawing early-bird tickets: Towards more efficient training of deep networks. *arXiv preprint arXiv:1909.11957*, 2019. Haonan Yu, Sergey Edunov, Yuandong Tian, and Ari S Morcos. Playing the lottery with rewards and multiple languages: lottery tickets in rl and nlp. *arXiv preprint arXiv:1906.02768*, 2019a. Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Generative image inpainting with contextual attention. In *Proceedings of the IEEE conference on computer vision and pattern* recognition, pp. 5505–5514, 2018. Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Free-form image inpainting with gated convolution. In *Proceedings of the IEEE/CVF International Conference on Computer Vision*, pp. 4471–4480, 2019b. Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparse-representations. In International conference on curves and surfaces, pp. 711–730. Springer, 2010. Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. *IEEE transactions on image processing*, 26(7):3142–3155, 2017. Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image super-resolution. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 2472–2481, 2018. Denny Zhou, Mao Ye, Chen Chen, Tianjian Meng, Mingxing Tan, Xiaodan Song, Quoc Le, Qiang Liu, and Dale Schuurmans. Go wide, then narrow: Efficient training of deep thin networks. In *International* Conference on Machine Learning, pp. 11546–11555. PMLR, 2020. ## A More Discussions Of The Experiments Images Used in Experiments In Fig. 17, we organize and present the images used in this paper with their names. Note that these images are sampled from Set5 Bevilacqua et al. (2012) and Set14 Zeyde et al. (2010) datasets, and we use their default names. Note that these names are used in Section 4 (in curves and analyses). Also, in Table 5, we conduct the evaluation experiments on BM3D Dabov et al. (2007a), CBM3D Dabov et al. (2007a) and Set12 Zhang et al. (2017) datasets for fair comparisons with NAS-DIP and ISNAS-DIP models. Parameter Redundancy Problem The commonly used hourglass model in DIP Ulyanov et al. (2018) is highly complex in its parameters. The statistic results of parameter numbers is summarized in Table 3. We compare the parameter numbers of dense DIP models with the identified winning tickets using LIP and discover that the winning tickets could perform better than the full model while containing 2 million parameters fewer. This phenomenon motivates us to suspect that there is a high possibility of finding the matching subnetworks of the pristine dense DIP model, which indicates that the subnetworks may also contain the outstanding image prior property as the dense one does. As to the under-parameterized image prior networks (e.g., deep decoder), we also count the number of nonzero parameters in Table 2 for a fair comparison in restoration tasks with LIP networks. As shown in the table, for denoising and super-resolution tasks, the number of parameters of the deep decoder is 0.1 million. For inpainting tasks, the parameter number is 0.6 million. Therefore, for denoise and super-resolution tasks, we choose the sparsity 97.19% of LIP for comparisons; for inpainting tasks, we choose the sparsity 73.70% for comparisons. Table 2: Compare the number of non-zero parameters in Deep Decoder (DD)Heckel & Hand (2018) and our LIP tickets. Note that we compare these models on three restoration tasks: Denoising (DN), Superresolution (SR) and Inpainting (IP). And 'LIP - 97.15%' means the sparsity of the LIP subnet is 97.15%. | Model | DD - 128 | DD - 320 | LIP - 97.15% | LIP - 97.19% | LIP - 73.79% | LIP - 79.03% | |-------------------|------------|------------|----------------|----------------|----------------|----------------| | Structure | (DN, SR) | (IP) | (DN, SR) | (DN, SR) | (IP) | (IP) | | Non-zero | 100224 | 619200 | 102746 | 90923 | 608298 | 494251 | | Parameter Numbers | (0.1M) | (0.6M) | (0.1M) | (0.09M) | (0.6M) | (0.5M) | | | Dense Model | LIP Matching Subnetwork | |------------------------------|---------------|---------------------------| | Parameter Numbers (non-zero) | 2.2 Millon | 0.2 Millon | | Performance (PSNR) | 30.35 | 30.61 | Table 3: Evaluation of the dense and LIP models on denoising task with the image bird. The LIP tickets achieve comparable results as the dense model when in extreme sparsity (parameter number: 2.2 million vs 0.2 million). Definition of Subnetworks and Finding Them Consider a network f(x; θ) parametered by θ with input x, then a subnetwork is defined as f(x; m ⊙ θ), where *⊙ ∈ {*0, 1} d, d = ||θ||0 and ⊙ is the element-wise product. Let AT t (f(x; θ)) to be the training algorithm, that is, training model f(x; θ) on the specific task T with t iterations. We also denote the random initialization weight as θ0 and the pre-trained weight as θp; θi as weight at the i-th training iteration and E T(f(x; θ)) the model performance evaluation. Following the definitions of Frankle et al. (2020a), we define that if the subnetworks is *matching*, it satisfies the following conditions (we use θp for example, to denote a pre-trained lottery ticket Chen et al. (2020a; 2021b); θ0 can be defined likewise): $${\mathcal{E}}^{\mathcal{T}}({\mathcal{A}}_{t}^{\mathcal{T}}(f(x;\theta_{p}))\leq{\mathcal{E}}^{\mathcal{T}}({\mathcal{A}}_{t}^{\mathcal{T}}(f(x;m\odot\theta)).$$ (f(x; m ⊙ θ)). (1) ![19_image_0.png](19_image_0.png) Figure 9: Experiments of the rewind strategy (background task: denoising). Note that we train the model with N epochs in IMP and Rewind_j means rewinding the ticket parameter to θj , the weights after j% × N steps of training. ![19_image_1.png](19_image_1.png) Figure 10: Learning curves using four different training targets: a clean image (Baby.png), the same image added with noises, the same randomly scrambled and white noise. Note that we use four different models: the LIP subnetwork (S = 89%), randomly pruned subnetwork (S = 89%), SNIP subnetwork (S = 89%) and the dense model (S = 0%). And we trained them in isolation in the same experimental settings for 10000 iterations. That is a matching subnetwork that performs *no worse* than the dense model under the same training algorithm AT and the evaluation metric E T. Similarly, we define the *winning tickets*: if a *matching* subnetwork f(x; m ⊙ θ) has θ = θp, then it is the *winning tickets* under the training algorithm AT. ## B Ablation Study Of Lip Subnetworks The Effect of Weight Rewinding In this part, we study the effect of weight rewinding Frankle et al. (2019) when applied to the single-image IMP for DIP models. Weight rewinding is proposed to scale LTH up to large models and datasets. Specifically, we say we use p% weight rewinding if we reset the model weights at the end of each IMP iteration to the weights in the dense model after a p% ratio of training steps within a standard full training process, instead of the model's random initialization. For the single-image IMP in DIP, we consider 5%, 10% and 20% weight rewinding schemes. The resulting models are denoted as Rewind_5, *Rewind_10* and *Rewind_20*, respectively. The results of different weight rewinding schemes are summarized in Fig. 9. We can see that weight rewinding is not beneficial for identifying LIP in the DIP setting. Too much rewinding (10% and 20%) even hurts performance or fails it completely. We conjecture that this is due to the extremely low data complexity in DIP (single image). Learning Curves of Subnetworks with Different Training Targets To better explain the success of the LIP subnetworks, inspired by Figure 2 of Ulyanov et al. (2018), we further train the obtained subnetworks (LIP, SNIP and random pruning) with four different targets: 1) a natural image, 2) the same added with noise, 3) the same after randomly permuting the pixels and 4) the white noise. We also train the dense model as the baseline results. The experimental details are summarized in the caption of Fig. 10. We first observe that for LIP, SNIP, and dense models, the optimization converges much faster in case 1) and 2) ![20_image_0.png](20_image_0.png) Figure 11: The learning curve plots when using different subnetworks towards the DIP task. In the figure, S denotes the sparsity of the model. We compare both PSNR and SSIM values. For fair comparisons, we trained these subnetworks on the denoising task on the Baby image with 3000 iterations, then trained in isolation (the iteration number is recommended by Chen et al. (2020c) to capture the "early-stopping" phenomenon of DIP), and summarized their performances. than in case 3) and 4). But the randomly pruned subnetworks have failed in all cases. Interestingly, we also find that SNIP subnetworks perform similarly to the dense model. Meanwhile, the parameterization of LIP subnetworks offers a higher impedance to noise and a lower impedance to signal than the dense model, which indicates that the separation of high frequency and low frequency is more obvious for winning network architectures. Does the Pruning Hurt the High-frequency Information of the Model? Also, in order to observe whether the high-frequency information will be lost during the pruning, we apply Fourier Transformation to the Baby figure (described in Fig. 17) and visualize the frequency intensity of the ground-truth image and the reconstructions from three different subnetworks (LIP, SNIP and random pruning). The results are summarized in Fig. 18 and Fig.19. We found that compared with random pruning, LIP and SNIP can maintain most of the high frequency information in the ground-truth (e.g., in Fig 18, SNIP and LIP can both maintain the high-frequency information at the sparsity of 79%; however, SNIP could lose more high-frequency information than LIP at lower sparsity ratios.). Learning Curve Comparison of Using Various Subnetworks for the Restoration Task We further compare the training convergence curves of different subnetworks on the restoration task. In Fig. 11, we summarize the convergence of LIP, SNIP and randomly pruned subnetworks on the denoising task, and the experimental details are included in the caption. We use the PSNR and SSIM metrics to measure the quality of the generated images: SSIM is often considered better "perceptually aligned", by attending more to the contrast in high-frequency regions than PSNR. At the early stage of optimization, we observe that the learning curves of LIP and SNIP subnetworks are almost overlapped (either PSNR or SSIM curves), while the randomly pruned subnetworks failed to perform comparably with them. Yet when the iterations increase, the SNIP subnetworks start to lag behind the LIP subnetworks (e.g., the largest PSNR gap between the two can reach 3dB and the largest SSIM gap can be 0.7). Only the LIP subnetworks can match the comparable performances of the full model when reaching the 3000-th iteration. Lastly, the SSIM gap is noticeably enlarged at higher sparsity levels (95%) when comparing LIP and SNIP, which implies LIP is better at capturing perceptually aligned details. Visualization Results of the LIP Subnetworks In Fig. 2, we present the restoration results of these subnetworks on tasks such as: denoising, inpainting and super-resolution (factor= 4, 8). We successfully find the LIP subnetworks with high sparsities (e.g., 91.4% for inpainting, 89% for super-resolution and 74% for denoising), they achieve the comparable or better performance than the dense model. Moreover, we show the LIP subnetworks in the extreme sparsity (e.g., sparsity s = 99.53%). We find that the performances of the LIP subnetworks are not largely degraded (e.g., the PSNR value decreases by 1.37 for super-resolution with factor 8.), which demonstrates the LIP subnetworks retain the image prior property of the dense models. In Fig. 12, we visualize the DIP learning process on the denoising task with the LIP subnetworks. And we also ![21_image_0.png](21_image_0.png) Figure 12: Visualize the learning process of the LIP subnetworks. We compare the results of the dense model and LIP tickets to study their learning ability toward one image. We use the default optimization iteration numbers (F16.png: 3000 iterations; Snail.png: 2400 iterations) in Ulyanov et al. (2018). ![21_image_1.png](21_image_1.png) Figure 13: Study of early-stopping in IMP loops. For comparisons, we study the IMP loss values and the model performances during single-image IMP loops. We experiment with face3 and face5 images on three restoration tasks (denoising, inpainting and super-resolution). For comparisons, we plot the IMP loss and model performances during IMP loops. Note that we use the yellow star to denote the matching subnetworks and the green star for the dense model. compare the learning ability of the dense model and LIP tickets. Interestingly, we find these subnetworks learn the general outline of the image at the early stage of the optimization process (e.g., the outline of the snail's shell at the first 500 iterations), and then they learn the detailed features of the image objects at the late stages (e.g., the eye features of the snail at the last 400 iterations). The outstanding learning ability also demonstrates their excellent image prior property. Comparisons with NAS-DIP Chen et al. (2020c) and ISNAS-DIP Arican et al. (2022) models. Chen et al. (2022) first builds the searching space for upsampling and residual connections to capture better image priors for the dense DIP model. Arican et al. (2022) first finds that there is a small overlap of the best DIP architectures for different images and restoration tasks (e.g., denoising, inpainting and super-resolution). Therefore, they propose to do the NAS algorithm on DIP frameworks on specific images for computational savings. These methods aim to optimize the architecture of over-parameterized models to achieve better performances, and therefore, the model size of these two networks is still comparable to that of the dense DIP model (they neither compact the model nor prune its layers). In Table 5, we compare the performances of LIP subnetworks (the parameter number is 0.6 million) with DIP, NAS-DIP and ISNAS-DIP models. We find that LIPs can achieve comparable or even better performances than NAS-DIP models (especially on denoising and inpainting tasks). The ISNAS-DIP model gains state-of-the-art performances on restoration tasks such as denoising and inpainting. But when it comes to the super-resolution, LIP subnetworks and the NAS-DIP model outperform the ISNAS-DIP network. More discussions about LIP, NAS-DIP, and ISNAS-DIP. From an algorithmic perspective, we would like to humbly emphasize that this work is the first attempt to investigate LTH in the DIP scenario, which could help to understand how the topology and connectivity of CNN architectures encode natural image priors, and whether "overparameterization + sparsity" make the best DIP recipe. This is a different angle from that of the NAS-based methods, which is about looking for the best "architecture (with dense weights)" for DIP. In terms of implementation, it is worth mentioning that the published implementations of both NAS-DIP and ISNAS-DIP do not offer an out-of-the-box mechanism for regularizing the network size inherently during the searching process. In consideration of the limited duration of the response period, we refrained from extending the implementations of NAS-DIP and ISNAS-DIP independently. Our concern is that the ensuing search outcomes might diverge significantly from the concepts initially proposed in the original NAS-based works. Methodologically, our pruning-based LIP is proposed to be orthogonal to NAS-DIP and ISNAS-DIP. More explicitly, the iterative pruning procedure can be equivalently applied to any network architecture discovered by the NAS-based methods, thus yielding a more compact network representation. We assume the feasibility of this combination to be grounded in the observed existence of the Lottery Ticket Hypothesis (LTH) across a range of network architectures including (a) compact Multilayer Perceptrons (MLP) and smaller convolutional networks Frankle & Carbin (2018); (b) over-parameterized networks with residual connections, such as ResNet and VGG networks Frankle et al. (2019); and (c) U-Net-like hourglass convolutional networks, as evidenced in this study, based on which both NAS-based methods search architectures. Discussions about the "early-stopping" in the single-image based IMP loops. Similar to the DIP optimization, the single-image based IMP also needs "early-stopping" during the iterative pruning loops, or the final subnetwork will overfit the noises. In Figure 13, we summarize and plot the IMP loss and model performances during the iterative magnitude pruning. Specifically, we experiment with face3 and face5 images on three restoration tasks (e.g., denoising, inpainting and super-resolution.). We find that the matching subnetwork (yellow stars in the figure) appears where the value of IMP loss continuously increases two or three times. Based on this observation, we summarize the approach as follows: *To robustly find* the matching subnetworks when on the single noisy image IMP loops, one can stop the iterative magnitude pruning when observing the continuous increases in IMP loss values. However, there may be other ways (based on other signals) to identify the matching subnetworks in the single-image based IMP loops. For example, one can observe the gradient flow or the magnitude of gradients in the IMP loops to find the inner links between these signals and the appearance of matching subnetworks, which will be our future works. So far, the IMP loss value has been the most obvious signal in training loops. Transferability study of the single-image based LIP subnetworks We evaluate several single-image based LIP subnetworks (Baby-LIP, Bird-LIP, Woman-LIP and Butterfly-LIP) on the Baby.png and compare their performances with MUlti-LIP subnetworks. The experimental results are summarized in Fig.14. We found that when the sparsity level is low (0%-40%), the single-LIP subnetworks perform a little worse than ![23_image_0.png](23_image_0.png) Figure 14: Evaluate different LIPs on the baby.png. Note that the background task is denoising. ![23_image_1.png](23_image_1.png) Figure 15: Evaluate the random structure of the DIP models. We compare the performance of randomly pruned subnetworks with the ones randomly pruned with LIP sparsities. The background task is denoising. the LIPs obtained on Baby.png. When the sparsity level increases (e.g., the number of remaining parameters is less than 0.6 million), they usually tend to perform comparably. Another intriguing phenomenon is that Multi-LIP performs comparably with the LIPs obtained on Baby.png but can perform better than the other LIPs when sparsity level is high, which also demonstrate that Multi-LIP could have better transferability than single-image based LIP subnetworks. Ablation Study on Random Structures of original DIP models We have compared the randomly pruned subnetworks with LIP ones and have found these randomly pruned sparse networks perform worse, especially at high sparsity levels. This phenomenon indicates that the uniform randomness will lead to inferior performances. But what if we provide the LIP sparsity to the random structure? In Fig. 15, we summarize the experimental results on Baby.png, Bird.png, Woman.png and F16.png. We observed that the randomly pruned subnetworks with LIP sparsity will collapse at a much earlier stage than those that are uniformly randomly pruned. They may have comparable performances when at low sparsity levels (e.g. from 0% to 40%.). But the performance curve will quickly fall at high sparsity levels (e.g., from 50% to 90%.), which demonstrates that the inner structure of LIP subnetworks is unique. Comparison with Other State-of-the-art Pruning Methods In the paper, we compare the effectiveness of LIPs with SNIP and random pruning. To better explore the effectiveness of LIP subnetworks, we further compare the sparse models with the "SynFlow" pruning methods Tanaka et al. (2020). The experimental results are summarized in Table.4. We observed that SynFlow subnetworks achieve comparable performances with the dense network and LIPs when at low sparsity levels (e.g., from 0% to 20%.). But LIP subnetworks start to win them out when the sparsity level increases (e.g., from 60% to 90%.). Also, the LIPs can achieve comparable performances when at extreme sparsities (e.g., when sparsity level equals to 80%.). But the "SynFlow" subnetworks have already failed. These phenomena indicate the effectiveness of proposed LIP methods, which also act as side support to Frankle et al. (2020b). ![24_image_0.png](24_image_0.png) Figure 16: Experiment our method on the SGLD-DIP model Cheng et al. (2019). Note that we run this experiment with 3 different random seeds and the evaluation images are sampled from Set5 and Set14 datasets. Also, we mark the performance of the original dense DIP model in these figures (shown as the green star). The code of the SGLD-DIP model is available at https://github.com/ZezhouCheng/GP-DIP. How is the Performance of LIP Subnetworks on Other DIP-based Architectures? To demonstrate the effectiveness and versatility of the LIP method, we have implemented the proposed pruning algorithm on the SGLD-DIP model Cheng et al. (2019), which is a state-of-the-art architecture based on the deep image prior. The SGLD-DIP model utilizes the stochastic gradient Langevin dynamics Welling & Teh (2011), enabling the model to mitigate the overfitting of noise and generate improved restoration outcomes. By applying the single-image IMP to this model, we conducted experiments with three different random seeds, using the images "Baboon.png", "Pepper.png", and "Zebra.png", all sourced from the Set5 and Set14 datasets. The experimental results, depicted in Figure 16, provide a summary of our findings. Particularly, we compare the performance of LIP SGLD models with the original dense models. Our observations reveal that the LIP SGLD models consistently outperform the dense networks across sparsity levels ranging from 20% to 79%, thereby illustrating the generality of our proposed methods. Table 4: Comparison with synaptic-flow pruning method Tanaka et al. (2020). We compare the performances of LIPs and "SynFlow" subnetworks at various sparsity levels. Notice that the background task is denoising and the experiment image is F16.png. | Sparsity (%): | 0 (dense) | 20 | 40 | 50 | 60 | 70 | 80 | 90 | |-----------------|-------------|-------|-------|-------|-------|-------|-------|-------| | SynFlow | 31.06 | 31.05 | 30.62 | 30.54 | 30.59 | 30.41 | 30.11 | 28.98 | | LIP | 31.06 | 31.15 | 31.11 | 31.12 | 31.13 | 31.11 | 31.03 | 30.91 | Table 5: Comparison results between LIP (sparsity = 73.79%, parameter number = 0.6M), DIP Ulyanov et al. (2018), NAS-DIP Chen et al. (2020c) and ISNAS-DIP Arican et al. (2022) models. The evaluation datasets are BM3D Dabov et al. (2007a), Set12 Zhang et al. (2017), CBM3D Dabov et al. (2007a), Set5 Bevilacqua et al. (2012) and Set14 Zeyde et al. (2010). And the results of DIP, NAS-DIP and ISNAS-DIP models are directly picked from Table 2 in Arican et al. (2022). Since NAS-DIP and ISNAS-DIP both aim to find better architectures to gain better model performances via NAS, their model sizes are comparable to that of the dense DIP network (there are no model compressions during the optimization). And we use "*" to denote this in the table. | Datasets | DIP (2.2M) | LIP (0.6M) | NAS-DIP (*) | ISNAS-DIP (*) | |------------|------------------|--------------|---------------|-----------------| | | Denoising | | | | | BM3D | 27.87 | 28.27 | 27.44 | 28.39 | | Set12 | 27.92 | 28.12 | 26.88 | 28.06 | | CBM3D | 28.93 | 29.45 | 29.13 | 30.36 | | | Inpainting | | | | | BM3D | 31.04 | 32.44 | 30.55 | 32.90 | | Set12 | 31.00 | 31.78 | 30.86 | 32.22 | | | Super-resolution | | | | | Set5 ×4 | 29.89 | 30.52 | 30.66 | 30.22 | | Set5 ×8 | 25.88 | 26.17 | 25.88 | 25.94 | | Set14 ×4 | 27.00 | 27.31 | 27.36 | 27.19 | | Set14 ×8 | 24.15 | 24.31 | 23.96 | 24.03 | ![25_image_0.png](25_image_0.png) Figure 17: Images used in plotting the curves of experiments. ![26_image_0.png](26_image_0.png) Figure 18: Evaluating the reconstruction images of different subnetworks (LIP, SNIP and random pruning) by FFT (Fast Fourier Transformation) to check whether the high-frequency information has been lost during pruning. Note that we experimented on the Baby.png. We found that compared with random pruning, LIP and SNIP can both maintain the high frequency information of the ground-truth. For example, the LIP and SNIP subnetworks both maintain most of the high-frequency information of the ground-truth at the sparsity 79%, but the LIP could also perform well at the sparsity 67% where the SNIP loses more high-frequency information. ![27_image_0.png](27_image_0.png) Figure 19: we visualize the difference maps between the FFT (Fast Fourier Transformation) results of reconstruction images generated by different methods (e.g., LIP, SNIP and random pruning). For example, 'LIP - random' means the difference map between the FFT results of restored images generated by LIP and randomly pruned subnetworks. The brighter color means a larger difference in values. Also, the center of the visualization images represents the image areas with frequency equal to zero and the surrounding parts denote areas with high frequency. We can observe that the reconstructions generated by LIP are consistent with those from other methods in the low-frequency domain (the center area of the FFT map) and mainly differ from other methods in the high-frequency domain.
Review 1: Summary: The paper proposes to prune the over-parameterized image priors to find a better performing and efficient image prior based on the Lottery Ticket Hypothesis. The pruned image prior results in better quality solutions to various inverse problems addressed by the DIP, with the relatively small number of parameters compared to the full model, of course outperforming efficient counterpart proposed in DeepDecoder. The paper presents various detailed studies including transferability across tasks, sensitivity study by the layer-wise sparsity ratio and application to pre-trained neural network prior using GAN. Strengths and Weaknesses: **Strengths** - **S1**: First showing the LTH is applicable in DIP domain. The subnetwork performs better than the Deep decoder and even the original full size network when pruned. - **S2**: Various detailed studies on transferability across tasks, sensitivity study by the layer-wise sparsity ratio and application to pre-trained neural network prior using GAN. **Weaknesses** - **W1**: The proposed idea is basically finding a better suited network architecture embedded in a large DIP network. The lottery ticket happens to be small in size but not guaranteed. The idea of finding better performing network architecture for DIP has been explored in NAS-DIP and ISNAS-DIP. Although these two methods did not try to reduce the size of the resulting networks, it is interesting to observe the performance when they try to reduce the size of the network. - **W2**: Finding optimal size is an open question. - **W3**: Lack of comparison to the state of the art DIP models. There are number of DIP models (Liu et al. 2019, Jo et al. 2021, Mastan & Raman 2020, 2021, Gandelsman et al. 2019, Yang et al. 2021) but there is no comparison to those models or at least try to use the best DIP model to prune the network. It is not clear why DIP method the method is mostly applied for the evaluation. Requested Changes: - Clarify the based DIP method used for applying the LTH and show the effectiveness of the method in the state of the art DIP method or architecture. - If possible, compare the effectiveness of the LTH in various DIP methods - Reduce the network size by the competing methods such as NAS-DIP or ISNAS-DIP and compare the quality by them and the vanilla IMP that the LIP is using Broader Impact Concerns: N/A ================================================== Review 2: Summary: In this article, the authors introduce a new "lottery image prior" (LIP), which leverages the innate sparsity of deep neural networks (DNNs) to pinpoint an intermediate, parameterized image prior that achieves superior performance, efficiency, and transferability. Specifically, the authors expand upon the lottery ticket hypothesis (LTH) to address low-level vision tasks such as image restoration and compressive sensing image reconstruction. Through a series of experiments, they not only demonstrate the presence of LIP in low-level vision tasks but also provide some interesting conclusions on the transferability of the proposed LIP. Strengths and Weaknesses: Pros: + First study on extending lottery ticket hypothesis (LTH) to address low-level vision tasks + Extensive empirical results are provided for several low-level image restoration tasks + Empirical results substantiate the existence of the proposed lottery image prior (LIP) Cons: - It is very interesting to observe that LIP subnetworks can surpass DIP models in various image restoration tasks. However, the underlying reasons remain unclear. The authors briefly mention that sparsity can enhance DNN robustness to noise and degradations, but the article lacks rigorous validation to support this claim. - The relevance of GAN-based compressed sensing to Deep Image Prior (DIP) might appear unclear, raising the question of why Section 5 is necessary. While DIP and GAN-based compressed sensing follow distinct learning paradigms, employing the LIP for these two tasks may stem from different motivations. Thus, it is essential to explore and discuss these aspects in Section 5. - This is a purely empirical study that extends LTH to address low-level vision tasks. From a technical standpoint, the contribution is marginal. Requested Changes: I recommend that the authors enhance the article by addressing the concerns raised in the identified weaknesses: + Provide more rigorous validation to demonstrate the reasons behind LIP subnetworks outperforming DIP full models in image restoration tasks. + The connection between GAN-based compressed sensing and Deep Image Prior (DIP) may seem ambiguous, leading to questions about the necessity of Section 5. Please clarify the significance of the GAN CS portion and justify the inclusion of Section 5 in the article. + Are there any failure cases or limitations associated with LIP? I would suggest the authors add a limitation analysis section in the revised article. My current rating for the article is borderline. However, if the authors can address my concerns, I would be pleased to revise my rating upwards. ***Updated Rating*** I have read the authors' responses and comments from fellow reviewers. My major concerns can be successfully addressed. I am happy to recommend accepting this article. Broader Impact Concerns: N/A ================================================== Review 3: Summary: The paper proposed lottery image prior (LIP) that sits between over-parameterized deep image priors (DIP) and under-parameterized deep decoder. Analogous to the lottery ticket hypothesis (LTH), LIP aims to find a sparse sub-network from DIP that significantly out-performs under-parameterized image priors such as deep decoders while being compact in terms of model sizes. The key contribution of this paper is to verify the existence of LIP, which could be seen as a more compact DIP model (but not the same as deep decoders), not only out-performs deep encoders, but also free from severe over-fitting like DIP. By finding such LIP, better training efficiency could also be achieved. Strengths and Weaknesses: Strengths: 1. I think this paper is novel and high-quality. 2. The idea is interesting, and the writing is clear. 3. Experiment setup is nice - plotted on 10-time average with different random seeds and includes the corresponding variance. 4. The results are impressive (Fig.3 - 6). 5. Discussions on how LIP is different from SNIP (Fig. 7) is nice. Weaknesses: 1. While I understand that the proposed LIP is closely connected to the over/under-parameterized image priors and LTH, and I appreciate the efforts that authors spent in listing a dense amount of references in the background work section, I don't find enough discussions on how those work connect to the proposed work. Especially in Section 2.3, where the authors simply list papers in LTH without any discussions on why those work belong to this paper. 2. Discussions on some of the experiment results are lacking (see requested changes section). Requested Changes: 1. I think the background work section should be re-written, instead of listing a long list of papers that broadly belong to where this paper connects, the focus should focus more on how those work connect, influence or motivates the idea of LIP. 2. While I am impressed by the LIP performance showed in Figure 3, 4 and 5, as listed in the Strengths section, I notice that LIP out-performs DIP with less parameter counts at the beginning, and I hope to see more discussions from the authors on why this is the case, especially when we don't see the same performance in image classification tasks, as shown in Fig. 6. Broader Impact Concerns: I don't find concerns on the ethical implications of the work that would require adding a Broader Impact Statement. ================================================== Metareview: Recommendation: Accept with minor revision Comment: Please refer to the comments above. ==================================================
# On The Analysis And Reproduction Of "Post-Hoc Concept Bottleneck Models" With An Extension To The Audio Domain Anonymous authors Paper under double-blind review ## Abstract Although deep neural networks are powerful tools, they are yet considered "black boxes". With the proliferation of AI models, the need for their interpretability has increased. One way to improve the interpretability of deep neural networks is to understand their decisions in terms of human-understandable concepts. *Concept Bottleneck Models* (CBMs) aim to achieve this goal by using embedding representations of concepts into the model, providing explainability into the decisions that a network makes. However, CBMs have various limitations concerning training efficiency and task applicability. The authors of the paper Post-hoc Concept Bottleneck Models (PCBMs) provide a novel approach to creating CBMs in a more efficient and generalizable way. In this paper, we evaluate their claims, namely, that PCBMs can be trained using any pre-trained neural network and that PCBMs offer interpretability without sacrificing significant performance. To do so, we not only attempted to **reproduce** the original paper results but also **extended** the approach into the audio domain. Our results show good alignment with the original paper but further analysis revealed some problems PCBMs may have, namely, challenges in getting a suitable list of relevant human-understandable concepts for a given task, and potential misalignment between concept encoders and input feature encoders. The code for our paper can be found at https://anonymous.4open.science/r/-354E/ ## 1 Introduction Deep neural networks have become widely applied to real-life problems, making decisions in areas that have high stakes such as health, finance, and policing (Adadi & Berrada, 2018). This calls for improving the interpretability of the models in use, to confirm the decisions made by the models are indeed reliable and transparent. To make deep learning more interpretable, analysis methods based on human-understandable concepts were introduced, helping us see how such concepts are generated and used in neural networks - this includes *Concept Bottleneck Models* (CBMs) (Koh et al., 2020). CBMs are a neural network-based method, trained end-to-end to learn to predict a set of human-understandable concepts in the input and then linearly combine the vector representations of concepts to predict the labels in a classification task. By doing so, we can explain the decision made by the model by looking at the concepts which have the highest importance, and likewise understand the mistakes it makes. The paper under investigation here introduced Post-hoc Concept Bottleneck Models (PCBMs) (Yuksekgonul et al., 2022), where instead of training a model to recognize concepts and perform classification tasks in one go, PCBMs build simple concept-based models using a pre-trained neural network for classification. This was intended to help overcome the following limitations of CBMs: 1. **Need for labeled data**: CBMs require access to data-concept pairs, which may require manual labeling. Using PCBMs, one can use multi-modal models to map data to concepts directly. 2. **Performance**: The accuracy CBMs generally achieve is lower than that of models trained without being constrained by concepts. With PCBMs, one can combine information from the pre-trained original model with the concept-based model via a separately trained residual connection, thereby improving the prediction accuracy. 3. **Model editing**: Since CBMs are trained end-to-end, it is unspecified how global editing may be achieved in CBMs. In PCBMs however, manual and automated pruning of concepts was introduced and was shown to improve model performance by Yuksekgonul et al. (2022). In this paper, we test the following claims from the original paper by Yuksekgonul et al. (2022): - *Claim 1* : PCBMs can be applied to a wide range of neural networks 1, - *Claim 2* : PCBMs achieve high prediction accuracy comparable to the models they are based on, - *Claim 3* : PCBMs offer interpretability benefits. To test these claims, we first **reproduce** the results of the experiments done in the original paper in the domain of image classification. We examine whether we can indeed turn the 'backbone' pre-trained models introduced in the paper into PCBMs, whether they achieve comparable performance to original models, and whether the most important concepts used by PCBMs are in line with human domain knowledge or common sense. Since these previous experiments were performed exclusively in the image classification domain, we conduct experiments to test whether these claims are **generalizable** in another domain, namely audio classification. ## 2 Methods This section outlines our approach in replicating the original study as well as our extension to the audio domain. The tasks we focus on here are image classification (reproduction of the original results) and audio classification (testing the generalization of the stated claims). ## 2.1 Backbone Models We start by choosing the pre-trained models ('backbone models') we would like to interpret using the PCBM method. For image classification, we use the ones specified in the original paper, which were CLIP-ResNet50 (Radford et al., 2021), ResNet18 (He et al., 2016), and the Inception model (Szegedy et al., 2014). These CNN-based models were chosen to test PCBMs in different challenging image classification tasks. For audio classification, we used one CNN-based architecture, ResNet34 (He et al., 2016), and a transformer architecture, HTS-AT (Chen et al., 2022). In both domains, each backbone was tested with one or more datasets, detailed in Section 2.4. For both models, we first pre-process the audio into log-Mel spectrograms such that it can be fed into ResNet34's image encoder as well as HTS-AT's transformer-based audio encoder. ## 2.2 Concept Libraries To build the PCBMs, we first need to create a 'concept library' for a given dataset - this is just a set of concepts that might be relevant to interpreting the decisions of the model. For the image classification tasks, we use the knowledge graph ConceptNet (Speer et al., 2017) to obtain concepts related to the targets. For audio classification, we constructed concept libraries on our own by asking GPT-4 via ChatGPT (OpenAI, 2023) to generate five concepts for each class. Our prompt starts with "Is there an audio conceptNet?". Then we repeated the following request for 50 times (one for each class) " Pulling concepts for *class*". Finally, we added, "can you give me 50 concepts in a structured way to me". We decided on this due to the fact that concepts output by ConceptNet generally describe visual cues, which may not match well with audio input. 1This is the modified version of the original claim: '*One can turn any neural network into PCBMs*', which is quite a strong claim from the authors of the original paper. Here we are not trying to prove the claim but evaluate whether we can turn different kinds of neural networks into PCBMs, e.g. those from audio domains ## 2.2.1 Concept Activation Vectors Concept Activation Vectors (CAVs) (Kim et al., 2018) are vectors that somewhat represent a particular concept, chosen from the concept library. A set of inputs are chosen that are labeled to contain this concept, and likewise, a set is chosen that does not contain said concept. We can then learn a linear decision boundary between regions in the embedding space of an encoding network that have and do not have the concept, using the data points in the positive and negative sets as inputs. The CAV is acquired by finding the vector normal to the linear classification boundary trained, which, in all cases mentioned below, is learned with a linear Support Vector Machine (SVM). In the case where we do not have concept annotations, we extracted concepts via the true class label from a knowledge graph (i.e. ConceptNet), and used multi-modal models such as CLIP to automatically extract the corresponding embeddings as concept vectors. We explore both these methods in our reproductions. These concept vectors are then concatenated vertically, with each row being one concept vector, to form a concept 'subspace'. To extend the method to work with audio, where we did not use manually labeled concepts, we made use of the contrastive language *audio* pertaining (CLAP) model (Wu et al., 2023). CLAP was inspired by CLIP and works similarly by consisting of both an audio and text encoder model that, capable of producing aligned embeddings for audio and text data. For our experiments, the audio encoder utilizes the HTS-AT (Chen et al., 2022) transformer architecture within the pre-trained CLAP model. With CLAP, different concepts for different classes are given as input into the text feature extractor. ## 2.3 Training Pcbms And Pcbm-Hs With the concept subspace prepared, we then extract embeddings from the penultimate layer of the backbones and project them onto the concept subspace. These projections are subsequently used to train sparse linear classifiers with concepts as features. With x being the samples of the dataset D, PCBMs are linear classifiers g (fC(x)) = wT fC(x) + b, where fC = projC f(x) are the projections of data embeddings f(x) (where f is some embedding network) onto the concept subspace C, and y are the targets. To train PCBMs, we use the following optimization objective: $$\operatorname*{min}_{g}\,\operatorname*{\mathbb{E}}_{(x,y)\sim{\mathcal{D}}}\left[{\mathcal{L}}\left(g\left(f_{\mathbf{C}}(x)\right),y\right)\right]+{\frac{\lambda}{N_{c}K}}\Omega(g)$$ Here we minimize the loss function L (e.g. cross-entropy loss) with a regularization term where Ω(g) = α∥w∥1 + (1 − α)∥w∥ 2 2 is a complexity measure to regularize the model for sparsity, namely, the elastic-net penalty parameterized by α. NcK is a normalization term (the number of concepts and classes respectively) and λ is the regularization strength. Following the original paper, we also build *Hybrid PCBMs* (PCBM-h) to fit the residuals by training the sum of the linear classifiers described above and the embeddings of the backbone models. This can be written out as follows: $$f(x)),y)]$$ ## Min R E(X,Y)∼D [L(G (Fc(X)) + R(F(X)), Y)] Here r : R d → Y is the residual predictor, which is implemented as a linear model r(f(x)) = w T r f(x) + br, d is the size of the embeddings and Y is set of targets in the task-specific encoding (e.g. one-hot). While training the residual predictor, the interpretable predictor g is trained independently and kept fixed. To observe model performance in the absence of the residual predictor, we can drop r. ## 2.4 Datasets & Evaluation To evaluate whether PCBMs and PCBM-hs offer comparable performance to the original models, we replicated a selection of experiments from the original paper. Specifically, we used the datasets CIFAR10, CIFAR100, CUB, and HAM10000. Due to limitations in code availability, specific implementation details, we decided to discard SIIM-ISIC, which were part of the original study. We then used the datasets ESC50 (Piczak, 2015) and FSDKaggle2018 (Fonseca et al., 2018) to test audio PCBMs. For each dataset, we conducted 10 tests using different seeds. To check the interpretability of the PCBMs, we use the same analysis method as in the origin paper as well - we extract concept weights from the sparse linear classification model and identify influential concepts for each class by ranking these concepts based on their magnitude and selecting the top-N concepts that exhibited the greatest influence on the classification process. We then verified whether these were relevant to the target class (see Section 3 for details). Below is a summary of the setup for each dataset that was used in the evaluation: CIFAR10, CIFAR100 (Krizhevsky et al., 2009): For these two datasets, the backbone model was a pre-trained CLIP-ResNet50 (He et al., 2015). It classifies images into unseen categories using pre-trained knowledge (Wang et al., 2019). Both datasets incorporate 170 concepts following Abid et al. (2022), specifically employing BRODEN concepts. The original training and test splits of both CIFAR datasets were used along with the same training parameters as the original authors. CUB (Wah et al., 2011): In the CUB dataset, as was also detailed by He & Peng (2020), we address a 200-way bird identification task employing a ResNet18 model specifically pre-trained for the CUB dataset. The preprocessing of input data adheres to the methodologies outlined in the original paper. We adopted the same training and validation splits, utilizing the 112 concepts described in Koh et al. (2020). HAM10000 (Tschandl et al., 2018): For the HAM10000 dataset, we utilized an Inception model specifically trained to analyze dermoscopic images from the HAM10000 dataset. This model aims to determine whether a skin lesion is benign or malignant. It incorporates the eight concepts outlined in the Derm7pt criteria and adheres to the experimental settings presented in the study by Lucieri et al. (2020). FSDKaggle2018 (Fonseca et al., 2018): We fine-tuned a ResNet34 model ourselves for the audio domain on the training subset of this data set. The ResNet34 was pre-trained on the ImageNet1k dataset (Deng et al., 2009). Since this model requires images as input, we pre-processed the audio wave data to log-Mel spectrograms. We use 232 audio concepts generated by CLAP. ESC-50 (Piczak, 2015): For the ESC-50 environmental audio classification data set, we also used the ResNet34 pre-trained on the FSDKaggle2018 data set described previously. Additionally, we evaluate PCBMs using CLAP's HTS-AT transformer backbone with pre-trained weights on this data set (Chen et al., 2022). The concepts were fed into the CLAP text encoder to create the concept embeddings. ## 2.5 A Note On Adapted Methodology For Clip While the original CLIP model relied on zero-shot classification, directly associating images with textual class descriptions using pre-trained embeddings, our adjusted approach involves training specialized classifiers atop CLIP's image features for tasks such as binary and multi-class classification. This adjustment serves to augment the performance of the baseline CLIP model and provides more flexibility in handling specific classification tasks. ## 3 Results This section lays out the results attained from both the reproducibility studies conducted (Section 3.1) and our own extension into the audio domain (Section 3.3), as well as relevant analysis. When applicable, results in the tables indicate the mean result over 10 seeds, ± the standard deviation. Additionally, there are a number of ways in literature to decide if results have been successfully reproduced (e.g. looking at trend lines instead of absolute values, as in Garcarz et al. 2023, subjectively deciding closeness, as in Don et al. 2023, or only looking closely at the verification of claims and not values, as in Baratov et al. 2023). In this paper, we consider an accuracy value to be reproduced successfully if it lies within 5 percentage points of the original (as was done previously in Sun et al. 2023). Though a fuller statistical analysis in future works may be needed for robustness, we believe this is not required for the purposes of verifying the claims and stated values of the original paper. ## 3.1 Image Classification: Performance Our reproduced results closely match those of the original paper (Table 1), which makes it reasonable to assume that their method is reproducible. The only results we have not been able to reproduce so far are those of the original models, where we achieve lower accuracy than stated in the original work. | Model | CIFAR10 | CIFAR100 | CUB | HAM10000 | COCO-Stuff | | |----------------|---------------|---------------|---------------|---------------|---------------|---------------| | Original Model | 0.888 | 0.701 | 0.612 | 0.963 | 0.770 | | | Original | PCBM | 0.777 ± 0.003 | 0.520 ± 0.005 | 0.588 ± 0.008 | 0.947 ± 0.001 | 0.741 ± 0.002 | | PCBM-h | 0.871 ± 0.001 | 0.680 ± 0.001 | 0.610 ± 0.010 | 0.962 ± 0.002 | 0.768 ± 0.01 | | | Original Model | 0.879 | 0.691 | 0.611 | 0.891 | 0.793 | | | Ours | PCBM | 0.814 ± 0.001 | 0.536 ± 0.001 | 0.579 ± 0.005 | 0.949 ± 0.001 | 0.713 ± 0.006 | | PCBM-h | 0.885 ± 0.006 | 0.688 ± 0.003 | 0.580 ± 0.003 | 0.961 ± 0.003 | 0.757 ± 0.011 | | | Model | CIFAR10 | CIFAR100 | COCO-Stuff | | |---------------------------|-------------------------|---------------|---------------|---------------| | Original Model (CLIP) | 0.888 | 0.701 | 0.770 | | | Yuksekgonul et al. (2022) | PCBM & labeled concepts | 0.777 ± 0.003 | 0.520 ± 0.005 | 0.741 ± 0.002 | | PCBM & CLIP concepts | 0.833 ± 0.003 | 0.600 ± 0.003 | 0.755 ± 0.001 | | | PCBM-h & CLIP concepts | 0.874 ± 0.001 | 0.691 ± 0.006 | 0.769 ± 0.001 | | | Original Model (CLIP) | 0.879 | 0.691 | 0.793 | | | Ours (Reproduction) | PCBM & labeled concepts | 0.814 ± 0.001 | 0.536 ± 0.001 | 0.713 ± 0.006 | | PCBM & CLIP concepts | 0.841 ± 0.002 | 0.572 ± 0.004 | 0.725 ± 0.003 | | | PCBM-h & CLIP concepts | 0.865 ± 0.002 | 0.675 ± 0.002 | 0.760 ± 0.001 | | | Model | Mean Difference | |----------------|-------------------| | Original Model | 0.0138 ± 0.0314 | | PCBM | 0.0036 ± 0.0220 | | PCBM-h | 0.0040 ± 0.0155 | | PCBM & CLIP | 0.044 ± 0.017 | | PCBM-h & CLIP | 0.011 ± 0.003 | Table 1: **Reproduction of PCBM performance results**. "Ours" refers to our attempts at reproducing the results of the "Original" paper (Yuksekgonul et al., 2022). The performance of our baselines, PCBM and PCBM-h models is in line with their results. Table 2: **Reproduced results with CLIP concepts.** Here concept descriptions generated by CLIP are used to generate the concept subspace, which alleviates the reliance on concept annotations. Our PCBM and PCBM-h models align with the original paper's results. Table 3: Performance Comparison Our reproduced results with CLIP concepts, i.e. using unlabeled data with multi-modal models for generating concept vectors, (Table 2) also closely match those of the original paper, which makes it reasonable to assume that they are reproducible as well. ## 3.2 Image Classification: Interpretability Figure 1 from the original paper displays the ranked magnitude of concept weights in PCBMs on classification tasks, highlighting the model's interpretability. Our reproduction of this is in Figure 2. After ranking concepts by the magnitude of their respective weights and identifying the top-N concepts that significantly influence classification (N = 3 in the original, 5 in our reproduction), we demonstrate comparable findings and interpretability between our study and the original. The observed variation in the range of concept weights between our study and the original paper can be attributed to differences in the regularization ![5_image_0.png](5_image_0.png) Figure 1: Concept weight interpretation (original). The concepts with the highest weights in the PCBM's linear classification layer align well with the class labels. This figure is reproduced from Yuksekgonul et al. (2022). ![5_image_1.png](5_image_1.png) Figure 2: Concept weight interpretation (reproduction). In our reproduction, we also observe that the concepts match the class labels well. parameter settings for both PCBMs and SVMs. This parameter significantly influences the magnitude of weights, though often not the ranking of concepts themselves. Additionally, in reproducing the results for the HAM1000 task, our PCBM produces the same weights for both classes, unlike in the original paper. In our attempts to reproduce these results, we treated the skin lesion classification task as a binary classification task (either benign or malignant), which results in the PCBM being a single logistic regression model, with a single weight matrix for both classes. This is also the case in the provided implementation by the authors. Thus it is unclear to us how the original authors were able to produce two sets of differing weights. ## 3.3 Audio Classification: Performance Using the experimental setup described in Section 2, we get promising results with PCBMs, as can be seen in table 4. For both backbone models, the audio PCBM only suffers a small loss in performance compared to our baseline on the ESC-50 environmental audio classification task. We also see that nearly half of the deficit is recovered by using the Hybrid-PCMB model. For the FSD2018Kaggle data set, we observe a similar loss in performance with our PCBM model with the ResNet34 backbone. Here, again, almost all of the deficit can be recovered with the PCBM-h model. Thus, we see that claims 1 and 2 are both supported when generalizing this method to a new domain, namely, that all networks can become PCMBs and that PCBMs achieve high accuracy comparable to the original model. | Backbone model | Model | ESC-50 | FSD2018Kaggle | |------------------|---------------|---------------|-----------------| | Original model | 0.733 | 0.855 | | | ResNet34 | PCBM | 0.701 ± 0.012 | 0.825 ± 0.009 | | PCBM-h | 0.713 ± 0.000 | 0.846 ± 0.001 | | | Original model | 0.940 | N/A | | | HTS-AT | PCBM | 0.935 ± 0.010 | N/A | | PCBM-h | 0.940 ± 0.000 | N/A | | Table 4: The PCBM trained in the audio domain performs almost as well as the baseline ResNet34 while the PCBM-h decreases the gap in accuracy further. For the transformer HTS-AT backbone, the PCBM closely approaches baseline performance, with PCBM-h matching the original model. ## 3.4 Audio Classification: Interpretability As with the image interpretations, after training our audio PCBM based on the ResNet34, we ranked concepts based on their weights, and observed the highest weights in the linear classification layer to the most influential N = 5 concepts for a given class label. As can be seen from Figure 3, the concepts do not intuitively match the label very well. The HTS-AT PCBM results show a significant increase in performance on the ESC-50 dataset, illustrated earlier in Table 4. In Figure 3, we interpret the weights of this PCBM. We can see that concepts used for classification match the predicted class much more closely compared to the ResNet34 PCBM concepts. We believe that the discrepancy in the interpretability lies primarily in the different ways embeddings are created in both models. ## 4 Discussion In this section, we discuss various aspects of our reproduction and analysis, and justify whether or not the claims of Yuksekgonul et al. (2022) are affirmed by our study. ## 4.1 Reproducibility Of The Original Results And Generalization In Sections 3.1 and 3.2, we reproduced the majority of results from the original paper, suggesting the reproducibility and efficacy of PCBMs as a method. We saw that there was no significant deviation to the ![7_image_0.png](7_image_0.png) Figure 3: Concept Weights Audio PCBM. Even though we are using the same concept bank generated by GPT4, the concepts with the highest weight produced by the PCBM with the HTS-AT backbone make way more sense from a human point of view. The corresponding concepts with the highest weight from the ResNet PCBM do not seem to match well at all with the class label. results. As described in Section 3, we defined a successful reproduction of a value as when it is within 5 percentage points of the original. Additionally, by using a similar pipeline to the original for the audio domain, we can create PCBMs for audio classification and achieve high-accuracy results with somewhat interpretable results. Thus, overall, we can say that claims 1 and 2 are supported, that a wide range of neural networks can be turned into a PCBM with no significant change in performance. Claim 3 about the interpretability of PCBMs is only partially justified, as we have shown in the audio domain. We discuss this point further in Section 4.4. ## 4.2 Deviation Of Results From Original Paper In general, replicating the performances of each PCBM and PCBM-h for the majority of datasets was facilitated by the comprehensive code provided by the original paper. Except for the ISIC datasets, we found the replication easy, affirming the reproducibility of the original study's methodology for most tested scenarios. Though we claim to have reproduced the original paper's results to a relatively small margin (within 5 percentage points for each result), our results do deviate from theirs slightly. This discrepancy in model accuracy could stem from several factors. First, the original study may have utilized a specific version of the CLIP model or different pre-processing steps that were not explicitly documented. Subtle variations in image scaling, normalization, or data augmentation can have a profound impact on model performance. Another potential reason could be the difference in utilized pre-trained model weights. If the original study used pre-trained models with certain checkpoints, the absence of these specific weights in our replication would lead to discrepancies. Lastly, variations in hyperparameter settings such as batch size, learning rate, or even random seed during training can introduce non-negligible differences in outcomes. A more thorough disclosure of the experimental setup in the original paper would greatly aid in addressing these issues. Our hyperparameters are disclosed in Appendix A. In future work, a detailed study controlling these factors could pinpoint the source of the performance gap. Moreover, direct communication with the original authors could clarify unreported details crucial for an accurate replication. Though we attempted this (and a follow up), no response from the original authors was received by the time of writing this paper. ## 4.3 Impact Of Concept Banks While creating audio PCBMs, we found that a suitable concept bank can be difficult to construct for domains like audio classification. This is because different senses can encode very different information therefore leading to very different concepts (Ezgi Mamus & Majid, 2023). For example, we can see a cat has whiskers, four legs, sharp claws, etc., but we cannot *hear* those concepts from a cat. Instead, we may hear auditory features such as high-pitched, soft, intimate, etc. We also need to consider how the multi-modal models are utilized. Specifically, we need to pay attention to what texts are used in image-text pairs and avoid choosing a concept bank with vocabulary that is not covered by the text-encoder in the training of these multi-modal models. With our list of concepts, our audio PCBMs achieved performance very close to the baseline model. When we look at the weights of the most impactful concepts, however, we find that the concept descriptions do not match the classes well. In the future, we wish to extract audio concepts in a structured way similar to the original paper using the AudioSet (Gemmeke et al., 2017) ontology for sounds. We believe this would yield a more meaningful set of concepts and help the model learn generalizable representations. Using a larger training data set could also help our model better learn appropriate concepts, such as experiments with additional audio data, thereby also including domains outside of environmental audio and perhaps even more specialized ones (e.g. medical audio data). ## 4.4 Alignment Between Embeddings And Concept Subspace In the original paper, the authors proposed two ways to generate concept subspaces. One is through CAVs, and another is by using multi-modal models. In CAVs, the embeddings generated by backbone models are used to create the concept subspace. While using multi-modal models, the shared embeddings of the image encoder and text encoders are used for creating the concept subspace. For example, when creating audio PCBMs, we used ResNet as a backbone model to create embeddings, while the audio encoder in CLAP is transformer-based. Different initializations and architectures may lead to different encodings, and depending on the difference in the size of the embedding spaces, we might lose a significant amount of information when projecting the embeddings to the concept subspace. This means the connection between text and audio representations in CLAP with a transformer audio encoder may not apply to the audio representations from ResNet. This can in the end cause a mismatch between the audio inputs and concepts, leading to incoherent or irrelevant concepts being used to explain the outputs of a model. We believe having the baseline model and audio encoder in CLAP aligned or a similar size would provide us with a meaningful and interpretable set of concepts for a given input. Later on, we changed the backbone model to a transformer similar to the encoder in CLAP. From our results, this change increased both accuracy and interpretability. From this, we would like to re-evaluate the claim the authors made that one can turn any neural network into PCBMs without labeled data. Using multi-modal models to construct concept subspace indeed makes it much easier to build a PCBM, so we do not have to manually annotate concepts. However, it is not yet straightforward to adopt a multi-modal model because one needs to make sure the multi-modal model uses the same encoder model as the backbone, meaning we might need to fine-tune it to retain most of its original performance. ## 4.5 Computational Resources Since the main premise of the original paper is about adapting pre-trained models only by adding a single trainable linear layer, it is quite light on resource needs. As we did not find suitable backbone models pretrained specifically on spectrogram data, we decided to fine-tune a pre-trained model. In total, including computing the concept vectors, fine-tuning and testing of the ESC-50 and FSDKaggle2018 datasets, our models ran for a total of less than 60 minutes on a Nvidia RTX 4090 GPU, which is estimated to be 0.15kg CO2eq in total. Training of the PCBMs was conducted on CPUs for all data sets. This indeed shows an advantage of PCBMs in terms of computational resources. ## References Abubakar Abid, Mert Yuksekgonul, and James Zou. Meaningfully debugging model mistakes using conceptual counterfactual explanations. In *International Conference on Machine Learning*, pp. 66–88. PMLR, 2022. Amina Adadi and Mohammed Berrada. Peeking inside the black-box: a survey on explainable artificial intelligence (xai). *IEEE access*, 6:52138–52160, 2018. Farrukh Baratov, Göksenin Yüksel, Darie Petcu, and Jan Bakker. Reproducibility Study of "Quantifying Societal Bias Amplification in Image Captioning". In *ML Reproducibility Challenge 2022*, 2023. Ke Chen, Xingjian Du, Bilei Zhu, Zejun Ma, Taylor Berg-Kirkpatrick, and Shlomo Dubnov. Hts-at: A hierarchical token-semantic audio transformer for sound classification and detection. In *ICASSP 2022-* 2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 646–650. IEEE, 2022. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In *2009 IEEE conference on computer vision and pattern recognition*, pp. 248–255. Ieee, 2009. Marga Don, Satchit Chatterji, Milena Kapralova, and Ryan Amaudruz. [Re] On the Reproducibility of "FairCal: Fairness Calibration for Face Verification". In *ML Reproducibility Challenge 2022*, 2023. Aslı Özyürek Ezgi Mamus, Laura J. Speed and Asifa Majid. The effect of input sensory modality on the multimodal encoding of motion events. *Language, Cognition and Neuroscience*, 38(5):711–723, 2023. doi: 10.1080/23273798.2022.2141282. URL https://doi.org/10.1080/23273798.2022.2141282. Eduardo Fonseca, Manoj Plakal, Frederic Font, Daniel P. W. Ellis, Xavier Favory, Jordi Pons, and Xavier Serra. General-purpose tagging of freesound audio with audioset labels: Task description, dataset, and baseline, 2018. Sławomir Garcarz, Andreas Giorkatzi, Ana Ivăs,chescu, and Theodora-Mara Pîslar. Reproducibility Study: Label-Free Explainability for Unsupervised Models. In *ML Reproducibility Challenge 2022*, 2023. Jort F. Gemmeke, Daniel P. W. Ellis, Dylan Freedman, Aren Jansen, Wade Lawrence, R. Channing Moore, Manoj Plakal, and Marvin Ritter. Audioset, 2017. URL https://research.google.com/audioset/. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition, 2015. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. Xiangteng He and Yuxin Peng. Fine-grained visual-textual representation learning. *IEEE Transactions* on Circuits and Systems for Video Technology, 30(2):520–531, February 2020. ISSN 1558-2205. doi: 10.1109/tcsvt.2019.2892802. URL http://dx.doi.org/10.1109/TCSVT.2019.2892802. Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, and Rory Sayres. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav), 2018. Pang Wei Koh, Thao Nguyen, Yew Siang Tang, Stephen Mussmann, Emma Pierson, Been Kim, and Percy Liang. Concept bottleneck models. In *International conference on machine learning*, pp. 5338–5348. PMLR, 2020. Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. Adriano Lucieri, Muhammad Naseer Bajwa, Stephan Alexander Braun, Muhammad Imran Malik, Andreas Dengel, and Sheraz Ahmed. On interpretability of deep learning based skin lesion classifiers using concept activation vectors. *CoRR*, abs/2005.02000, 2020. URL https://arxiv.org/abs/2005.02000. R OpenAI. Gpt-4 technical report. *arXiv*, pp. 2303–08774, 2023. Karol J. Piczak. ESC: Dataset for Environmental Sound Classification. In Proceedings of the 23rd Annual ACM Conference on Multimedia, pp. 1015–1018. ACM Press, 10 2015. ISBN 978-1-4503-3459-4. doi: 10.1145/2733373.2806390. URL http://dl.acm.org/citation.cfm?doid=2733373.2806390. Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision, 2021. Robyn Speer, Joshua Chin, and Catherine Havasi. Conceptnet 5.5: An open multilingual graph of general knowledge. In *Proceedings of the AAAI conference on artificial intelligence*, volume 31, 2017. Kaiser Sun, Adina Williams, and Dieuwke Hupkes. A replication study of compositional generalization works on semantic parsing. In *ML Reproducibility Challenge 2022*, 2023. Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions, 2014. Philipp Tschandl, Cliff Rosendahl, and Harald Kittler. The ham10000 dataset, a large collection of multisource dermatoscopic images of common pigmented skin lesions. *Scientific Data*, 5(1), August 2018. ISSN 2052-4463. doi: 10.1038/sdata.2018.161. URL http://dx.doi.org/10.1038/sdata.2018.161. Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds200-2011 dataset. 2011. Wei Wang, Vincent W Zheng, Han Yu, and Chunyan Miao. A survey of zero-shot learning: Settings, methods, and applications. *ACM Transactions on Intelligent Systems and Technology (TIST)*, 10(2):1–37, 2019. Yusong Wu, Ke Chen, Tianyu Zhang, Yuchen Hui, Taylor Berg-Kirkpatrick, and Shlomo Dubnov. Largescale contrastive language-audio pretraining with feature fusion and keyword-to-caption augmentation. In ICASSP 2023-2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 1–5. IEEE, 2023. Mert Yuksekgonul, Maggie Wang, and James Zou. Post-hoc concept bottleneck models. In The Eleventh International Conference on Learning Representations, 2022. ## A Hyperparameter Configuration All settings and hyperparameters not mentioned here (and are generally not relevant to the reproduction of PCBMs) may be found in our code, mentioned in the abstract of this paper. In our general PCBM experimental setup, the elastic net sparsity ratio, denoted as α, was consistently set to 0.99 across all models. We employed a Stochastic Gradient Descent Classifier (SGDClassifier) for training. This classifier was configured with a maximum of 10,000 iterations and was augmented by an elastic net penalty. We adopted the Adam optimization algorithm for components of the hybrid model utilizing PyTorch. The learning rate (–lr) for this algorithm was set to 1 × 10−3. The training epochs are set to be 10, with a batch size of 64 and a worker count of 4. For the PCBM-h experiment, the training epochs are set to 20, with a batch size of 64 and a worker count of 4. The learning rate (–lr) are set to 1 × 10−2. The l2-penalty is set to 1 × 10−3. The parameters used for the SVM to obtain the concept vectors are the same for all concept banks. We use a regularization parameter of 0.1. For the number of samples for each of the sets that contain or do not contain the concepts, we use different values though, for CIFAR10 and CIFAR100 and HAM10000 we use 50 samples, whereas for CUB we use 100. For these two multi-modal models, for CIFAR10 and CIFAR100, the model backbone was a CLIP-ResNet50. The regularization strength, represented by –lam, was calibrated through a grid search to a value of 1×10−5. with 50 samples.
Review 1: Summary: This paper investigates the prior work on Post-hoc Concept Bottleneck Models (PCBMs) and their ability to enhance the interpretability of deep neural networks while maintaining high performance. This involves applying the PCBM approach to image classification tasks using the same datasets and backbone models as the original study. The authors reproduce key experiments from the original PCBM paper in the image domain and extend the approach to audio classification while evaluating three main claims: 1: Applicability to any neural network. 2: Comparable performance to the original model. 3: Interpretability benefits via this approach. Moreover, for the audio, the process first involves adapting the approach to work and then generate audio-specific concept banks, which enables the evaluation of performance on two audio classification datasets. Authors find that PCBMs maintain high accuracy with only a small performance drop compared to the baseline models, supporting claims 1 and 2. However, the interpretability of the ResNet34 PCBM is questionable, as the identified impactful concepts do not intuitively match the class labels. In contrast, the HTS-AT PCBM demonstrates better alignment between concepts and classes, suggesting the importance of embedding alignment. Strengths and Weaknesses: **Strengths**: * Thoroughly investigates PCBMs and their claims, providing valuable insights into their performance and interpretability. * Extends the approach to the audio domain, demonstrating its potential for broader application. * Discusses challenges and limitations encountered during reproduction and analysis, promoting transparency and reproducibility in research. * Identifies that there can be differences and incoherency in the concepts that are learnt vs human understanding of the audio signals. **Weakness**: Embedding misalignment issues: The paper highlights the potential misalignment between embeddings generated by the backbone model (e.g., ResNet34) and the audio encoder within the CLAP model used for concept generation. This difference in architectures may lead to discrepancies in the embedding spaces, resulting in inaccurate or irrelevant concepts being associated with the audio inputs. Requested Changes: The paper should strive for a higher quality reproduction study with a detailed methodology and analysis of discrepancies or reduce the emphasis on reproduction and dedicate more attention to novel contributions. Experimental analysis for the audio classification task should be conducted using AudioSet for comparison of results with other approaches. Embedding misalignment issues should be carefully studied with the differences in architectures to be ruled out as that can cause discrepancies in the embedding spaces leading to incorrect concept Broader Impact Concerns: No concern. ================================================== Review 2: Summary: This submission a) reports on the reproduction of experiments conducted by Yuksekgonul et al. in the paper titled "Post-hoc Concept Bottleneck Models" (PCBM), b) extends the underlying approach to audio classification tasks, and b) conducts a similar experimental investigation in two audio classification tasks. One of the purposes for conducting steps b) and c) is to verify the claim made by the original paper authors that any NN can be converted in high-performing PCBM. Strengths and Weaknesses: Strengths CBMs and their variants provide one of many approaches for interpreting and understanding black-box AI systems. Attempts at reproducing prior results and extending this work to new domains can be commended. Weaknesses Unfortunately I have serious reservations regarding both the reproduction of prior results as well as the extension of PCBMs to new domains. Your manuscript fails to mention what information you had available in order to start reproducing the results published in the original paper. You provide no discussion about the likelihood of being able to reproduce results nor you discuss possible impacts of not having any of the ingredients required. You do not define what you mean by successful reproduction. It seems in your manuscript you are equally happy with differences as small as 0.008 and as large as 0.037. The huge discrepancy in reproducing original models is very concerning yet apart from some hypothetical guesses you offer no other explanation. Given that some of the key ingredients required to reproduce the results were missing from the start, I find your reproduction experiments offering limited value. It would have sufficed to simply state that this is the best you could get given information available to you and focus on adding content to the manuscript from elsewhere (such as new domains, new (P)CBM variants, etc.). Your investigation of PCBMs for audio classification is quite limited in its scope and options you have examined. You have not provided any explanation of what other options other than ChatGPT were there to derive meaningful categories. Neither you described how meaningful it is to use (clearly) suboptimal categories and what kind of impact this choice has on the PCBMs and their use. Requested Changes: Either produce a higher quality reproduction investigation (I believe there are examples of published reproduction papers in ML and more generally (e.g. https://rescience.github.io/)), or reduce the amount of content devoted to that and increase the part linked with the audio classification task (and maybe some other ones.) Provide a more comprehensive investigation into applying PCBMs in audio classification tasks. Broader Impact Concerns: None ================================================== Review 3: Summary: This paper mainly investigates the reproducibility of post-hoc concept bottleneck models (PCBM) and explores their application to the audio classification task. The paper first describes the PCBMs and their variants (Hybrid PCBMs (PCBM-h)) and shows their reproduction attempts. Their experiments find differences from the original paper and discuss the potential difference in their reproduction. The application experiments on the audio domain and found its concept list differs depending on the choice of the base model. Strengths and Weaknesses: Strengths - Reproduction of the other researchers' reports is essential in general. - Application to the other domain (audio domain) shows the robustness of the PCBM techniques. Weaknesses - Very weak technical novelty. The paper mainly focuses on reproduction, and no significant technical novelty exists. - Although reproduction is essential, the current experiments have several unclear parts compared with the original authors' experimental configurations, and it is difficult to claim the findings about reproduction and application to the audio domain from this experimental result. Requested Changes: - The authors should focus more on making sufficient technical novelties instead of only focusing on reproduction or application to the other domains, which will attract more TMLR readers. - If the authors stick to reproduction, they should at least make more efforts to use the same experimental configurations (e.g., by contacting the authors of the PCBM paper). Other minor comments: - The abstract should be more concrete. The abstract requires specific knowledge about Concept Bottleneck Models (CBMs) and Post-hoc Concept Bottleneck Models (PCBMs). It is difficult for general ML readers to understand this abstract. - Figure 4 seems to be vital information to discuss in Section 3.4. So, moving Figure 4 to the main body is better than the appendix section. Broader Impact Concerns: No concern. ================================================== Review 4: Summary: The main goal of the paper is to reproduce previously published paper "Post-hoc concept bottleneck models" with sharing best practices, the claims that can be reproduced following the paper and published code for that paper, the claims which cannot be reproduced. Moreover, authors apply the paper idea and methodology to audio domain (as before it is shown only for vision data) and extend results and claims to audio datasets. In summary, authors are able to reproduce part of the results, they discuss what and why they were not able to reproduce (but the main algorithm was reproduced), they apply technique to audio domain and show that it also works there, however there is an issue of getting the proper interpretability which can be related to the issue of the backbone and pre-trained model discrepancy in the feature extraction -- authors discuss this in the last section as the issue of the multi-modal representation and proper stacking the models in this case. Strengths and Weaknesses: **Strengths** - reproduction of the previously published paper (this is really good for community) with specifying and discussing issues, releasing reproduction code - applying the method to the audio domain -- this is important step to know generalization of the technique to speed up adoption of the method if it is applicable widespread - important discussion of the discrepancies between audio data and vision data, as well as issue of multi-modal representations **Weaknesses** - I believe more stressing and a bit better formatting of the text is needed, as well as some clarity is absent on some steps (see requested changes) - issues on reproducing the original model -- I understand that authors of the prior paper didn't respond and maybe the training is not reproducible at all, but some numbers in Table 1 is super bad (30% accuracy on CIFAR) which causes doubts how meaningful then the reproduction of the PCBM then? - Imagenet is used as pretraining data for audio data -- I am working a lot in speech domain and this is unexpected for me to see this kind of pretraining for audio classification to be honest. Why not some other data? - in terms of reproduction -- it is not matched in the range of std, so I would be careful here in formulation as std within the same code base is small, while the std between the codebases is actually high, though the ordering between the methods preserved. Maybe some discussion on the std between the codebases is needed. Requested Changes: Please find below suggested improvement for the text and some suggestions to strength the paper's results: - clarity - page 2 Claim 1 formulation: "any neural network" - this is too strong claim, as we cannot brute force all possible models, I would smooth formulation. Otherwise did original paper had math proof (which I guess also impossible to have with the current math we have) - page 2 claim 2 formulation: "original model" - it is not clear for the entire paper what is exactly original model - is it model we train which later we try to change to the PCBM by changes the arch and loss and training from scratch? Maybe it is CBM model? - sec 2.1 "in both domains" - you are speaking about audio, why here both domains? fix paragraphs on speaking only about vision, then about audio, then about both together. - through the paper for me it is not clear which parts are reproduction, which parts some modifications. Better to be strict everywhere on this and have bold text e.g. About audio part - be also clear in text that all things are new and not reproduction. Right now it is mixed a bit in the text. - sec 2.3 f(x) definition is not given - sec 2.4 better to discuss why you decided to discard COCO right away in the section. Also is the size of COCO benchmark is larger? I wonder if there are issues on reproduction the scaled version, when data/model size is increased. - what is exactly "original model"? from text it is hard to get sec 3.2 last paragraph - highlight it more - it is important thing you checked! - Table 3: first sentence in the caption is really weird, I don't see the "half the accuracy loss" - page 8 top paragraph - "any neural net can be" - this is too strong claim, we never can show it (except from theoretical proof). So you need to smooth formulation. - Sec 4.3 last paragraph "for sounds We believe" - missed dot (I didn't see any other typos :) ). - Sec 4.5 - "spectrogram image data" - remove image, why it is there? - Appendix B "It is repeated 50 times" - I didn't get what is exactly repeated. Why also in the prompt it is underscore in the names of classes? Did you try to remove it to get better output as we know things are sensitive to the punctuation formatting in the prompts. - methodological - why did you use Imagenet as pretrained model to finetune on audio dataset? I think this is really inappropriate comparison. - why for the second dataset of audio (ESC 50) you use pretrained model to be the one finetuned on FSDKaggle2018? - the std for the same codebase is small, but reproduction between codebases is not within this std, so discussion on why there are still discrepancies would be beneficial - figure 3 - is it because we used pretrained model on Imagenet? - why not using AudioSet for experiments? It is more popular dataset, maybe the issue it is big for resources you have to be able to train on it? (then it is ok if not enough resources). - why any model trained on audio / speech is not used as pretrained model? e.g. trying wav2vec 2.0 or some other things from speech domain - yep it is OOD for the audio classification but closer in terms of representation that imagenet models. - some prior works on audio datasets should be provided to get sense how the original model performance or proposed model perform in the context of sota models (that the baseline are well enough to make them interpretable). Broader Impact Concerns: The work is important on getting more controlled models via interpretability, showing that prior methods can be extended to other domains (from vision to audio), and getting reproducible research results and claims. I do not have any concerns with the current form of the paper. ================================================== Metareview: Recommendation: Reject Comment: Overall, I recommend rejection, with the possibility of a major revision, for the reasons I outlined in the "Claims And Evidence" section. ==================================================
# Measuring Orthogonality In Representations Of Generative Models Anonymous authors Paper under double-blind review ## Abstract In unsupervised representation learning, models aim to distill essential features from highdimensional data into lower-dimensional learned representations, guided by inductive biases. Understanding the characteristics that make a good representation remains a topic of ongoing research. Disentanglement of independent generative processes has long been credited with producing high-quality representations. However, focusing solely on representations that adhere to the stringent requirements of most disentanglement metrics, may result in overlooking many high-quality representations, well suited for various downstream tasks. These metrics often demand that generative factors be encoded in distinct, single dimensions aligned with the canonical basis of the representation space. Motivated by these observations, we propose two novel metrics: *Importance-Weighted Orthogonality (IWO)* and *Importance-Weighted Rank (IWR)*. These metrics evaluate the mutual orthogonality and rank of generative factor subspaces. Throughout extensive experiments on common downstream tasks, over several benchmark datasets and models, IWO and IWR consistently show stronger correlations with downstream task performance than traditional disentanglement metrics. Our findings suggest that representation quality is closer related to the orthogonality of independent generative processes rather than their disentanglement, offering a new direction for evaluating and improving unsupervised learning models. ## 1 Introduction Humans are able to process rich data such as high-resolution images to distill and memorize key information about potentially complex concepts. Similarly, representation learning aims to devise a procedure, often unsupervised, to encode potentially high-dimensional data into a lower-dimensional learned embedding space, such that classifiers or other predictors can easily extract information from the learned representations (Bengio et al., 2013). Understanding how to generate these convenient representations, requires the definition of desirable properties that representation learning models should enforce. In the domain of generative models, the ability to *disentangle* the explanatory factors underlying the data has long been credited to be such a desirable property. In the disentangled representation learning framework, data x is often assumed to be generated by an underlying function g driven by ground truth, generative factors {zj} K j=1 and other variability factors t, that is x = g(z, t). A model then learns a mapping c = r(x) ∈ R L from the data to a latent representation space. A common characterization of disentanglement posits that the generative factors are represented by single distinct components of c, implying that they manifest as orthogonal 1-d latent subspaces aligned with the canonical basis within the latent representation, up to a scaling factor and irrelevant latent dimensions (*i.e.*, when *L > K*). Disentangled representations have played a pivotal role in improving the performance of tasks such as classification (Zhou et al., 2022), segmentation (Kalkhof et al., 2022), registration Han et al. (2020), image-toimage translation (Fei et al., 2021), artifact reduction (Tang et al., 2022), harmonisation (Li et al., 2021), controllable synthesis (Kelkar & Anastasio, 2022) and disease decomposition (Couronné et al., 2021). However, while disentanglement represents an intuitive and useful notion to characterize good representations, its general ![1_image_0.png](1_image_0.png) Figure 1: Three configurations of data (circles) encoded in a 2-d learned latent space. The data is characterized by size and (grayscale) color factors. The blue axes represent the direction of change in the factors. (i) The factors are aligned with the basis of the space, corresponding to perfect disentanglement and perfect orthogonality. (ii) The factors are not aligned but orthogonal, corresponding to complete entanglement, but still perfect orthogonality. (iii) The factors are not orthogonal and some circle configurations are not encoded, however, disentanglement is higher than in (ii), because of partial alignment with the basis. Despite its complete entanglement, we argue that latent space (ii) is just as well suited as (i) for common downstream tasks, while (iii) is not. applicability is limited. Indeed, Locatello et al. (2019) prove, by using simple orthogonal transformations, that unsupervised disentanglement learning is fundamentally impossible, without inductive biases on both models and datasets. In addition, the authors show that disentanglement exhibits weak correlation with the suitability of representations for common downstream tasks. We believe that this weak correlation can be attributed to the stringent nature of disentanglement measures, which penalize many high-quality representations otherwise suitable for downstream tasks. To get an intuition of the problem, Figure 1 visualizes 2-d representation spaces encoding circles varying in size and color. While in space (i) and (ii) the dimensions encoding the generative factors are orthogonal to one another, in space (iii) they exhibit strong correlation. For the downstream task of regressing size and color, most models find the orthogonal spaces (i) and (ii) better suited than (iii), as they properly encode all size and color combinations, while space (iii) fails to encode the largest, lightest and the smallest, darkest circles. However, according to standard disentanglement metrics, space (ii) is completely entangled (worst case), while space (iii) exhibits a better disentanglement, due to the requirement that the generative factors must align with the canonical basis of the representation space. The disentanglement properties of these representations therefore stands in contrast to their downstream task utility. While disentangled representations can be well-suited for many downstream tasks, entangled but orthogonal representations can be equally effective. In line with Wang & Isola (2020), we believe that correlation with relevant downstream tasks is a necessary condition for any metric measuring representation utility. The absence of this correlation is a significant weakness of common disentanglement metrics. We therefore propose two new metrics: *Importance-Weighted Orthogonality (IWO)* and Importance-Weighted Rank (IWR). To compute these metrics, we utilize *Generative Component Analysis (GCA)*, a novel methodology that identifies the weighted vector subspaces where generative factors vary. IWO then measures the mutual weighted orthogonality between the subspaces found through GCA, while IWR assesses their weighted rank. Intuitively, IWO can be thought of as an expansion of cosine similarity to general vector subspaces. We empirically assess the validity of the proposed metric in various synthetic experiments and by analysing the performance of three common downstream tasks across six benchmark datasets and six widely used models, showing that IWO and IWR consistently display stronger correlations with downstream task performance than popular disentanglement metrics such as MIG (Chen et al., 2018) or DCI (Eastwood & Williams, 2018). Our research suggests that the utility of a representation may be closer related to its orthogonality than its disentanglement. ## 2 Related Work Alongside the task of disentanglement, gauging a model's performance in disentangling a representation has emerged as a non-trivial problem. Beyond visual inspection of the results, a variety of quantitative methodologies have been developed to tackle this issue. Higgins et al. (2017) propose to measure the accuracy of a classifier predicting the position of a fixed generative factor. Kim & Mnih (2018) further robustify the metric by proposing a majority voting scheme related to the least-variance factors in the representations. Chen et al. (2018) introduce the *Mutual Information Gap* estimating the normalized difference of the mutual information between the two highest factors of the representation vector. Eastwood & Williams (2018) propose the DCI metrics to evaluate the correlation between the representation and the generative factors. For each of them, one linear regressor is trained and the entropy over the rows (*Disentanglement*) and the columns (*Completeness*) is computed, along with the error (*Informativeness*) achieved by each regressor. The *Modularity* metric introduced by Ridgeway & Mozer (2018) computes the mutual information of each component of the representation to estimate its dependency with at most one factor of variation. SAP score (Kumar et al., 2018) estimates the difference, on average, of the two most predictive latent components for each factor. The use of metrics such as the aforementioned ones contributed to shaping several definitions of disentanglement, each encoding a somewhat different aspect of disentangled representations, which led to a fragmentation of definitions (Locatello et al., 2019). Higgins et al. (2018) attempt instead to propose a unified view of the disentanglement problem, by defining Symmetry-Based Disentangled Representation Learning (SBDRL), a principled framework drawn from group representation theory. The authors established disentanglement in terms of a morphism from world states to decomposable latent representations, equivariant with respect to decomposable symmetries acting on the states/representations. For a representation to be disentangled, each symmetry group must act only on a corresponding (multidimensional) subspace of the representation. Following this conceptualization, Caselles-Dupré et al. (2019) demonstrate the learnability of such representations, provided the actions and the transitions between the states. Painter et al. (2020) extend the work by proposing a reinforcement learning pipeline to learn without the need for supervision. Noteworthy are the two proposed metrics: (i) an *independence score* that, similarly to our work, estimates the orthogonality between the generative factors in the fashion of a canonical correlation analysis; (ii) a factor leakage score, extended from the MIG metric to account for all the factors. Tonnaer et al. (2022) formalize the evaluation in the SBDRL setting and proposed a principled metric that quantifies the disentanglement by estimating and applying the inverse group elements to retrieve an untransformed reference representation. A dispersion measure of such representations is then computed. Note that while most works focus on the linear manipulation of the latent subspace, the SBDRL can also be used in non-linear cases. However, SBDRL requires modelling the symmetries and the group actions, a challenging task in scenarios with no clear underlying group structure (Tonnaer et al., 2022). We aim to develop a metric which does not require such a group structure and works in more general cases. Recently, several works (Montero et al., 2021; Träuble et al., 2021; Dittadi et al., 2021) have proposed to go beyond the notion of disentanglement, advocating for the relaxation of the independence assumption among generative factors - perceived as too restrictive for real-world data problems - and modelling their correlations. Reddy et al. (2022) and Suter et al. (2019) formalize the concept of causal factor dependence, where the generative factors can be thought of as independent or subject to confounding factors. The latter work introduced the *Interventional Robustness Score* assessing the effects in the learned latent space when varying its related factors. Valenti & Bacciu (2022) define the notion of *weak disentangled* representation that leaves correlated generative factors entangled and maps such combinations in different regions of the latent space. Additionally, Eastwood et al. (2023) relax the notion of disentanglement, by extending the DCI metric with an Explicitness (E) score related to the capacity required to regress the representation to its generative factors. Our metric instead measures the mutual orthogonality between subspaces associated with generative factors, bypassing the non-linearities of a generative factor and its latent subspace. For a more comprehensive understanding refer to Appendix A. ## 3 Methodology Our goal is to establish a metric that quantifies the total orthogonality of a representation. This involves estimating the orthogonality between the latent subspaces corresponding to each generative factor. However, this raises two challenges. First, the identification of the latent subspaces is not straightforward since the generative factor can exhibit non-linear behaviour with respect to the learned representation. We propose Generative Component Analysis (GCA), a procedure where, for each generative factor, multiple non-linear regressors are used to identify progressively smaller subspaces where most of the generative factor's information resides. These subspaces are then used to identify the *generative components*, that is, the set of orthonormal vectors spanning the latent subspace. In a similar fashion to procedures such as linear principal component regression, we weight the vectors by an importance score to obtain an *importance-weighted orthogonal (i.o.o)* basis, for each generative factor. Second, prominent methods for measuring orthogonality between subspaces do not provide sufficiently discriminative results for our use case. The conventional definition of orthogonal complement is binary and too restrictive for nuanced applications. Conversely, methods like canonical correlation analysis, which determine similarity between vector spaces, typically operate under optimal conditions and may assign high scores even to spaces sharing only a single dimension. These approaches, while useful, tend to be overly permissive for our specific objectives. We therefore propose *Importance-Weighted Orthogonality (IWO)* to characterize the orthogonality between generative factors. This is done by computing an average weighted projection of each generative factor's latent subspace onto all the others. ## 3.1 Generative Component Analysis (Gca) Consider a latent representation or *code*, c ∈ R L encoding the generative factors (z1*, . . . , z*K) ∈ R K with L ≥ K. Note that zj = f ∗ j (c), with f ∗ j being a potentially complex non-linear function. Not all changes in c imply a change in zj . In particular, we define the *invariant latent subspace* of zj to be the largest linear subspace Ij ⊆ R L, such that f ∗ j (c + v) = f ∗ j (c), ∀v ∈ Ij . Accordingly, the *variant latent subspace* (simply latent subspace) of zj is defined to be the orthogonal complement of Ij and will be denoted as Sj , with dimensionality Rj . In the next paragraph, we describe how to find an importance-weighted basis for Sj . Subspace learning Starting from a code c ∈ R L, we project it onto progressively smaller dimensional subspaces, removing the least important dimension for regressing zj at each step, until the subspace is 1-dimensional. In particular, we design a Linear Neural Network (LNN) composed of a set of projective transformations WL*, . . . ,*W1, which reduce the dimensionality of c step-by-step. No non-linearities are applied, therefore each layer performs a projection onto a smaller linear subspace. The entire learning process is depicted in Figure 2. At every layer of the LNN, we feed the intermediate projection wl ∈ R linto a non-linear neural network fjl. These networks are tasked with regressing zj . This approach is designed to discern the most informative latent subspace of dimensionality l, thereby guiding the selection of which latent dimension to discard in each projection step. When the training has ended, each regressor fjl can be associated with an expected loss of regressing the factor: $${\mathcal{L}}_{l}=\mathbb{E}_{\mathbf{c}}\left[\ell(f_{j l}({\boldsymbol{w}}_{l}(\mathbf{c})),z_{j}(\mathbf{c}))\right],$$ Ll = Ec [ℓ(fjl(wl(c)), zj (c))] , (1) where ℓ is a specific loss term. In particular, note that Ll−1 ≥ Ll because of the potential information loss due to dimensionality reduction. Let us now quantify the loss increment by each of the LNN projections as ∆Ll = Ll−1 − Ll. We define Rj as the smallest dimensionality at which the lowest achievable loss is reached, that is, ∆Ll = 0 for *l > R*j . For l = 1, we compute ∆L1 as the difference between L1 and a baseline loss L0 = Ezj -ℓ(Ezj [zj ] , zj ). $\left(1\right)$. ![4_image_0.png](4_image_0.png) Figure 2: **Training:** Through iterative multiplications with Wl ∈ R l×l+1, the input is projected to subspaces of decreasing dimensions. The resulting outputs wd are directed into NN heads, denoted as fj,l : R l → R. The importance αlis gauged by the loss decrease between consecutive NNs fj,l, fj,l−1. This training facilitates the optimization on lower-dimensional projections by steering them towards their optimal subspaces, ensuring that smaller subspaces are nested within larger ones. **Basis Generation:** Matrices Ql are obtained by QR-decomposition on the learned weights Wl. Basis vector projections are iteratively multiplied with Wl. The resulting vectors are normalized to form an orthonormal basis. Basis generation Using the trained weights WL*, . . . ,*W1 of the LNN, along with the layer-specific loss differences ∆Ll, we now describe how to construct an i.o.o. basis, {bl ∈ R L | l = 1*, . . . , R*j}, spanning zj 's latent subspace. Each layer Wlin the LNN eliminates a single dimension from the data representation. The adopted training methodology is structured in such a way that it ensures the dimension discarded at each layer is the least significant one for the regression of zj . This determination is based on which dimension's removal results in the minimal increase of ∆Ll+1. Therefore, a forward pass through the entire LNN effectively projects any input vector c onto the most important dimension. We let b1 span this dimension in the original representation space R L. Together with the dimensions sequentially removed between W1 and WRj we can devise an i.o.o. basis for Sj . The null space of each Wl, corresponds to the dimension removed from layer l to layer l − 1. To retrieve such dimension, in the form of a basis vector bl+1, we first perform reduced QR decomposition on all weight matrices Wl. For each resulting Ql ∈ R l×(l+1) we then define q ⊥ l ∈ R l+1, as the normalized row vector perpendicular to all rows in Ql. The basis vector bl can then be calculated as $$\mathbf{b}_{l}^{\top}=\mathbf{q}_{l-1}^{\perp}\mathbf{Q}_{l}\prod_{d=l+1}^{L}\mathbf{W}_{d}\qquad l=1,\ldots,R_{j},\tag{1}$$ with q0 = 1. We can quantify the importance αl of each basis vector bl by the relative loss increase associated to its layer in the LNN: $$\left(2\right)$$ $$\alpha_{l}=\frac{\Delta{\cal L}_{l}}{{\cal L}_{0}-{\cal L}_{R_{j}}}\qquad l=1,\ldots,R_{j}.\tag{1}$$ $$\left({3}\right)$$ Finally, we normalize each vector bl obtaining an i.o.o. basis Bj = (b1*, . . . ,* bRj ) for Sj . GCA allocates an i.o.o. basis for each generative factor of a learned representation. However, when comparing representations, we also have to account for differences in LRj , as this loss corresponds to the best possible regression of zj from the representation. In the DCI framework, this aspect is captured by the Informativeness metric. In order not to favour representations with low Rj and high LRj over those with low LRj and higher Rj , we adjust the importance weights of any factor zj whose LRj > 0. To do that, we first complete the factor's basis Bj to span the whole latent space, then we distribute the loss LRj among the importance of the basis vectors equally: $$\alpha_{l}=\frac{\Delta{\mathcal{L}}_{l}+{\mathcal{L}}_{R_{j}}/L}{{\mathcal{L}}_{0}}\qquad l=1,\ldots,L.$$ L0l = 1*, . . . , L.* (4) Lastly, we adjust Rj = L. $\left(4\right)^3$ ## 3.2 Importance Weighted Orthogonality (Iwo) Orthogonality is commonly treated as a dichotomous attribute; that is, vectors are classified as either orthogonal or non-orthogonal, and similarly, a subspace is considered to either reside in the orthogonal complement of another or not. The concept of cosine similarity provides a continuous measure of the degree of orthogonality between two vectors. Analogously, we aim at a continuous measure that evaluates the degree of orthogonality between two subspaces. Consider two orthonormal bases Bj = {b (j) 1 , . . . , b (j) Rj } and Bk = {b (k) 1*, . . . ,* b (k) Rk } spanning two subspaces Sj and Sk. Let r (jk) lbe the overall projection of Bj 's basis vector b (j) lonto all the basis vectors in Bk: $$r_{l}^{(j k)}=\sum_{m=1}^{R_{k}}(\mathbf{b}_{l}^{(j)}\cdot\mathbf{b}_{m}^{(k)})^{2}\qquad l=1,\ldots,L,\tag{1}$$ where the square is applied to guarantee non-negativity. With these projections, a continuous interpretation of orthogonality between Sj and Sk can be expressed as $$\mathrm{O}(\mathbb{S}_{j},\mathbb{S}_{k})=\frac{1}{\min(R_{j},R_{k})}\sum_{l=1}^{R_{j}}r_{l}^{(jk)}.\tag{1}$$ $$\left(5\right)$$ $$(6)$$ O(Sj , Sk) ∈ [0, 1] with its maximum reached if Sj is a subspace of Sk or vice-versa, and its minimum reached when Sk lies in the orthogonal complement of Sj . This definition of orthogonality can be interpreted as the average squared cosine similarity between any vector pair from Sj and Sk. However, when using it to gauge the orthogonality between a generative factor's latent subspaces, the importance of the basis vectors spanning the subspace is not taken into consideration. Metrics As the name suggests, in addition to encapsulating the orthogonality between factor subspaces, IWO also takes into consideration the importance of the dimensions spanning them. Let us consider K different generative factors z1*, . . . , z*K. For each one of them, we are able to allocate an i.o.o. basis Bk = {b (k) 1*, . . . ,* b (k) Rk } with the importance weights {α (k) 1*, . . . , α* (k) Rk }. For any ground truth factor zj , we define r˜ (jk) las b (j) l's projection onto the latent subspace of another ground truth factor zk, scaling the projection by the importance of the respective basis vectors: $$\tilde{r}_{l}^{(j k)}=\sum_{m=1}^{R_{k}}\sqrt{\alpha_{l}^{(j)}\alpha_{m}^{(k)}}(\mathbf{b}_{l}^{(j)}\cdot\mathbf{b}_{m}^{(k)})^{2}\qquad l=1,\ldots,L.\tag{1}$$ Analogously to subspace orthogonality, IWO is then defined using the sum over all projections r˜ (jk) lof the dimensions spanning zj 's subspace. However, in order to align IWO with commonly used disentanglement metrics, it is defined as the complement of the sum: $${\rm IWO}(z_{j},z_{k})=1-\sum_{l=1}^{R_{j}}\tilde{\tau}_{l}^{(jk)}.\tag{8}$$ $$\left(7\right)$$ Note that, with respect to Equation 6, IWO does not require a normalization factor as the square root in Equation 7 guarantees that IWO ∈ [0, 1]. In addition, we invert the orthogonality by subtracting from 1, to simplify the comparison with standard disentanglement metrics. Therefore, the maximum of 1 is reached if zj lies in the orthogonal complement of zk and vice versa. The minimum of 0 is reached when zj and zk, in addition to lying in the same subspace, also share the same importance along the same dimensions. Both Orthogonality and IWO can be efficiently calculated using matrix operations (cf. Appendix B). Together with IWO we also define *Importance Weighted Rank (IWR)* for each generative factor. IWR measures how the importance of a generative factor's subspace is distributed among the dimensions spanning it: IWR(zj ) = 1 − H(j), (9) $$\mathrm{IWR}(z_{j})=1-{\mathcal{H}}^{(j)},$$ ![6_image_0.png](6_image_0.png) ![6_image_1.png](6_image_1.png) Figure 3: Two synthetic experimental settings with L = 10, K = 5 and differing ranks R. **Left**: R = 2, each zj is a function of two successive elements of c: z1 = f(c1, c2), . . . , z5 = f(c9, c10). **Right**: R = 5, each zj is a function of five successive elements of c: z1 = f(c9, c10, c1, c2, c3) , . . . , z5 = f(c7, c8, c9, c10, c1). where H(j) = −PRj l=1 α (j) llogRj α (j) l. IWR thus measures how the importance is distributed among the L dimensions of the subspace. Note that, for a particular Rj , IWR(zj ) is minimized if the importance is distributed equally along all Rj dimensions spanning zj 's subspace. In that case, IWR(zj ) = 0. We denote the mean over all generative factors of IWO and IWR as IWO and IWR. ## 4 Experiments To evaluate the effectiveness of our IWO and IWR implementations, we first test whether we can (1) recover the true latent subspaces using GCA and (2) correctly assess their IWO and IWR. For that purpose, we set up a synthetic data generation scheme, providing us with the ground truth IWO and IWR values. For comparison purposes, we also test how other metrics assess the synthetic data, namely Disentanglement, Completeness, *Informativeness* and *Explicitness*, as measured by the DCI-ES framework. We further evaluate IWO through the *disentanglement lib* framework (Locatello et al., 2019). We measure how strong IWO and IWR correlate with downstream task performance for three different tasks deployed on the learned representations of six widely used variational autoencoder models trained on six benchmark disentanglement datasets and over a wide range of seeds and hyperparameters. More details are listed in the appendix and in our open-source code implementation1. Training of all neural networks in the LNN is performed in parallel. In principle, the gradient flow from each individual regressor fjl can be stopped after the corresponding Wl, however, we attested a faster convergence when letting the gradient of each fjl flow back up to c. The aim of simultaneously exploring all nested subspaces is to facilitate the identification of the smallest subspaces by guidance through the larger ones. Additionally, we assume a reduction factor of 1, so that Wl ∈ R l×l+1 for l = 1*, . . . , L*, however, higher values can also be considered for larger representations. ## 4.1 Synthetic Experiments We introduce a synthetic data generating scheme, which generates vectors of i.i.d Gaussian distributed latent representations c ∈ R L. Then, on the basis of the latent representations, we synthesize K generative factors {z1*, . . . , z*K}. For simplicity, we choose L as a multiple of K. For simulating a disentangled latent space, we define each zj to be linearly dependent on a single, distinct element of c. To assess higher dimensional cases with non-linear relationships, we consider a non-linear commutative mapping f : R Rj → R. In particular, we experiment with a polynomial (Poly.) and a trigonometric (Trig.) f. Notice that the commutativity enforces that the distribution is spread evenly across all dimensions, such that we can easily assess the performance of IWR(zj ). For simplicity, we always set Rj = R for all j = 1*, . . . , K*. Together, L (latent space dimension), K (number of factors) and R (latent subspace dimension) determine how many dimensions each generative factor shares with the others. We consider the shared dimensions to be contiguous. Refer to Figure 3 for intuition. To test representations that are not aligned with the canonical basis, we apply Random Orthogonal Projections (ROP) R ∈ R L×L to c. In line with commonly used datasets such as Cars3D or dSprites, we rescale and quantize zj to the range [0, 1]. 1https://anonymous.4open.science/r/iwo-32A1/README.md Table 1: Synthetic experimental results: comparison between (D) Disentanglement, (C) Completeness, (I) Informativeness, (E) Explicitness, IWO and IWR for Polynomial (Poly.) and Trigonometric (Trig.) encodings. | Experiment | L R Func ROP | D | C | I | E | IWO | IWR | | | |----------------------------------------------------------------------------------------------------------|----------------|---------|------|------|------|-------|-------|------|------| | (1) Permutation and additive Gaussian noise | 5 | 1 Noisy | ✗ | 0.98 | 0.98 | 1.00 | 0.90 | 0.98 | 1.00 | | 5 | 1 Perm. | ✗ | 0.98 | 0.98 | 1.00 | 0.90 | 0.98 | 1.00 | | | (2) Low rank + polynomial mapping | 10 2 Poly. | ✗ | 0.99 | 0.69 | 1.00 | 0.75 | 0.98 | 0.69 | | | 10 2 Poly. | ✓ | 0.21 | 0.15 | 1.00 | 0.75 | 0.98 | 0.69 | | | | 10 5 Poly. | ✗ | 0.41 | 0.30 | 1.00 | 0.74 | 0.61 | 0.31 | | | | 10 5 Poly. | ✓ | 0.06 | 0.04 | 1.00 | 0.74 | 0.61 | 0.31 | | | | (3) High rank + polynomial/trigonometric mapping | 10 5 Trig. | ✗ | 0.41 | 0.30 | 0.99 | 0.73 | 0.62 | 0.30 | | | 10 5 Trig. | ✓ | 0.06 | 0.04 | 1.00 | 0.73 | 0.62 | 0.31 | | | | 20 4 Poly. | ✗ | 0.98 | 0.53 | 0.99 | 0.76 | 0.97 | 0.54 | | | | 20 4 Poly. | ✓ | 0.12 | 0.07 | 1.00 | 0.76 | 0.97 | 0.54 | | | | 20 8 Poly. | ✗ | 0.56 | 0.30 | 0.99 | 0.74 | 0.76 | 0.31 | | | | 20 8 Poly. | ✓ | 0.05 | 0.03 | 0.99 | 0.74 | 0.76 | 0.31 | | | | 20 4 Trig. | ✗ | 0.96 | 0.52 | 0.99 | 0.73 | 0.98 | 0.53 | | | | 20 4 Trig. | ✓ | 0.12 | 0.07 | 0.99 | 0.74 | 0.98 | 0.53 | | | | 20 8 Trig. | ✗ | 0.54 | 0.29 | 0.98 | 0.71 | 0.76 | 0.31 | | | | 20 8 Trig. | ✓ | 0.07 | 0.04 | 0.98 | 0.70 | 0.76 | 0.30 | | | | (4) High rank + polynomial/trigonometric mapping (5) High dimensional latent space + poly./trig. mapping | 50 5 Poly. | ✗ | 0.98 | 0.58 | 0.98 | 0.75 | 0.99 | 0.57 | | | 50 5 Poly. | ✓ | 0.11 | 0.05 | 0.98 | 0.75 | 0.99 | 0.56 | | | | 100 5 Poly. | ✗ | 0.98 | 0.64 | 0.97 | 0.74 | 0.98 | 0.63 | | | | 100 5 Poly. | ✓ | 0.09 | 0.04 | 0.98 | 0.73 | 0.98 | 0.63 | | | | 250 5 Poly. | ✗ | 0.97 | 0.67 | 0.97 | 0.72 | 0.98 | 0.68 | | | | 250 5 Poly. | ✓ | 0.09 | 0.04 | 0.97 | 0.72 | 0.98 | 0.68 | | | All experiments are run four times with differing random seeds. The standard deviation was smaller than 0.02 for all reported values. The results are displayed in Table 1. (1) Permutation and Additive Gaussian noise: We define two setups, both with L = K = 5 and R = 1. First, we let z be a mere permutation of c, second we let z be c + ϵ, with ϵ ∼ N (0, 0.01) being Gaussian noise. The results display proficient disentanglement assessment by DCI, and near-perfect recovery in IWO and IWR. However, Explicitness deviates from the expected value of 1. (2) Low rank + polynomial mapping: We choose L = 10, K = 5 and R = 2. No dimensions are shared between the generative factors. The mapping f is polynomial. We also apply ROP in one of the experiments. We see that, as expected, applying an ROP dramatically lowers both D and C, while E, IWO and IWR are resilient to it. (3) High rank + polynomial/trigonometric mapping: We set L = 10, K = 5 and Rj = 5. Each generative factor now shares, on average, two out of five dimensions with the others. We observe that while D, C, IWO and IWR are sensitive to the shared dimensions, E is almost unchanged with respect to our second experiment. Again, IWO and IWR are recovered almost perfectly. (4) High rank + polynomial/trigonometric mapping: We set L = 20, K = 5 and vary values for R, ROP and the encoding function. Neither D, C nor E assess the orthogonality of the latent representation reliably. While E does slightly decrease for increased R, its variability due to different complexities of the encoding function overshadows this. Meanwhile, IWO and IWR assess the orthogonality and the rank of the representation almost perfectly. (5): High-dimensional latent space + polynomial/trigonometric mapping: We set, K = 5, R = 5 and vary values for L and ROP. We observe that IWO and IWR assess orthogonality reliably even for large dimensional latent spaces. ![8_image_0.png](8_image_0.png) Figure 4: Samples from a β-VAE trained on Shapes3D dataset. In each row, the same latent code is modulated along a different dimension. The reconstruction of the resulting latent codes through the decoder network is depicted. **Left**: The dimensions of modulation correspond to the most important generative components of each generative factor as found by GCA. We attest that modulation along the generative components indeed predominantly varies the respective generative factor. **Right**: The dimension of modulation corresponds to the most important dimensions for each generative factor as found by DCI. However, modulation along the dimension supposedly encoding floor color also changes azimuth and vice versa. Modulation along the dimension supposedly encoding wall color also changes floor color. The same form of entanglement goes for most other dimensions identified through the DCI framework. ## 4.2 Downstream Experiments For the systematic evaluation of IWO's and IWR's correlation with downstream task performance, we use the *disentanglement_lib* framework (Locatello et al., 2019). We consider six benchmark datasets, namely dSprites, **Color-dSprites** and **Scream-dSprites** (Matthey et al., 2017), **Cars3D** (Reed et al., 2015), SmallNorbs (LeCun et al., 2004) and **Shapes3D** (Burgess & Kim, 2018). These datasets cover a wide range of complexities and variations, for more information on the individual datasets refer to Appendix C.2. On each of these datasets, six different commonly used Variational Auto Encoder (VAE) models are trained: β**-VAE** Higgins et al. (2017), **Annealed VAE** (Burgess et al., 2018), β**-TCVAE** (Chen et al., 2018) **FactorVAE** (Kim & Mnih, 2018), **DIP-VAE-I** and **DIP-VAE-II** (Kumar et al., 2018). These models represent a diverse set of approaches to disentanglement, each introducing unique mechanisms to encourage factorized representations. For each model, we consider six different regularization strengths (cf. Appendix C.1), each with ten different random seeds, resulting in a total of 2160 learned representations. The representations are evaluated for their utility in regressing the generative factors. To this end, we consider three distinct downstream models trained on the learned representations: (i) random forest, (ii) logistic regression, and (iii) multi-layer perceptron. Correlations between downstream task performance and the commonly used metrics, DCI-D, DCI-C, and MIG, together with IWO's and IWR, are calculated throughout the considered regularization strengths. Our main objective is to investigate whether the orthogonality of a representation is indicative of the performance on a variety of downstream tasks and thus a good metric for the *utility or quality* of the representation, as elucidated by Wang & Isola (2020). The primary distinction between Orthogonality and Disentanglement, as measured by the considered metrics, is that the former does not require alignment with the canonical basis of the representation space. The three downstream models are chosen to distill this key difference. While we expect alignment with the canonical basis to benefit downstream task (i) random forest, we do not expect such a benefit for tasks (ii) logistic regression or (iii) multi-layer perceptron. In Table 2a-2b, we present the results aggregated by model and dataset respectively. We refer the reader to the complete results in Table 3 in Appendix C for a detailed breakdown of all experiments and their outcomes. Figure 4 serves as an illustrative example, visualizing the comparison between the generative components as identified by GCA and the dimensions found through the DCI framework for one of the 2160 considered representation spaces. Table 2: (a) Average correlation between metrics and down-stream task (DST) performance aggregated by model. Each model is trained on six different datasets. For each dataset six hyperparameters on ten random seeds are trained for a total of 360 learned representations per model. (b) Average correlation between metrics and down-stream task (DST) performance aggregated by dataset. For each dataset, six different VAE models are trained. For each model six hyperparameters on 10 random seeds are trained for a total of 360 learned representations per dataset. (a) Per dataset correlation aggregated by model (b) Per model correlation aggregated by dataset Model DCI-D DCI-C MIG IWO IWR AnnealedVAE 0.74 0.64 0.66 0.74 **0.82** β-TCVAE 0.66 0.63 0.64 0.78 **0.66** β-VAE 0.65 0.65 0.64 0.26 **0.83** DIP-VAE-I 0.56 **0.59** 0.52 0.43 0.40 DIP-VAE-II 0.47 0.32 0.44 0.09 **0.66** FactorVAE 0.62 0.54 0.18 **0.68** 0.61 (2) Logistic Regression AnnealedVAE 0.43 0.20 0.26 0.77 **0.85** β-TCVAE 0.13 0.06 0.13 **0.45** 0.09 β-VAE 0.18 0.19 0.16 0.44 **0.51** DIP-VAE-I **0.73** 0.63 0.59 **0.73** 0.63 DIP-VAE-II 0.07 -0.53 0.01 **0.88** 0.16 FactorVAE 0.14 -0.05 0.07 **0.71** 0.69 (3) Multi-Layer Perceptron AnnealedVAE 0.35 0.17 0.08 0.41 **0.58** β-TCVAE -0.25 -0.31 -0.28 -0.28 -0.16 β-VAE -0.14 -0.20 -0.18 **0.61** 0.20 DIP-VAE-I 0.54 0.46 0.43 **0.64** 0.56 DIP-VAE-II 0.00 0.57 0.00 **0.71** 0.08 FactorVAE -0.04 -0.19 -0.39 **0.51** 0.44 | Model | DCI-D | DCI-C | MIG | IWO | IWR | |-----------------|----------------------------|---------|-------|-------|-------| | | (1) Random Forest | | | | | | Cars3d | -0.52 | -0.59 | -0.64 | 0.63 | 0.46 | | Color DSprites | 0.73 | 0.79 | 0.69 | 0.33 | 0.77 | | DSprites | 0.94 | 0.96 | 0.94 | 0.55 | 0.79 | | Scream DSprites | 0.88 | 0.93 | 0.76 | 0.51 | 0.44 | | Shapes3D | 0.88 | 0.76 | 0.66 | 0.13 | 0.63 | | SmallNorb | 0.78 | 0.54 | 0.67 | 0.82 | 0.88 | | | (2) Logistic Regression | | | | | | Cars3d | -0.39 | -0.57 | -0.70 | 0.75 | 0.69 | | Color DSprites | 0.66 | 0.50 | 0.64 | 0.61 | 0.50 | | DSprites | 0.38 | 0.35 | 0.30 | 0.58 | 0.36 | | Scream DSprites | 0.79 | 0.55 | 0.86 | 0.86 | 0.67 | | Shapes3D | -0.30 | -0.49 | -0.61 | 0.52 | -0.06 | | SmallNorb | 0.54 | 0.17 | 0.73 | 0.65 | 0.78 | | | (3) Multi-Layer Perceptron | | | | | | Cars3d | -0.12 | -0.36 | -0.39 | 0.56 | 0.63 | | Color DSprites | -0.25 | -0.48 | -0.26 | -0.25 | -0.77 | | DSprites | 0.18 | 0.17 | 0.13 | 0.35 | 0.08 | | Scream DSprites | 0.18 | 0.01 | 0.23 | 0.59 | 0.78 | | Shapes3D | -0.38 | -0.51 | -0.66 | 0.60 | 0.05 | | SmallNorb | 0.84 | 0.52 | 0.62 | 0.77 | 0.92 | (1) Random Forest (1) Random Forest: High correlations are present for all models and datasets except for Cars3D, where the DCI and MIG metrics fail to correlate entirely. However, DCI-D correlates more reliably for the other datasets and models with the downstream task than IWO does. This can be attributed to the nature of random forests in defining axis-aligned discriminative rules. Therefore, the downstream task benefits from the alignment of the generative factors with the canonical basis. Indeed a random forest might have a harder time fitting latent space (ii) from Figure 1, than fitting latent space (iii), as in the latter, one generative factor aligns with the canonical basis. However, we also notice that DCI-C and IWR correlate even stronger than DCI-D and IWO do. This suggests that random forests benefit even more significantly from low-dimensional representations of generative factors than from their alignment with the canonical basis. (2) Logistic Regression: For logistic regression, where ℓ2-regularization is applied to the weights, there is no reason to assume that alignment between generative factors and canonical basis should lead to higher downstream task performance. Indeed, we can see that IWO and IWR correlate higher and more reliably than DCI or MIG do. This leads us to assume that measuring the orthogonality detached from canonical basis alignment provides a better metric for the evaluation of downstream logistic regression. (3) Multi-layer Perceptron: A similar behavior can be attested when fitting a multi-layer perceptron, initialized using Kaiming uniform initialization (He et al., 2015). There is, again, no reason to assume that alignment with the canonical basis would be beneficial. Indeed, we see that neither DCI-D, DCI-C nor MIG correlate reliably. IWO and IWR correlate reliably with this downstream task, except for the β-TCVAE model and the Color-DSprites dataset. ## 5 Discussion And Conclusions In our investigation, we pivoted from the conventional focus on the disentanglement of generative factors to a novel examination of their orthogonality. Our approach, geared towards accommodating non-linear behaviors within linear subspaces tied to generative factors, fills a gap in existing literature, as no prior method aptly addressed this perspective. The proposed Generative Component Analysis (GCA) efficiently identifies the generative factor subspaces and their importance. Leveraging GCA, we formulated Importance-Weighted Orthogonality (IWO), a novel metric offering unique insights into subspace orthogonality. Throughout experiments, our implementation emerged as a robust mechanism for assessing orthogonality, exhibiting resilience across varying latent shapes, non-linear encoding functions, and degrees of orthogonality. Disentanglement has long been credited for fostering fairness, interpretability, and explainability in generated representations. However, as pointed out by Locatello et al. (2019), the utility of disentangled representations invariably hinges on at least partial access to generative factors. With such access, an orthogonal subspace could be rendered as useful as a disentangled one. Through orthonormal projection, any orthogonal representation discovered can be aligned with the canonical basis, achieving good disentanglement. In conjunction with IWO's stronger downstream task correlation across datasets, models and tasks, this underscores our assertion that latent representations, which successfully decouple generative factors, are crucial for a wide range of downstream applications, regardless of their alignment with the canonical basis. In conclusion, our work lays the groundwork for a fresh perspective on evaluating generative models. We hope GCA and IWO may help identify models crafting useful orthogonal subspaces, which might have been overlooked under the prevailing disentanglement paradigm. We hope that IWO extends its applicability across a broader spectrum of scenarios compared to traditional disentanglement measures. ## References Yoshua Bengio, Aaron C. Courville, and Pascal Vincent. Representation learning: A review and new perspectives. *IEEE Trans. Pattern Anal. Mach. Intell.*, 35(8):1798–1828, 2013. Chris Burgess and Hyunjik Kim. 3d shapes dataset. https://github.com/deepmind/3dshapes-dataset/, 2018. Christopher P. Burgess, Irina Higgins, Arka Pal, Loïc Matthey, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in beta-vae. *CoRR*, abs/1804.03599, 2018. Hugo Caselles-Dupré, Michaël Garcia Ortiz, and David Filliat. Symmetry-based disentangled representation learning requires interaction with environments. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 4608–4617, 2019. Tian Qi Chen, Xuechen Li, Roger B. Grosse, and David Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems, NeurIPS, 2018. Raphaël Couronné, Paul Vernhet, and Stanley Durrleman. Longitudinal self-supervision to disentangle inter-patient variability from disease progression. In Proc. International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI), pp. 231–241. Springer, 2021. Andrea Dittadi, Frederik Träuble, Francesco Locatello, Manuel Wuthrich, Vaibhav Agrawal, Ole Winther, Stefan Bauer, and Bernhard Schölkopf. On the transfer of disentangled representations in realistic settings. In *9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May* 3-7, 2021. OpenReview.net, 2021. Cian Eastwood and Christopher K. I. Williams. A framework for the quantitative evaluation of disentangled representations. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. Cian Eastwood, Andrei Liviu Nicolicioiu, Julius von Kügelgen, Armin Kekic, Frederik Träuble, Andrea Dittadi, and Bernhard Schölkopf. DCI-ES: an extended disentanglement framework with connections to identifiability. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023. Yuchen Fei, Bo Zhan, Mei Hong, Xi Wu, Jiliu Zhou, and Yan Wang. Deep learning-based multi-modal computing with feature disentanglement for MRI image synthesis. *Medical Physics*, 48(7):3778–3789, 2021. Xu Han, Zhengyang Shen, Zhenlin Xu, Spyridon Bakas, Hamed Akbari, Michel Bilello, Christos Davatzikos, and Marc Niethammer. A deep network for joint registration and reconstruction of images with pathologies. In *Machine Learning in Medical Imaging: 11th International Workshop (MLMI)*, pp. 342–352, 2020. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing humanlevel performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015. Irina Higgins, Loïc Matthey, Arka Pal, Christopher P. Burgess, Xavier Glorot, Matthew M. Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In *5th International Conference on Learning Representations, ICLR*, 2017. Irina Higgins, David Amos, David Pfau, Sébastien Racanière, Loïc Matthey, Danilo J. Rezende, and Alexander Lerchner. Towards a definition of disentangled representations. *CoRR*, abs/1812.02230, 2018. John Kalkhof, Camila González, and Anirban Mukhopadhyay. Disentanglement enables cross-domain hippocampus segmentation. *preprint arXiv:2201.05650*, 2022. Varun A Kelkar and Mark A Anastasio. Prior image-based medical image reconstruction using a style-based generative adversarial network. *preprint arXiv:2202.08936*, 2022. Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In *Proceedings of the 35th International* Conference on Machine Learning, ICML, 2018. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. *arXiv preprint* arXiv:1412.6980, 2014. Abhishek Kumar, Prasanna Sattigeri, and Avinash Balakrishnan. Variational inference of disentangled latent concepts from unlabeled observations. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. Yann LeCun, Fu Jie Huang, and Leon Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In Proceedings of the 2004 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2004. CVPR 2004., volume 2, pp. II–104. IEEE, 2004. Hongwei Li, Sunita Gopal, Anjany Sekuboyina, Jianguo Zhang, Chen Niu, Carolin Pirkl, Jan Kirschke, Benedikt Wiestler, and Bjoern Menze. Unpaired MR image homogenisation by disentangled representations and its uncertainty. In Uncertainty for Safe Utilization of Machine Learning in Medical Imaging, and Perinatal Imaging, Placental and Preterm Image Analysis. Springer International Publishing, 2021. Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In *international conference on machine learning*, pp. 4114–4124. PMLR, 2019. Loic Matthey, Irina Higgins, Demis Hassabis, and Alexander Lerchner. dsprites: Disentanglement testing sprites dataset. https://github.com/deepmind/dsprites-dataset/, 2017. Milton Llera Montero, Casimir J. H. Ludwig, Rui Ponte Costa, Gaurav Malhotra, and Jeffrey S. Bowers. The role of disentanglement in generalisation. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. Matthew Painter, Adam Prügel-Bennett, and Jonathon S. Hare. Linear disentangled representations and unsupervised action estimation. In *Advances in Neural Information Processing Systems 33: Annual* Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. Abbavaram Gowtham Reddy, Benin Godfrey L, and Vineeth N. Balasubramanian. On causally disentangled representations. In Thirty-Sixth AAAI Conference on Artificial Intelligence, AAAI 2022, Thirty-Fourth Conference on Innovative Applications of Artificial Intelligence, IAAI 2022, The Twelveth Symposium on Educational Advances in Artificial Intelligence, EAAI 2022 Virtual Event, February 22 - March 1, 2022, pp. 8089–8097. AAAI Press, 2022. Scott E Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep visual analogy-making. Advances in neural information processing systems, 28, 2015. Karl Ridgeway and Michael C. Mozer. Learning deep disentangled embeddings with the f-statistic loss. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 185–194, 2018. Raphael Suter, Djordje Miladinovic, Bernhard Schölkopf, and Stefan Bauer. Robustly disentangled causal mechanisms: Validating deep representations for interventional robustness. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of *Proceedings of Machine Learning Research*, pp. 6056–6065. PMLR, 2019. Fan Tang, Xinyu Zhu, Jinrong Hu, Juhong Tie, Jiliu Zhou, and Ying Fu. Generative adversarial unsupervised image restoration in hybrid degradation scenes. 2022. Loek Tonnaer, Luis Armando Pérez Rey, Vlado Menkovski, Mike Holenderski, and Jim Portegies. Quantifying and learning linear symmetry-based disentanglement. In *International Conference on Machine Learning,* ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 21584–21608. PMLR, 2022. Frederik Träuble, Elliot Creager, Niki Kilbertus, Francesco Locatello, Andrea Dittadi, Anirudh Goyal, Bernhard Schölkopf, and Stefan Bauer. On disentangled representations learned from correlated data. In *Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021,* Virtual Event, volume 139 of *Proceedings of Machine Learning Research*, pp. 10401–10412. PMLR, 2021. Andrea Valenti and Davide Bacciu. Leveraging relational information for learning weakly disentangled representations. In International Joint Conference on Neural Networks, IJCNN 2022, Padua, Italy, July 18-23, 2022, pp. 1–8. IEEE, 2022. Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In *International conference on machine learning*, pp. 9929–9939. PMLR, 2020. Lei Zhou, Joseph Bae, Huidong Liu, Gagandeep Singh, Jeremy Green, Amit Gupta, Dimitris Samaras, and Prateek Prasanna. Lung swapping autoencoder: Learning a disentangled structure-texture representation of chest radiographs. *preprint arXiv:2201.07344*, 2022. ![13_image_0.png](13_image_0.png) Figure 5: Four configurations of a 3-dimensional latent space. The planes represent the latent subspace where generative factors z1, z2 lie. The color mapping on each subspace represents the relationship between the generative factor and the latent components (*e.g.*, blue indicating large values for z1, red indicating low ones). Cases (i) and (ii) are characterized by a good explicitness score as both subspaces encode z1 and z2 as simple quadratic functions, contrary to cases (iii) and (iv) where the relationship is trigonometric and more complex to recover. In contrast, cases (i) and (iii) are characterized by a better IWO score compared to (ii) and (iv). Indeed, in configurations (i) and (iii), there are dimensions within each generative factor's subspace that are orthogonal to one another. Consequently, any variation along any such dimension will leave the other factor unchanged. ## A Explicitness Vs Iwo The Explicitness (E) metric aims to evaluate the capacity needed for a representation to regress its generative factors. Formally, $$E(z_{j},{\bf c};{\cal F})=1-\frac{\mathrm{AULC}(z_{j},{\bf c};{\cal F})}{Z(z_{j};{\cal F})},$$ $$(10)^{\frac{1}{2}}$$ where zj and c represent a generative factor and the latent space respectively, and F a class of regressors (*e.g.*, multilayer perceptrons or random forests). AULCC is the Area Under the Loss Curve, computed by recording the minimum losses achievable by regressing zj from c with models in F of increasing capacity. The denominator, easily computable, acts as a normalizing constant so that E ∈ [0, 1]. As an example, E = 1 suggests that a linear regressor is sufficient to reach zero error, proving that the representation is efficient. To account for a bias toward large representations, the explicitness is paired with the Size (S), computed as the ratio between the number of generative factors and the size of the latent representation. In Figure 5, we depict four situations of a 3-dimensional latent space where two generative factors z1, z2 lie in a separate 2-dimensional plane each, and the relationship between each generative factor and its corresponding latent subspace is non-linear, as hinted by the coloring. In particular, z (n) j = f (n)(c ′) = f (n)(P (n) jc), for j ∈ {1, 2} and n ∈ {*i, ii, iii, iv*}, with P (n) j ∈ R 2×3 being a projection matrix. For cases (i) and (iii), the projections span orthogonal planes, contrarily to cases (ii) & (iv) where the planes have a different inclination. Case (i) & (ii) are characterized by a quadratic relationship, *i.e.*, f (n) = A(c ′ 1 ) 2 + B(c ′ 2 ) 2(with A, B being parameters), while case (iii) and (iv) encode a trigonometric relationship, *i.e.*, f (n) = cos(2πλc′1 ) + cos(2πλc′2 ) (with λ being a parameter). Explicitness evaluates the capacity required by a model to regress the generative factors z1, z2, starting from the representation c. Given that the effect of the linear transformation is present in all four situations, the differences are determined only by the non-linearity f (n). Therefore the metric is able to discriminate cases (i) & (ii) from (iii) & (iv). Instead, IWO quantifies the orthogonality of the planes, regardless of the non-linearities in the generative factors, so it discriminates the orthogonal cases (i) & (iii) from the non-orthogonal ones (ii) & (iv). Finally, note that the DCI-Disentanglement metric would penalize all four configurations as they are not disentangled. ## B Efficient Iwo Calculation For the efficient calculation of Orthogonality, consider two matrices Bj ∈ R Rj×L, Bk ∈ R Rk×L whose rows compose the i.o.o. basis vectors spanning zj 's and zk's latent subspaces respectively. We define the orthogonality between the two latent subspaces in terms of these matrices as: $$\mathrm{O}(\mathbb{S}_{j},\mathbb{S}_{k})={\frac{\mathrm{Tr}(\mathbf{B}_{j}\mathbf{B}_{k}^{\top}\mathbf{B}_{k}\mathbf{B}_{j}^{\top})}{\operatorname*{min}(R_{j},R_{k})}}.$$ $$(11)$$ min(Rj , Rk). (11) Note that the trace Tr(BjB⊤ k BkB⊤ j ) equals the sum of the squared values in BjB⊤ k , i.e.,Pl,m(BjB⊤ k ) 2 ml = Pl,m(bjl · bkm) 2, where bjl and bkm are the l-th and m-th rows of Bj and Bk respectively. The maximum of the trace is therefore min(Rj , Rk), reached if Sj is a subspace of Sk or vice-versa. This definition of orthogonality can be interpreted as the average absolute cosine similarity between any vector pair from Sj and Sk. To efficiently calculate the importance-weighted projection of zj 's subspace onto zk's subspace, we first scale the corresponding bases vectors in Bj , Bk with their respective importance before projecting them onto one another. IWO is the sum of all individual projections. Using Uj = DjBj , where Dj ∈ R Rj×Rjis diagonal with the l-th diagonal entry corresponding to the square root of importance, pαl(zj ), we can efficiently calculate IWO as: $$\mathrm{IWO}(z_{j},z_{k})=1-\mathrm{Tr}(\mathbf{U}_{j}\mathbf{U}_{k}^{\top}\mathbf{U}_{k}\mathbf{U}_{j}^{\top})$$ $$(12)^{\frac{1}{2}}$$ ) (12) ## C Experimental Details In this section, we provide a detailed description of the correlation analysis of our orthogonality metric with downstream tasks on six different datasets and six different models listed in 3. For each model, learned representations for six different regularization strengths are considered (ten different random seeds for each reg. strength). All these representations are directly retrieved from or trained with the code of disentanglement lib2. For the ES metric, we utilized the official codebase provided by the authors of DCI-ES 3. Each dataset we investigate has independent generative factors associated with it. ## C.1 Hyperparameters The hyperparameters considered for each model are the following: - β**-VAE** (Higgins et al., 2017): with β ∈ {1, 2, 4, 6, 8, 16} - **Annealed VAE** (Burgess et al., 2018): with cmax ∈ {5, 10, 25, 50, 75, 100} - β**-TCVAE** (Chen et al., 2018): with β ∈ {1, 2, 4, 6, 8, 10} - **Factor-VAE** (Kim & Mnih, 2018): with γ ∈ {10, 20, 30, 40, 50, 100} - **DIP-VAE-I** (Kumar et al., 2018): with λod ∈ {1, 2, 5, 10, 20, 50} - **DIP-VAE-II** (Kumar et al., 2018): with λod ∈ {1, 2, 5, 10, 20, 50} 2https://github.com/google-research/disentanglement_lib/tree/master 3https://github.com/andreinicolicioiu/DCI-ES Table 3: Individual correlations between metrics and downstream task (DST) performance. Each model is trained on six different datasets. For each dataset, six different hyperparameters on 10 random seeds are trained for a total of 2160 learned representations. Correlations between downstream task performance and the three commonly used metrics DCI-D, DCI-C and MIG together with IWO and IWR are calculated. Correlations are calculated between averaged task performance and averaged metrics, where the average is taken over the seeds and grouped by hyperparameter. As such, we assess the capability of the metrics to point us to good models and hyperparameters. | Random Forest | Logistic Regression | Neural Network | | | | | | | | | | | | | | |----------------------------------------|-----------------------|------------------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | D | C | MIG | IWO | IWR | D | C | MIG | IWO | IWR | D | C | MIG | IWO | IWR | | | AnnealedVAE | 0.72 | -0.18 | -0.19 | 0.74 | 0.69 | -0.40 | -0.85 | -0.82 | 0.84 | 0.89 | 0.25 | -0.36 | -0.33 | 0.98 | 0.97 | | β-TCVAE | -0.92 | -0.91 | -0.91 | 0.80 | 0.11 | -0.94 | -0.97 | -0.90 | 0.75 | -0.15 | 0.06 | -0.04 | 0.16 | -0.48 | -0.90 | | β-VAE | -0.92 | -0.94 | -0.93 | 0.67 | 0.80 | -0.93 | -0.95 | -0.92 | 0.60 | 0.91 | -0.66 | -0.67 | -0.67 | 0.22 | 0.82 | | Cars3D DIP-VAE-I | -0.84 | -0.77 | -0.61 | -0.09 | -0.18 | 0.61 | 0.39 | -0.10 | 0.68 | 0.73 | -0.07 | -0.32 | -0.50 | 0.98 | 0.99 | | DIP-VAE-II | -0.89 | -0.96 | -0.76 | 0.90 | 0.59 | -0.49 | -0.72 | -0.74 | 0.74 | 0.83 | -0.49 | -0.70 | -0.49 | 0.67 | 0.94 | | FactorVAE | -0.26 | -0.17 | -0.81 | 0.78 | 0.74 | -0.17 | -0.31 | -0.71 | 0.91 | 0.91 | 0.22 | -0.08 | -0.49 | 0.97 | 0.98 | | 1.00 | 1.00 | 0.98 | 0.97 | 0.97 | 0.86 | 0.85 | 0.90 | 0.91 | 0.94 | -0.80 | -0.80 | -0.82 | -0.86 | -0.85 | | | β-TCVAE | 0.99 | 0.99 | 1.00 | 0.78 | 0.97 | 0.44 | 0.54 | 0.45 | 0.70 | 0.55 | -0.81 | -0.89 | -0.85 | -0.68 | -0.86 | | β-VAE | 0.98 | 0.99 | 1.00 | -0.80 | 0.76 | 0.69 | 0.85 | 0.80 | -0.45 | 0.93 | -0.67 | -0.85 | -0.78 | 0.32 | -0.95 | | DIP-VAE-I | 0.46 | 0.39 | 0.61 | 0.96 | 0.94 | 0.73 | 0.68 | 0.70 | 0.78 | 0.63 | 0.89 | 0.91 | 0.75 | 0.04 | -0.18 | | DIP-VAE-II | 0.07 | 0.50 | -0.07 | -0.73 | 0.26 | 0.37 | -0.78 | 0.39 | 0.90 | -0.81 | 0.71 | -0.45 | 0.73 | 0.50 | -0.92 | | FactorVAE | 0.91 | 0.85 | 0.63 | 0.81 | 0.75 | 0.86 | 0.86 | 0.62 | 0.82 | 0.72 | -0.79 | -0.80 | -0.60 | -0.80 | -0.87 | | Color DSpritesAnnealedVAE AnnealedVAE | 0.99 | 0.99 | 0.97 | 0.89 | 0.89 | 0.84 | 0.82 | 0.85 | 0.87 | 0.87 | 0.47 | 0.45 | 0.54 | 0.73 | 0.72 | | β-TCVAE | 1.00 | 0.99 | 0.99 | 0.92 | 0.97 | 0.37 | 0.38 | 0.25 | 0.66 | 0.54 | -0.14 | -0.18 | -0.25 | 0.07 | 0.03 | | β-VAE | 0.98 | 0.99 | 0.97 | 0.75 | 0.96 | 0.03 | 0.07 | 0.01 | -0.18 | 0.02 | -0.04 | -0.06 | 0.02 | 0.40 | 0.08 | | DSprites DIP-VAE-I | 0.96 | 0.96 | 0.94 | 0.28 | 0.11 | 0.80 | 0.79 | 0.77 | 0.44 | 0.35 | 0.91 | 0.91 | 0.90 | -0.10 | -0.22 | | DIP-VAE-II | 0.77 | 0.88 | 0.80 | -0.33 | 0.93 | -0.20 | -0.46 | -0.43 | 0.69 | -0.59 | -0.92 | -1.00 | -0.92 | 0.14 | -0.98 | | FactorVAE | 0.96 | 0.94 | 0.96 | 0.81 | 0.86 | 0.43 | 0.48 | 0.35 | 0.99 | 0.98 | 0.79 | 0.93 | 0.49 | 0.86 | 0.84 | | 0.84 | 0.79 | 0.85 | 0.86 | 0.87 | 0.92 | 0.85 | 0.95 | 0.92 | 0.91 | 0.81 | 0.86 | 0.71 | 0.84 | 0.84 | | | β-TCVAE | 0.91 | 0.98 | 0.90 | 0.32 | -0.12 | 0.93 | 0.83 | 0.94 | 0.65 | -0.46 | -0.88 | -0.75 | -0.89 | -0.78 | 0.37 | | β-VAE | 0.94 | 0.97 | 0.96 | 0.53 | 0.54 | 0.86 | 0.83 | 0.89 | 0.78 | 0.79 | 0.17 | 0.13 | 0.23 | 0.87 | 0.90 | | DIP-VAE-I | 0.79 | 1.00 | 0.28 | 0.68 | 0.78 | 0.83 | 0.50 | 0.94 | 0.95 | 0.89 | 0.86 | 0.61 | 0.89 | 0.98 | 0.94 | | DIP-VAE-II | 0.93 | 0.92 | 0.81 | 0.42 | 0.46 | 0.53 | 0.13 | 0.76 | 0.99 | 1.00 | 0.49 | 0.03 | 0.72 | 0.99 | 0.99 | | FactorVAE | 0.87 | 0.92 | 0.80 | 0.23 | 0.11 | 0.65 | 0.14 | 0.68 | 0.79 | 0.89 | -0.38 | -0.79 | -0.30 | 0.66 | 0.64 | | Scream DSpritesAnnealedVAE AnnealedVAE | 0.95 | 0.62 | 0.21 | 0.91 | 0.96 | 0.60 | -0.13 | -0.51 | 0.91 | 0.83 | 0.87 | 0.45 | -0.01 | 0.97 | 1.00 | | β-TCVAE | 1.00 | 0.99 | 0.93 | 0.90 | 0.96 | -0.91 | -0.93 | -0.96 | -0.87 | -0.87 | -0.64 | -0.68 | -0.83 | -0.69 | -0.60 | | β-VAE | 0.99 | 0.97 | 0.86 | -0.57 | 0.92 | -0.53 | -0.62 | -0.80 | 0.94 | -0.55 | -0.57 | -0.66 | -0.84 | 0.92 | -0.63 | | Shapes3D DIP-VAE-I | 1.00 | 1.00 | 0.95 | -0.24 | -0.24 | 0.46 | 0.45 | 0.32 | 0.57 | 0.25 | -0.33 | -0.34 | -0.41 | 0.96 | 0.82 | | DIP-VAE-II | 0.99 | 0.99 | 0.97 | -0.74 | 0.74 | -0.63 | -0.78 | -0.83 | 0.98 | -0.44 | -0.73 | -0.86 | -0.90 | 0.97 | -0.56 | | FactorVAE | 0.35 | -0.02 | 0.03 | 0.49 | 0.44 | -0.80 | -0.96 | -0.90 | 0.59 | 0.43 | -0.85 | -0.98 | -0.96 | 0.45 | 0.27 | | β-TCVAE | 0.97 | 0.76 | 0.98 | 0.94 | 0.99 | 0.86 | 0.53 | 0.97 | 0.78 | 0.92 | 0.93 | 0.64 | 1.00 | 0.89 | 0.99 | | SmallNorbAnnealedVAE | -0.04 | 0.28 | 0.77 | 0.09 | 0.56 | -0.26 | -0.37 | 0.21 | 0.14 | 0.68 | 0.50 | 0.42 | 0.38 | -0.17 | 0.80 | | β-VAE | 0.92 | 0.93 | 0.97 | 0.97 | 1.00 | 0.97 | 0.96 | 0.96 | 0.93 | 0.97 | 0.93 | 0.94 | 0.97 | 0.97 | 0.99 | | DIP-VAE-I | 1.00 | 0.98 | 0.95 | 0.97 | 0.98 | 0.97 | 0.94 | 0.91 | 0.93 | 0.94 | 0.99 | 0.98 | 0.96 | 0.97 | 0.98 | | DIP-VAE-II | 0.91 | -0.44 | 0.88 | 1.00 | 0.99 | 0.85 | -0.56 | 0.90 | 0.99 | 0.98 | 0.93 | -0.45 | 0.86 | 1.00 | 1.00 | | FactorVAE | 0.89 | 0.73 | -0.55 | 0.95 | 0.79 | -0.14 | -0.51 | 0.40 | 0.13 | 0.18 | 0.77 | 0.59 | -0.47 | 0.94 | 0.77 | ## C.2 Datasets DSprites Dataset The DSprites dataset is a collection of 2D shape images procedurally generated from six independent latent factors. These factors are color (white), shape (square, ellipse, heart), scale, rotation, and x and y positions of a sprite. Each possible combination of these latents is present exactly once, resulting in a total of 737280 unique images. Color DSprites Dataset This dataset retains the fundamental characteristics of the original DSprites dataset, with the distinct variation that each sprite, in the observation sampling process, is rendered in a color determined by random selection. Scream DSprites Dataset The dataset mirrors the original DSprites dataset but introduces a unique modification in the observation sampling process: A random segment from the Scream image is selected as the background, and the sprite is integrated into this image by inverting the color of the chosen segment specifically at the sprite's pixel locations. Cars3D Dataset The Cars3D dataset is generated from 3D computer-aided design (CAD) models of cars. It consists of color renderings of 183 car models from 24 rotation angles, each offset by 15 degrees, and from 4 different camera elevations. The images are rendered at a resolution of 64 × 64. smallNORB Dataset The smallNORB dataset is designed for 3D object recognition from shape, featuring images of 50 toys categorized into five types: four-legged animals, human figures, airplanes, trucks, and cars. The images were captured under six lighting conditions, nine elevations, and 18 different angles. The dataset is split into a training set with five instances of each category and a test set with the remaining five instances. Shapes3D Dataset The Shapes3D dataset, initially presented in Kim & Mnih (2018) is a specialized collection designed for the study of factorized variations in 3D object representation. This dataset is characterized by its systematic variation across six ground-truth factors, making it particularly suitable for experiments in disentanglement and representation learning. These factors include floor color with 10 variations, wall color also with 10 variations, object color featuring 10 distinct options, object size represented in 8 different scales, object type with 4 unique categories, and azimuth with 15 varied positions. Such a diverse range of factors allows for comprehensive analysis and experimentation in 3D object recognition and disentanglement tasks. The dataset is thoughtfully split into a training set and a test set, each containing a balanced mix of these variations to facilitate robust model training and evaluation. ## C.3 Iwo On Limited Data To assess the impact of smaller sample sizes on IWO and IWR's correlation with downstream task performance, we repeat the experiments detailed in Section 4.2 for the smallNORB dataset, but with only 50% and 10% of the data. The results are illustrated in Table 4. We observe that IWO and IWR are resilient to changes in dataset size. ## C.4 Iwo Training Given a learned representation of a dataset, we consider each generative factor independently, allocating separate LNNs respectively. On top of the LNNs, we have NN heads, which regress the generative factors from the intermediate projections. The NN heads are also independent from one another and do not share any weights. ## C.4.1 Implementation Details We use the PyTorch Lightning framework4for the implementation of the models required to discern IWO and IWR. In particular, we use PyTorch Lightning implementations of Linear layers and Batch-Normalization Layers. Whereas the setup of the LNN is equal for all models and datasets, the NN-heads vary in their complexity for different datasets 4https://github.com/Lightning-AI/lightning Table 4: Correlation coefficients between IWO, IWR, DCI-D, DCI-C, MIG and the downstream task of recovering the generative factors with Logistic Regression and Boosted Trees. Examined Latent representations of small Norb dataset as learned by models: Annealed VAE (A-VAE), β-VAE, β-TCVAE and Factor-VAE (F-VAE) on 100%, 50% and 10% of the dataset | IWO | | | IWR | | | |---------|---------------------|----------|------------|--------|------| | | Random | Logistic | Random | | | | Model | Logistic Regression | Forest | Regression | Forest | | | A-VAE | 0.14 | 0.09 | 0.68 | 0.56 | | | β-VAE | 0.93 | 0.97 | 0.97 | 1.00 | | | 100% | β-TCVAE | 0.78 | 0.94 | 0.92 | 0.99 | | F-VAE | 0.13 | 0.95 | 0.18 | 0.79 | | | β-VAE | 0.20 | 0.02 | 0.43 | 0.75 | | | A-VAE | 0.97 | 0.98 | 0.97 | 1.00 | | | 50% | β-TCVAE | 0.82 | 0.95 | 0.94 | 0.99 | | F-VAE | 0.13 | 0.72 | -0.09 | 0.95 | | | A-VAE | -0.02 | -0.30 | 0.50 | 0.31 | | | 10% | β-VAE | 0.94 | 0.99 | 0.96 | 0.99 | | β-TCVAE | 0.87 | 0.95 | 0.92 | 1.00 | | | F-VAE | 0.32 | 0.56 | 0.12 | 0.58 | | and factors. As all considered models operate with a 10-dimensional latent space, each LNN has ten layers. The output of each LNN layer is fed to the next layer and also to the corresponding NN-head. Table 5 holds the NN head configuration per dataset and factor. These were found using a simple grid search on one randomly selected learned representation. This is necessary as factors vary in complexity and so does the required capacity to regress them. It is worth mentioning, that the Explicitness pipeline, as proposed by Eastwood et al. (2023), could actually be employed on top of the NN-heads, integrating both metrics. For the initialization of the LNN layers and the NN heads, we use Kaiming uniform initialization as proposed in He et al. (2015). We further use the Adam optimization scheme as proposed by Kingma & Ba (2014) with a learning rate of 5 × 10−4and a batch size of 128 for all optimizations. Data is split into a training (80%) and a test set (20%). During training, part of the training set is used for validation, which is in turn used as an early stopping criterion. The importance scores used for IWO should be allocated using the test set. In our experiments, the difference between the importance scores computed on the training set and the test set was small. For further details on the implementation, please refer to our official code 5. ## D Importance Analysis In order to test the effectiveness of IWO and IWR's importance weighing, we compare their downstream task correlation with the downstream task correlation of pure orthogonality (without any weighing). Table 6 holds the results of the correlation analysis. We can see, perhaps unsurprisingly, that the importance of weighing plays an important role in why IWO and IWR can serve as representation quality metrics, whereas orthogonality might be a questionable contender at best. ## E Loss Analysis In Figure 6 we depict the loss of neural network heads at different projection steps for a single run of synthetic experiment 3 (L = 10, K = 5 and Rj = 5). L6 to L10 are omitted, as they are almost zero (similar to L5). Each generative factor is analysed using GCA, which means for each generative factor we train an LNN spine with 9 matrices W9 ∈ R 9×10... W1 ∈ R 1×2and 10 NN heads acting on the projections. Because of the symmetry of the synthetic experiments, all five generative factors are similarly encoded in the latent space. In Figure 6 we are therefore depicting the mean and standard deviation over the generative factors. An entire pass through each LNN projects the 5https://anonymous.4open.science/r/iwo-E0C6/README.md | Dataset | Factor | Layer dimensions Batch Norm Factor Discrete | | | |------------------------------|---------------|-----------------------------------------------|----|----| | Shape | 256, 256 | ✗ | ✓ | | | Scale | 256, 256 | ✗ | ✗ | | | Rotation | 512, 512, 512 | ✗ | ✗ | | | x-position | 256, 256 | ✗ | ✗ | | | y-position | 256, 256 | ✗ | ✗ | | | DSprites | model | 256, 256, 256 | ✗ | ✓ | | Cars3D | rotation | 256, 256, 256 | ✗ | ✗ | | elevation | 256, 256, 256 | ✗ | ✗ | | | category | 256, 256 | ✓ | ✓ | | | lightning condition 256, 256 | ✓ | ✗ | | | | Small Norb elevation | 256, 256 | ✓ | ✗ | | | rotation | 256, 256 | ✓ | ✗ | | | Shapes3D | Floor color | 128, 128 | ✗ | ✓ | | Wall color | 128, 128 | ✗ | ✓ | | | Object Color | 128, 128 | ✗ | ✓ | | | Object Size | 128, 128 | ✗ | ✗ | | | Object Type | 128, 128 | ✗ | ✓ | | | Azimuth | 128, 128 | ✗ | ✗ | | Table 5: Implementation Details for neural network heads operating on LNN layers. For each factor, ten NN heads with the specified number of hidden layers and their respective dimensions are trained in parallel. | | Random Forest | Logistic Regression | | | | | |-------------|-----------------|-----------------------|-------|------|------|------| | Model | IWO | IWR | O | IWO | IWR | O | | AnnealedVAE | 0.74 | 0.82 | 0.53 | 0.77 | 0.85 | 0.60 | | β-TCVAE | 0.78 | 0.66 | 0.12 | 0.45 | 0.09 | 0.02 | | β-VAE | 0.26 | 0.83 | -0.03 | 0.44 | 0.51 | 0.09 | | DIP-VAE-I | 0.43 | 0.40 | 0.30 | 0.73 | 0.63 | 0.18 | | DIP-VAE-II | 0.09 | 0.66 | -0.27 | 0.88 | 0.16 | 0.64 | | FactorVAE | 0.68 | 0.61 | 0.59 | 0.71 | 0.69 | 0.56 | Table 6: Average correlation between metrics and downstream task. Comparison between IWO, IWR and unweighted orthogonality (O) representation to the most informative dimension for the respective generative factor. When recovering the generative factor from that projection, we incur a loss of L1. The fraction L1/L0 tells us that this is ≈ 20% better than naive guessing (assuming the expectation value) of the factor. We see that we can almost perfectly recover the generative factors from projections to 5 and more dimensions. This is expected as the experiment is set up with Rj = 5. We see that each subsequently removed dimension increases the loss by ≈ 20%. It follows that ∆Ll/L0 ≈ 0.2, i.e. αl ≈ 0.2 for 1 ≤ l ≤ 5. The right-hand side of Figure 6 depicts the relative validation loss of the NN heads during training. The relative loss at the 72nd iteration corresponds to the relative loss depicted in the left plot. ## F Computational Resources Analysis This section details the computational resources utilized for evaluating DCI, IWO and IWR, specifically applied to the smallNORB dataset from *disentanglement lib* using a β-VAE framework. For the GCA model specifications please refer to section C.4.1 ## F.1 Experimental Setup - **Data:** Learned representations of a β-VAE trained on the smallNORB dataset from the *disentanglement_lib* ![19_image_0.png](19_image_0.png) Figure 6: Loss of neural network heads at different projection steps for a single run of synthetic experiment 3 (L = 10, K = 5 and Rj = 5). We only depict L5 to L1, as L6 to L10 are almost zero (similar to L5). **Left:** Magnitude of relative loss after convergence for different projection depths. **Right:** Loss evolution over training iterations. - **Objective 1:** Assess the orthogonality of 60 learned representations, by performing GCA and calculating IWO/IWR. Note that the computational resources for the calculation of IWO/IWR are negligible compared to GCA. - **Objective 2:** Assess the disentanglement of 60 learned representations, by computing the DCI metric. ## F.2 Resource Utilization In Table 7, we list the computational resources used for each run of GCA. Table 7: Average resource utilization for each run of the GCA + IWO pipeline. No GPU was used. | Resource | Usage | |--------------------------------------------------------|---------| | Process Memory | 400 MB | | CPU Process Utilization 50% GPU Process Utilization 0% | | ## F.3 Runtime Analysis - **GCA Average Duration:** 7 minutes per run (20 Epochs) - **DCI Average Duration:** 4 minutes per run. F.4 Computational Cost Considerations for GCA - Performing GCA on pretrained smallNorb representations shows small computational costs, comparable to those necessary for computing DCI. - For GCA computational costs scale with the number of linear layers in the LNN spine and the capacity of the NN heads. - For large latent spaces, one should avoid step-wise dimensionality reduction in the LNN spine; larger reductions between consecutive LNN layers are preferred. - The first LNN layer size need not match the dimensionality of the representation. For large representations, a smaller first LNN layer is recommended. - GPU usage is beneficial for larger representations and models
Review 1: Summary: The paper proposes two new metrics, Importance-Weighted Orthogonality (IWO) and Importance-Weighted Rank (IWR), to evaluate the disentanglement of representations, as the existing methods fail to address the issue in Fig. 1, where some certain bases are better than others to capture the disentanglement. Through extensive experiments, the paper shows that these metrics correlate more strongly with downstream task performance compared to traditional disentanglement metrics. The paper's finding indicates that the utility of a representation is closer related to the orthogonality than its disentanglement. Strengths and Weaknesses: Strengths: The perspective that disentanglement is a better measurement for feature representation is interesting. The proposed Generative Component Analysis (GCA) and IWO/IWR are empirically validated to be effective in most experimental settings. Weaknesses: In Table 2, it shows that IWO and IWR have distinct performances in some cases, which raises the question: which metric should be used to measure the representation quality when a downstream task is not known or cannot be trivially evaluated? Only simple classification tasks are tested to show the representation quality. It is unknown how the representation is useful in different tasks like object detection, segmentation, etc. In Color DSprites, all disentanglement metrics fail to correlate with the representation utility, and there is no discussion on this. Similarly, in Randon Forest, IWR/IWO is not as good as DCI-C in Table 2b. Requested Changes: Explain which metric should be used to measure the representation quality when a downstream task is not known or cannot be trivially evaluated. More tasks should be tested to demonstrate the representation quality. The diverse results in Table 2 should be discussed more. Broader Impact Concerns: Not applicable. ================================================== Review 2: Summary: This paper proposed two metrics, Importance-Weighted Orthogonality (IWO) and Importance-Weighted Rank (IWR), for measuring the orthogonality of representations such that each factor is not required to be aligned with the basis. The paper argues that these metrics correlate better with downstream task performance than traditional disentanglement metrics. The proposed metrics were evaluated on synthetic datasets. Strengths and Weaknesses: ## Strengths - The motivation of this paper is clear, and the author proposed a reasonable solution. - This paper is contextualized. The related work section is useful for the readers. - The author proposed "Generative Component Analysis (GCA)" to identify the subspaces where generative factors vary. ## Weaknesses - Given a metric, I think it is important to state clearly: - what property it exactly measures, - **if having a perfect score (either $0$ or $1$) implies that a representation must have the property, and if all representations with the property are assigned perfect scores**, - what supervision is needed to calculate the metric, - if it is differentiable so that we can directly optimize the property, - what supervision/annotation is needed, and - the computation cost of the metric. The author mentioned some of them, but it would be better to summarize them as theorems (with proofs). - The author explained the design choice of the proposed metrics, but not the reasons. For example, the benefit of "taking the importance of the dimensions spanning them into consideration" is unclear to me. Requested Changes: - Locatello et al. (2019) used not only orthogonal transformations but also probability integral transforms and their inverses. - p. 2 "we utilize Generative ..." sounds like "Generative Component Analysis (GCA)" was proposed in a previous work. - As far as I know, the original paper on the group-theoretical definition (Higgins et al. 2018) never used the term "Symmetry-Based Disentanglement Representation". Broader Impact Concerns: N/A ================================================== Review 3: Summary: The paper tackles an extremely interesting topic: in the last decades, there has been an increasing interest in 'disentangled representations', with the hope to obtain 'better' representations, 'more interpretable'. A huge amount of empirical and theoretical work can now be found on disentangled representations. However, the practical interest in disentanglement remains to be proven. The paper brings empirical evidence that disentanglement might not be the right notion. The authors introduce two new metrics, IWO and IWR, based on the orthogonality of the latent factors, and show the proposed metrics correlate better with performance on downstream tasks. Strengths and Weaknesses: Overall it seems that the metric computation might be complex (and potentially costly) to compute, some parts of the paper need to be clarified. However, overall this is a very interesting paper, **challenging the correlation between disentanglement representation and performances on downstream tasks**. Some parts of the paper were unclear to me: - the General Component Analysis method has to learn a lot of neural networks, is the number of learned neural nets equal to the number of latent components? - The 'subspace learning' part of 3.1 is very clear, but I did not understand the 'basis generation' part. Would it be possible to introduce a more rigorous/mathematical definition of the $Q_l$-s and $q_l$-s. Is it clear that $Q_l$-s are full rank? i.e. that $q_l$-s are uniquely defined? Is it even clear that the $Q_l$-s are of size $(l + 1) \time l$? - What does $b_l$, $q_l$, $\Delta_l$ represent? - where are the 'importance weights' $\alpha^{j}$ and $\alpha^{k}$ mathematically defined? Especially since the correlation applied between the latent can make the task especially easy (or hard) - the synthetic data generation process could be explained more clearly, e.g, by writing the exact equation for each synthetic data. - What are the conclusions of Table 1? I do not understand how it makes the point of the paper, and no explanation is provided. The only reference to Table 1 in the text is 'The results are displayed in Table 1'. Could you elaborate? Is Table 1 displaying the correlation between downstream task performance and the metrics? If yes it seems to me that this is written nowhere. - Results of Table 2 are extremely interesting! How do you understand the fact DCD-I, DCI-C and MIG correlate negatively with the performances for Random Forest? Requested Changes: Clarify all the points of the previous section, in particular: - Clarify the 'basis generation' part - Detail the cost of the proposed method, and give insights on how much the hyperparameters need to be handtuned (as I understand, one has to learn multiple networks to compute the proposed metric) - Comment more Table 1 Broader Impact Concerns: NA ==================================================
# Federated Variational Inference: Towards Improved Personalization And Generalization Elahe Vedadi *elahevedadi@google.com* Google Research Joshua V. Dillon *jvdillon@google.com* Google Research Philip Andrew Mansfield memes@google.com Google Research Karan Singhal karansinghal@google.com Google Research Arash Afkanpour *arashaf@google.com* Google Research Warren Richard Morningstar *wmorning@google.com* Google Research Reviewed on OpenReview: *https: // openreview. net/ forum? id= 6OmRkUHgs5* ## Abstract Conventional federated learning algorithms train a single global model by leveraging all participating clients' data. However, due to heterogeneity in client generative distributions and predictive models, these approaches may not appropriately approximate the predictive process, converge to an optimal state, or generalize to new clients. We study personalization and generalization in stateless cross-device federated learning setups assuming heterogeneity in client data distributions and predictive models. We first propose a hierarchical generative model and formalize it using Bayesian Inference. We then approximate this process using Variational Inference to train our model efficiently. We call this algorithm *Federated Variational Inference (FedVI)*. We use PAC-Bayes analysis to provide generalization bounds for FedVI. We evaluate our model on FEMNIST and CIFAR-100 image classification and show that FedVI beats the state-of-the-art on both tasks. ## 1 Introduction Federated Learning (FL) (McMahan et al., 2017) allows training machine learning models on decentralized datasets, avoiding the need to aggregate data on a central server due to privacy concerns. In FL, the central server oversees a global model distributed to clients who conduct local training, and the model updates are aggregated to iteratively improve the global model. In simple and idealized settings, FL can approximate centralized training with similar theoretical guarantees, as seen in FedSGD (McMahan et al., 2017). However, real-world cross-device FL scenarios, such as those in (Reddi et al., 2020; Wang et al., 2021), often diverge from these ideal conditions. Practical FL implementations involve multiple local training steps to minimize communication overhead. Client participation is typically uneven, with some contributing more data and others not participating at all. Additionally, the nonIndependently and Identically Distributed (non-IID) nature of client datasets, stemming from distinct data generation processes, challenges theoretical guarantees, leads to performance disparities between participating and non-participating clients (Yuan et al., 2022), and complicates training high-performing models in practical FL setups. Modern approaches address this challenge by either modifying the local loss to converge to a global solution (Li et al., 2020) or using personalized models to handle local distribution shifts (Zhang et al., 2022). Approaches for personalization have often focused on stateful FL setups, where clients are revisited throughout training and thus can update a locally stored model (Karimireddy et al., 2020; Wang et al., 2021). However, many production scenarios are effectively stateless, since individual clients only rarely contribute to training, and local models may be either stale or non-existent. Few studies have concentrated on personalization in this context. Those that have (Singhal et al., 2021), require clients to possess labeled examples for personalization. This paper explores personalization in stateless cross-device FL setups and introduces Federated Variational Inference (FedVI), an algorithm which utilizes Variational Inference (VI) to enable models to generalize and personalize across diverse client data, even for untrained clients. The key contributions encompass (i) proposing a hierarchical generative model rooted in mixed effects models for cross-device federated setups, (ii) offering generalization bounds through Probably Approximately Correct (PAC)-Bayes analysis, (iii) introducing FedVI algorithm, inspired by the theoretical approach, which provides a simplified experimental approximation and can be implemented by the existing FL frameworks, and (iv) demonstrating the superior performance of FedVI on two federated datasets, FEMNIST and CIFAR-100, compared to previous state-of-the-art methods. ## 2 Related Work Bayesian FL: To tackle statistical heterogeneity in FL, various studies have employed Bayesian methods to incorporate domain knowledge and aid convergence. Early attempts (Thorgeirsson & Gauterin, 2020; Chen & Chao, 2020) focused on model aggregation, either to retain uncertainty in model parameters, or to weight parameter updates proportional to performance. Zhang et al. (2022) instead attempts to use a Bayesian Neural Network (BNN) approximated with VI to train a global model using a Kullback–Leibler (KL) regularizer which induces convergence similar to the proximal term in FedProx (Li et al., 2020). While their local models can, in principle, personalize by deviating from the global model, they realistically require stateful settings with significant labeled data on clients in order to do so. Kotelevskii et al. (2022) casts personalized FL as mixed effects regression, and attempts to model the inherent heterogeneity in this setting explicitly using Stochastic Gradient Langevin Dynamics (Welling & Teh, 2011). Our proposed method assumes a similar generative process to Kotelevskii et al. (2022) but instead uses VI to efficiently infer the posterior, as well as place a bound on the predictive risk to induce generalization to new clients (Germain et al., 2016). Stateful FL: There is a rich body of literature on personalization in cross device FL (Corinzia et al., 2019; Ghosh et al., 2020; Chen & Chao, 2021; Collins et al., 2021; Deng et al., 2020; Li et al., 2021; Hassan et al., 2023). Many previous methods focus on stateful settings, where local parameters are stored on clients and maintained across training rounds. However, as emphasized in Table 1 of (Kairouz et al., 2021), statelessness is a key characteristic of cross-device FL, highlighting its practical significance. Therefore, we focus on stateless settings, where maintaining up-to-date local states on each client is not feasible. This is similar to the setting considered by (Marfoq et al., 2022), who uses K-nearest neighbors to account for client distributional shift. While this is a robust means of dealing with both input and output distributional shift, it requires clients to possess labeled examples for every class (which is unrealistic in real-world setups), and cannot be used outside of classification problems. FedVI's statelessness stems from its use of an *amortized posterior inference* model. This concept shares similarities with how Variational Autoencoders (VAEs) (Kingma & Welling, 2013) perform inference. In VAEs, an encoder network maps input data to a latent space. FedVI takes a set of examples and infers the posterior over the local parameters, effectively capturing the personalized features of each client's data. This dynamic encoding allows for continuous adaptation and personalization as new clients join and contribute their data. Meta Learning: There is a significant amount of prior work that studies connections between personalized FL and Model-Agnostic Meta-Learning (MAML) approaches (Finn et al., 2017; Singhal et al., 2021; Fallah et al., 2020; Collins et al., 2021; Lin et al., 2020; Chen et al., 2018). The main idea behind these works is to find an initial global shared model that the existing or new clients can adapt to their own dataset by performing a few steps of gradient descent with respect to their local data. FedRecon (Singhal et al., 2021) is also motivated by MAML and considers a partially local federated learning setting, where only a subset of model parameters (known as global parameters) will be aggregated and trained globally for fast reconstruction of the local parameters. Our work can be considered as an extension of FedRecon. Unlike this work, we also provide a means of reconstructing local parameters 1 without access to labeled data. ## 3 Methods 3.1 Hierarchical Generative Model Let us consider a stateless cross-device federated setup with multiple clients and a central server, where randomly selected client subsets participate in each training round. In this setup, we categorize each client's model parameters as global (θ) and local (βk for k ∈ [c] 2) parameters, with c representing the total number of clients. Global parameters update at the server end after each training round, while local parameters are deleted after each round. Global parameters are drawn from the prior distribution t(Θ), while each client's local parameters are independent samples from the local prior r(Bk). Additionally, data may not exhibit IID characteristics among clients, *i.e.,* xik ∼ νk(Xk) for i ∈ [nk] and k ∈ [c], where nk is the total number of data samples at client k. Moreover, each client may have a distinct predictive distribution. Although all clients share the same likelihood distribution family `(Yk|f(θ, βk, xik)), the distribution varies based on βk, making it different for each client. The above setup is a prototypical example of a mixed effects model (Demidenko, 2013), commonly employed for predicting a continuous random variable using multiple independent factors, including both random and fixed, and incorporating repeated measurements from the same observational unit. Mixed effects models (Demidenko, 2013) have a well-established foundation. By framing our setup within this context, we can leverage existing theoretical insights in this field. To summarize, we propose the following hierarchical data generating process: θ ∼ t(Θ) (1) $\theta\sim t(\Theta)$ for $k\in[c]$ : $\beta_{k}\sim r(B_{k})$ for $i\in[n_{k}]$ : $\tau_{ik}\sim\nu_{k}(X_{k})$ $\beta_{ik}\sim\ell(Y_{k}|f(\theta,\beta_{k},\tau_{ik}))$ $$(1)$$ where f : Φ × Bk × Xk → Zk is a deterministic function (e.g., DNN) mapping what we know to the latent space Zk, which is the parameter space of our distribution over outcomes, `(.). For a more intuitive grasp of varying data generation processes and predictive distributions, consider the Federated EMNIST dataset (FEMNIST; Figure 1), where each client's dataset consists of numbers and letters handwritten by that client. Each client's input data reflects their unique writing style; for instance, a German client may include a horizontal middle bar when writing sevens, whereas an American client may not. Likewise, the German client may add a hood to the number 1, while the American client may not. This describes the difference in data generating distributions. This also illustrates that each client may have different predictive distributions: the American client may see the German's 1 as a 7, while the German client may see the American's 1 as a lowercase "l". Thus their predictive distributions are in direct conflict with each other. A purely global model cannot accommodate this diversity and must incorporate some level of local adjustments to accurately represent the data generation process. Our proposed algorithm explicitly assumes this data generating process. Note that this assumption reduces in special cases to existing FL setups, such as IID predictive distributions (r(Bk) = δ(Bk − β)), or IID data generating processes (νk(Xk) = ν(Xk)). In the following section, we detail how we use VI to efficiently infer the model parameters. 1The detailed procedure for reconstructing the local parameters can be found in Section 5. 2In this paper we represent the set of {1*, . . . , c*} by [c]. ![3_image_0.png](3_image_0.png) Figure 1: Illustration of diverse data generation and predictive models in cross-device FL. ## 3.2 Training Objective In this section, our goal is to present a step-by-step definition of the objective function that is meant to be minimized throughout the training process. We begin by calculating the estimated probability density function of labels given input data, denoted as pˆ({y nk } c) def = p({y nk } c|{x nk } c), following a similar marginalization approach as (Watanabe, 2018): $$\hat{p}(\{y^{n_{k}}\}^{c})\stackrel{{\rm def}}{{=}}\int_{\theta}\int_{\beta_{c}}\cdots\int_{\beta_{1}}p(\theta,\beta^{c}|\{y^{n_{k}},x^{n_{k}}\}^{c})\ell(\{y^{n_{k}}\}^{c}|f(\theta,\{\beta_{k},x^{n_{k}}\}^{c})),\tag{2}$$ where $\beta^{\pm}\stackrel{{\rm def}}{{=}}\{\beta_{k}\}^{c}\stackrel{{\rm def}}{{=}}\{\beta_{k}:k\in[c]\}$, $x^{n_{k}}\stackrel{{\rm def}}{{=}}\{x_{i}:i\in[n_{k}]\}$, $y^{n_{k}}\stackrel{{\rm def}}{{=}}\{y_{i}:i\in[n_{k}]\}$, $\{x^{n_{k}}\}^{c}\stackrel{{\rm def}}{{=}}\{x_{ik}:i\in[n_{k}],k\in[c]\}$, and $\{y^{n_{k}}\}^{c}\stackrel{{\rm def}}{{=}}\{y_{ik}:i\in[n_{k}],k\in[c]\}$. Therefore, for calculating pˆ({y nk } c) it is required to calculate the posterior probability of model parameters given the training data which is equal to: $$p(\theta,\beta^{c}|\{y^{n_{k}},x^{n_{k}}\}^{c})=\frac{p(\theta,\beta^{c},\{y^{n_{k}}\}^{c}|\{x^{n_{k}}\}^{c})}{p(\{y^{n_{k}}\}^{c}|\{x^{n_{k}}\}^{c})}.\tag{3}$$ Assuming that the prior distribution of the global parameters, t(θ), the prior distribution of the local parameters, r(βk), and the likelihood distribution of each client, `(y nk |f(θ, βk, xnk )), are independent we calculate the numerator of Equation 3 as: $$p(\theta,\beta^{c},\{y^{n_{k}}\}^{c}|\{x^{n_{k}}\}^{c})=p(\theta,\{\beta_{k},\{y_{lk}\}_{k\in[n_{k}]}\}_{k\in[c]}|\{x_{lk}\}_{k\in[c],c\in[n_{k}]})$$ $$=t(\theta)\prod_{k\in[c]}r(\beta_{k})\prod_{k\in[c]}\prod_{l\in[n_{k}]}\ell(y_{lk}|f(\theta,\beta_{k},x_{lk}))$$ $$=t(\theta)\prod_{k\in[c]}\left(r(\beta_{k})\prod_{l\in[n_{k}]}\ell(y_{lk}|f(\theta,\beta_{k},x_{lk}))\right)$$ $$=t(\theta)r(\beta^{c})\ell(\{y^{n_{k}}\}^{c}|f(\theta,\beta^{c},\{x^{n_{k}}\}^{c})).$$ $$\quad(4)$$ $$\left(5\right)$$ Moreover, the denominator of Equation 3 can be written as: $$p(\{y^{n_{k}}\}^{c}|\{x^{n_{k}}\}^{c})=\int_{\theta}\int_{\beta_{c}}\cdots\int_{\beta_{1}}p(\theta,\beta^{c},\{y^{n_{k}}\}^{c}|\{x^{n_{k}}\}^{c}).\tag{1}$$ Unfortunately this integral is not only infeasible to compute, but also mathematically intractable. Consequently, this makes the whole posterior intractable. To address the problem of the intractable posterior distribution, a tractable surrogate distribution, denoted as q(*θ, β*c|{y nk , xnk } c), is approximated using VI. By formulating a specific lower bound on the marginal distribution known as the evidence lower bound (ELBO), the best surrogate distribution can be obtained by minimizing the ELBO (Equation 6). This minimization process provides the best approximation for the intractable posterior distribution, p(*θ, β*c|{y nk , xnk } c), under the chosen family of surrogates. The notation DKL(qkp) represents the KL divergence between two distributions p and q, and detailed derivations of Equation 6 are available in Appendix A. $$-\log p(\{y^{n_{k}}\}^{c}|\{x^{n_{k}}\}^{c})\leq-\log p(\{y^{n_{k}}\}^{c}|\{x^{n_{k}}\}^{c})+\min_{q}D_{KL}(q(\theta,\beta^{c}|\{y^{n_{k}},x^{n_{k}}\}^{c})\|p(\theta,\beta^{c},|\{y^{n_{k}},x^{n_{k}}\}^{c}))\tag{6}$$ $$=\min_{q}\mathbb{E}_{q(\theta,\beta^{c}|\{x^{n_{k}},y^{n_{k}}\}^{c})}\log\frac{q(\theta,\beta^{c}|\{x^{n_{k}},y^{n_{k}}\}^{c})}{p(\theta,\beta^{c},\{y^{n_{k}}\}^{c}|\{x^{n_{k}}\}^{c})}.$$ By asserting factorization, we define the surrogate as a parametric distribution as: $$q(\theta,\beta^{c}|\{y^{n_{k}},x^{n_{k}}\}^{c})\stackrel{{\rm def}}{{=}}q_{\lambda}(\theta|\{y^{n_{k}},x^{n_{k}}\}^{c})\prod_{k\in[c]}q_{\lambda}(\beta_{k}|\theta,y^{n_{k}},x^{n_{k}})\stackrel{{\rm def}}{{=}}q_{\lambda}(\theta|\{y^{n_{k}},x^{n_{k}}\}^{c})q_{\lambda}(\beta^{c}|\theta,\{y^{n_{k}},x^{n_{k}}\}^{c}),\tag{7}$$ $$(6)$$ $$\left(7\right)$$ where λ is the parameter set that uniquely defines the surrogate distribution. Therefore, the objective function for training the proposed hierarchical model is a generalization of the negative ELBO (specifically, negative ELBO when γ = τ = 1), which can be written as follows using the definition of KL divergence, logarithm properties, and the multiplication rule in probability. J (λ; γ, τ ) = Eq(θ,βc|{x nk ,ynk }c)[log q(θ, βc|{x nk , ynk } c) p(θ, βc, {y nk } c|{x nk } c) ] Per Datum Expected Loss z }| { Eqλ(θ|{y nk ,xnk }c)qλ(βk|θ,ynk ,xnk )[− log `(yik|f(θ, βk, xik))] = X k∈[c] X i∈[nk] + γDKL(qλ(θ|{y nk, xnk } c)kt(θ)) | {z } Global Regularizer + X k∈[c] τ Eqλ(θ|{y nk ,xnk }c)[DKL(qλ(βk|θ, ynk, xnk)kr(βk))], | {z } Local Regularizer (8) where γ, τ , t(θ), r(βk), and the functional form of qλ(*θ, β*c|{y nk , xnk } c) are left as hyper parameters. The details of this derivation are provided in Appendix B. In the following section we explain how minimizing this objective function is equivalent to minimizing an upper bound on the generalization error. ## 4 Generalization Bounds As mentioned earlier, we utilize a generalization of the negative ELBO as our objective function to train the hierarchical model. Minimizing this function ideally reduces the training dataset error (empirical risk). However, our primary aim is to minimize the error on unseen datasets (generalization error or true risk) for better generalization. To achieve this, we conduct a PAC-Bayes analysis, leveraging the results presented in Theorem 3 of (Germain et al., 2016). We introduce a slightly generalized version of this theorem in the form of the following corollary, enabling us to compute a generalization bound for the true risk of our model, under the assumption of non-IID empirical data samples. Corollary 1 Given a distribution D over X ×Y, a hypothesis set F = {θ, βc}, a loss function ` : *F ×X ×Y →* R, a prior distribution π(Θ, Bc) = t(Θ)r(Bc) over F, a δ ∈ (0, 1] and a real number η > 0, with probability at least 1 − δ *over the choice of* ({x nk } c, {y nk } c) def = (X, Y ) ∼ D, for any q(.) on F *we have:* True risk z }| { ED[− log Eq(θ,βc|X,Y )[`(Y |X, θ, βc)]] ≤ Empirical risk z }| { EX,Y [Eq(θ,βc|X,Y )[− log(`(Y |X, θ, βc))]] +1 η KL divergence z }| { DKL(q(θ, βc|X, Y )kπ(θ, βc)) + log 1 δ EX,Y -Eπ(θ,βc) -exp ηED[− log(`(Y |X, θ, βc))] − ηEX,Y [− log(`(Y |X, θ, βc))] | {z } Slack term $$({\mathfrak{g}})$$ . (9) ![5_image_1.png](5_image_1.png) Figure 2: Our proposed model architecture implementing FedVI. ![5_image_0.png](5_image_0.png) Where $\mathbb{E}_{X,Y}[\log(\ell(Y|X,\theta,\beta^c))]=\frac{1}{\sum\limits_{k=1}^n n_k}\sum\limits_{k=1}^c\sum\limits_{i=1}^{n_k}[\log(\ell(y_{ik}|x_{ik},\theta,\beta_k))]$ and $\mathbb{E}_{\mathcal{D}}[.]=\mathbb{E}_{(X,Y)\sim\mathcal{D}}[.]$. Sketch of Proof: This corollary's proof closely follows Theorem 3 in Germain et al. (2016). We establish it using Jensen's inequality, Donsker-Varadhan change of measure inequality, and Markov's inequality. Additional details can be found in Appendix C. Having obtained the generalization bound in Equation 9, we observe that it equals the negative ELBO (Equation 8) (for η = 1) plus a constant slack term, unrelated to the surrogate posterior distributions. Note that given Equation 9 validity for any η > 0, setting 1 η = min{*γ, τ*} allows us to consider Equation 8 plus a slack term as an upper bound on the True risk. Consequently, as long as this slack term remains finite, minimizing Equation 8 with respect to the surrogate distribution is equivalent to minimizing the generalization error with respect to the surrogate distribution. Thus we conclude that, assuming a finite slack term and with probability greater than 1 − δ, minimizing Equation 8 should improve the generalization of our model. ## 5 Implementation And Experimental Evaluation The main goal of this section is to go through the details of our primary theoretical assumptions and model architecture for implementing an instance of our proposed hierarchical generative model and evaluating it. We note that the model architecture proposed in this section is one of infinity many architectures that is compatible with our theoretical model. This section will outline how the algorithm's steps correspond to the specific components of the hierarchical model and variational approximation presented in Section 3. Distributions: For the prior distribution of the local parameters, we assume a normal distribution with zero mean and variance equal to that given by the initialization scheme (e.g. Glorot & Bengio, 2010; Glorot et al., 2011; He et al., 2015). We assume that clients' data generating distributions have the same support, but that they can be different from one another. We use a categorical distribution as our likelihood, where the logits generated by a deep neural network parameterized by θ and βk (described below). To simplify implementation, we use a point estimate for the global posterior. This is equivalent to assuming the hyper parameter of the global KL divergence is equal to zero, *i.e.,* in Equation 8 we have γ = 0. Moreover, to make sure that the KL divergence between the global posterior and the global prior, DKL(qλ(θ|{y nk , xnk } c)kt(θ)), is finite we assume that the global posterior is a very narrow normal distribution, but still finite, while the global prior can be any finite function. Tasks: We evaluate FedVI algorithm on two different datasets, FEMNIST3(Caldas et al., 2019) (62-class digit and character classification) and CIFAR-1004(Krizhevsky et al., 2009) (100-class classification). FEMNIST 3https://www.tensorflow.org/federated/api_docs/python/tff/simulation/datasets/emnist/load_data 4https://www.tensorflow.org/federated/api_docs/python/tff/simulation/datasets/cifar100/load_data is particularly relevant since it has a naturally different data generative distribution for each client. Although CIFAR-100 data is synthetically partitioned using a hierarchical Latent Dirichlet Allocation (LDA) process (Li & McCallum, 2006) and distributed among clients, we evaluate FedVI on this dataset as well to show the superiority of our method on a more complicated classification task. Model Architecture: There are infinitely many model architectures which could implement our method. The architecture that we chose in our experiments is illustrated in Figure 2 and summarised in Algorithm 1. The mathematical notations that are used in both Figure 2 and Algorithm 1 are as follows: | def = {x nk , ynk : x nk ∈ Xk, ynk ∈ Yk, k ∈ [c]} | (input dataset of client k) | (10) | | |-----------------------------------------------------|----------------------------------------------|---------------------|------| | Dk Xk def = R i×i×j | (input space; whitened images) | (11) | | | Yk def = [ζ] | (label space) | (12) | | | 0 (.) : Xk → R d | (embedding model; relu-convnet with dropout) | (13) | | | Eθ Pθ 00 (.) : R dg → R (2·dl+1)·|Yk| | (posterior constructor model; relu-mlp) | (14) | | | Gθ 000 (.) : R dg → R |Yk| | (global classifier; one dense layer) | (15) | | | (.) : R dl → R |Yk| | (local classifier; one dense layer) | (16) | | | Lβk | 0 ∪ θ 00 ∪ θ 000 | (global parameters) | (17) | | θ = θ βk | (local parameters of client k), | (18) | | where for FEMNIST we have i = 28, j = 1, and |Yk| = ζ = 62, and for CIFAR-100 i = 32, j = 3, and |Yk| = ζ = 100, for k ∈ [c]. For both datasets the embedding size d = 128 and the number of local and global features are equal to dl = 26 and dg = 102, respectively. Our proposed model architecture consists of four separate modules: an embedding model, Eθ 0 (.), which encodes the input as a vector, a posterior reconstruction model, Pθ 00 (.), which predicts the posterior over local parameters, a classifier parameterized by global parameters, Gθ 000 (.), and a classifier implemented by local parameters, Lβk (.), generated by sampling from the reconstructed posterior. The global parameters serve the purpose of classifying input data samples by considering their global features shared among all clients. On the other hand, the local parameters play a distinct role in refining the classification outcome by accounting for the unique local features specific to each individual client. Our model follows the stateless definition outlined in Table 1 of (Kairouz et al., 2021), eliminating the necessity to retain prior client states for parameter updates. Clients are not required to store updated global parameters; instead, the server aggregates and transmits averaged updates for upcoming rounds. Furthermore, clients can avoid the need to store updated local parameters by employing the posterior constructor model in each round to reconstruct the local parameter distribution, allowing them to derive local parameters through sampling from this reconstructed posterior distribution. Implementation: We implement our FedVI algorithm in TensorFlow Federated (TFF) and scale up the implementation to NVIDIA Tesla V100 GPUs for hyperparameter tuning. For FEMNIST dataset with 3400 clients we consider the first 20 clients as non-participating users which are held-out in training to better measure generalization as in (Yuan et al., 2022). At each round of training we select 100 clients uniformly at random without replacement, but with replacement across rounds. For CIFAR-100 with 500 training clients, we set the data of the first 10 clients as held-out data and select 50 clients uniformly at randomly at each round. We train FedVI algorithm on both FEMNIST and CIFAR-100 for 1500 rounds and at each round of training we divide both datasets into mini-batches of 256 data samples and used mini-batch gradient descent algorithm to optimize the objective function. The training procedure for each client k at round t, outlined in Algorithm 1, is as follows. Further details regarding each step are explained subsequently: 1. Each client k partitions its input data, Dk, over the batch dimension into support and query sets, Dk,s and Dk,q, using the data split function, S(.). Similar to FedRecon (Singhal et al., 2021), the support set is used to reconstruct the local parameters and the query set is used to make predictions. ![7_image_0.png](7_image_0.png) Figure 3: An illustration of the division of the data into support and query sets, as well as the division into global and local features. Note that the support set we use can be unlabeled, and that the two sets need not be disjoint. However, we use disjoint sets in our experiments since (Singhal et al., 2021) found that it improved their model performance. 2. Both support and query sets are fed into the embedding model, Eθ 0 (.), to extract vector representations of the data, i.e., Rk,s ∈ R d and Rk,q ∈ R d. 3. The representation for both support and query sets are further split over their features axis into global and local features, *i.e.,* (R g k,s ∈ R dg, Rlk,s ∈ R dl ) and (R g k,q ∈ R dg, Rlk,q ∈ R dl ), for d = dg + dl, using the feature split function F(.), as illustrated in Figure 3. 4. The global features of the support set, R g k,s ∈ R dg, are used to reconstruct the mean and variance of the local posterior, *i.e.,* (µk ∈ R dl·|Yk|, σk ∈ R dl·|Yk|), through the posterior constructor model, Pθ 00 (.). The local parameters, β (t) k , are generated by sampling from this posterior. 5. The global features of the query set, R g k,q ∈ R dg, are passed to the global classifier, Gθ 000 (.) , to get the global predictions, O g k ∈ R |Yk|, and the local features of the query set, Rlk,q ∈ R dl, and local parameters, β (t) k , are passed to the local classifier, Lβk (.), to get the local modifications to the global predictions, Olk ∈ R |Yk|. 6. The local and global predictions are merged5to get the predictions. The log-likelihood is then computed between these predictions and labels and added to the KL divergence between local posterior and prior. 7. Global parameters get updated through back propagation over the loss function that is calculated in the previous step. This indirectly updates the local parameters, as they are inferred from the posterior constructor model, which is parameterized by the global parameters. Then the local update of the global parameters, ∆ (t) k , along with the number of query data samples at client k, nk, are returned to the server. 8. The server aggregates all client updates and calculates the global update of the global parameters, θ (t+1), and shares them with all clients k ∈ S(t+1) for the next round of training. Data Partitioning: First we note that for both FEMNIST and CIFAR-100 datasets, at each epoch we consider the first 50% of each mini-batch as the support set and the other 50% as the query set (i.e, for a mini-batch with 256 data samples the first 128 samples belong to the support set and the rest belong to query set). For the global-local features split, we found that using a larger number of global features (80%) than local features (20%) performed best. More specifically, in these experiments that the dimension of the last layer of the embedding model is equal to d = 128, the first 102 features are considered as the global features and the rest of 26 features are local features. Embedding Model: In our experiments the embedding model, Eθ 0 (.), is a relu convnet. For FEMNIST experiment we consider the convolutional model with 2 convolution layers that is described in Table 4 of 5While there are multiple ways that one could merge the predictions, we found that the simplest way was to add them together. This treats the local predictions as modifications to the global predictions in Logit space. ## Algorithm 1 Fedvi Training Input: set of global parameters θ, data split function S(.), feature split function F(.), embedding model Eθ 0 (.), posterior constructor model Pθ 00 (.), global classifier Gθ 000 (.), local classifier Lβk (.), merge function | f(.), client update algorithm U(.). Server Executes: θ (0) ← (initialize θ) for each round t do S (t) ← (randomly sample c clients) for each client k ∈ S(t) in parallel do (t) (∆ k , nk) ← ClientUpdate(k, θ (t) ) end for n = P k∈S(t) nk θ (t+1) ← θ nk (t) (t) + αs P k∈S(t) n ∆ k end for | ClientUpdate: (Dk,s, Dk,q) ← S(Dk) nk,s , θ0(t) ) Rk,s ← Eθ 0 (x Rk,q ← Eθ 0 (x nk,q , θ0(t) ) (R k,s, Rl k,s) ← F(Rk,s) g g (R k,q, Rl k,q) ← F(Rk,q) g (µk, σk) ← Pθ 00 (R k,s, θ00(t) ) (t) β k ← sample(N (µk, σk)) O g 000 (R g k ← Gθ k,q, θ000(t) ) Ol k ← Lβk (Rl k,q, β(t) k ) (t) g θ k ← U(f(O , Ol k ), ynk,q ) k (t) (t) (t) ∆ k ← θ k − θ nk ← |Dk,q| return (∆(t) , nk) to the server k | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| (Reddi et al. (2020)) paper (without the top layer) and is parameteraized by the global parameters. the detailed structure of this embedding model is as the following. For FEMNIST: Eθ 0 (.) = conv(32) → relu → conv(64) → relu → maxpool(2,2) → dropout(0.25) → *flatten* → dense(128) → *dropout(0.5)* We choose a convolutional embedding model for CIFAR-100 as well, which is similar to FEMNIST embedding model, but having 5 convolution layers instead. The detailed structure is as follows. For CIFAR-100: Eθ 0 (.) = conv(32) → relu → conv(64) → relu → conv(128) → relu → conv(256) → *relu* → conv(512) → relu → maxpool(2,2) → dropout(0.25) → flatten → dense(128) → *dropout(0.5)* Posterior Constructor Model: The posterior constructor model, Pθ 00 (.), is an MLP with three (dense) layers that takes the global features of the output of Eθ 0 (.) as input and generates mean, variance, and bias of the posterior. For both FEMNIST and CIFAR-100: Pθ 00 (.) = dense(256) → relu → dense(256) → *relu* → dense((2 × 26 + 1) *× |Y*k|) Global and Local Classifiers: For both FEMNIST and CIFAR-100 experiments global classifier is one dense layer with |Yk| units and no activation function, parameterized by the global parameters, and the local classifier is one dense layer similar to the global classifier, but parameterized by the local parameters. Optimizers: We use Stochastic Gradient Descent (SGD) for our client optimizer and SGD with momentum for the server optimizer for all experiments (Reddi et al., 2020). We set the client learning rate equal to 0.03 for CIFAR-100 and 0.02 for FEMNIST dataset, and server learning rate equal to 3.0 with momentum 0.9 for both FEMNIST and CIFAR-100 datasets. Evaluation Results and Discussion: We evaluate our proposed FedVI algorithm against state-of-the-art personalized FL method, KNN-Per (Marfoq et al., 2022), as well as FedPA (Al-Shedivat et al., 2020), FedEP (Guo et al., 2023) (using highest reported values), FedAvg+ (Chen & Chao, 2021), ClusteredFL (Ghosh et al., 2020), DITTO (Li et al., 2021), FedRep (Collins et al., 2021), APFL (Deng et al., 2020), and FedAvg (McMahan et al., 2017). Results for the baseline methods (except for FedPA and FedEP) are taken from (Marfoq et al., 2022). Table 1: Test accuracy of the participating/non-participating clients. FedVI results are reported for τ = 10−9 for FEMNIST, and τ = 10−3for CIFAR-100. | Dataset | FedAvg | FedAvg+ | ClusteredFL | DITTO | FedRep | APFL | FedPA | FedEP | KNN-Per | FedVI | |-----------|-----------|-----------|---------------|-----------|-----------|-----------|---------|---------|-----------|-----------| | FEMNIST | 83.4/83.1 | 84.3/84.2 | 83.7/83.2 | 84.3/83.9 | 85.3/85.4 | 84.1/84.2 | 87.3/NA | 86.6/NA | 88.2/88.1 | 90.3/90.6 | | CIFAR-100 | 47.4/47.1 | 51.4/50.8 | 47.2/47.1 | 52.0/52.1 | 53.2/53.5 | 51.7/49.1 | 46.3/NA | 50.7/NA | 55.0/56.1 | 59.1/58.7 | KNN-Per (Marfoq et al., 2022) achieves personalized federated learning by combining a global MobileNet-V2 model with local k-nearest neighbors models based on shared data representations, demonstrating improved accuracy and fairness compared to other methods. FedPA (Al-Shedivat et al., 2020) reimagines federated learning as a posterior inference problem, proposing a novel algorithm that utilizes MCMC for efficient local inference and communication, employing CNN models for FEMNIST and ResNet-18 for CIFAR-100. FedEP (Guo et al., 2023) similarly reformulates federated learning as a variational inference problem, using an expectation propagation algorithm to refine approximations to the global posterior, and also employs CNN models for FEMNIST and ResNet-18 for CIFAR-100. APFL (Deng et al., 2020) offers a communicationefficient federated learning algorithm that adaptively combines local and global models to learn personalized models, utilizing various models (logistic regression, CNN, MLP) on diverse datasets, including FEMNIST and CIFAR-100. ClusteredFL (Ghosh et al., 2020) is designed for clustered users, iteratively estimating user clusters and optimizing their model parameters, demonstrating strong performance in various settings. Finally, FedRep (Collins et al., 2021) learns a shared representation and unique local heads for each client, using 5-layer CNNs for CIFAR and a 2-layer MLP for FEMNIST, while DITTO (Li et al., 2021) introduces a simple personalization mechanism within a multi-task learning framework, utilizing CNNs, logistic regression, and linear SVMs for different datasets. Figure 4: Non-participating test accuracy of FEMNIST (τ = 10−9) and CIFAR-100 (τ = 10−3) over 1500 ![9_image_0.png](9_image_0.png) rounds of training. The performance of FedVI algorithm and other methods on the local test dataset of each client (unseen data at training) are provided in Table 1 for participating and non-participating (completely unseen during training) clients. All of the reported values are average weighted accuracy with weights proportional to local dataset sizes. To ensure the robustness of our reported results for FedVI, we average test accuracy across the last 100 rounds of training. Figure 4 illustrates the non-participating test accuracy on FEMNIST ( τ = 10−9 ) and CIFAR-100 (τ = 10−3) over 1500 rounds of training, providing a visual representation of the results reported in Table 1. Figure 5a shows the average test accuracy over the last 100 FEMNIST training rounds for a range of KL hyperparameter τ , from 0 to 10. Notably, τ = 10−9 outperforms others, achieving higher accuracy with a smaller generalization gap compared to τ = 0. Appendix D provides further insights and analysis regarding this experiment. Figure 5b displays the average test accuracy over the last 100 rounds in CIFAR-100, with varying KL hyperparameter τ . Notably, τ = 10−3 achieves the highest accuracy for both participating and nonparticipating clients. Comparing τ = 0 to other values (τ 6= 0) reveals that minimizing KL divergence reduces the gap in participation test accuracy, as anticipated. Note that our objective function in Equation 8 is indeed a generalization of the ELBO, where setting τ = γ = 1 recovers the standard ELBO. Setting τ = 0 effectively removes the KL divergence term, resulting in maximum likelihood estimation (MLE). While MLE can sometimes lead to overfitting, the KL divergence term in the ELBO acts as a regularizer, promoting better generalization. Therefore, values of τ > 0, which maintain the KL divergence term, generally exhibit superior performance and result is smaller generalization gaps. Furthermore, comparing this figure to Figure 5a, it's evident that the difference in test accuracy between τ = 0 and τ = 10−9in the FEMNIST experiment is significantly larger than the difference between τ = 0 and τ = 10−3in the CIFAR-100 experiment. This suggests that minimizing KL divergence is more critical for FEMNIST than for CIFAR-100. One possible explanation is that in FEMNIST, each client's data generation distribution naturally differs, while in CIFAR-100, data is synthetically partitioned and distributed among clients. ![10_image_0.png](10_image_0.png) Figure 5: Participating and non-participating test accuracy vs. KL hyperparameter τ . ## 6 Conclusion And Future Work This work addresses personalization in stateless cross-device federated setups through the introduction of FedVI, a novel algorithm grounded in mixed effects models and trained using VI. We establish generalization bounds for FedVI through PAC-Bayes analysis, present a novel architecture, and implement it. Evaluation on FEMNIST and CIFAR-100 datasets demonstrates that FedVI outperforms state-of-the-art methods in both cases. It is worth noting that in this paper, we employed a narrow normal distribution as the posterior for global parameters. However, in future research, we intend to explore more generalized distributions to enhance the modeling capabilities. Additionally, the model architecture presented in Figure 2 is just one of several possible architectures that align with our theoretical hierarchical model. In upcoming work we will focus on refining these architectures to optimize performance and explore their potential for achieving even better results. ## References Maruan Al-Shedivat, Jennifer Gillenwater, Eric Xing, and Afshin Rostamizadeh. Federated learning via posterior averaging: A new perspective and practical algorithms. *arXiv preprint arXiv:2010.05273*, 2020. Sebastian Caldas, Sai Meher Karthik Duddu, Peter Wu, Tian Li, Jakub Konečný, H. Brendan McMahan, Virginia Smith, and Ameet Talwalkar. Leaf: A benchmark for federated settings, 2019. Fei Chen, Mi Luo, Zhenhua Dong, Zhenguo Li, and Xiuqiang He. Federated meta-learning with fast convergence and efficient communication. *arXiv: Learning*, 2018. URL https://api.semanticscholar.org/CorpusID: 209376818. Hong-You Chen and Wei-Lun Chao. Fedbe: Making Bayesian model ensemble applicable to federated learning. In *International Conference on Learning Representations*, 2020. URL https://api.semanticscholar. org/CorpusID:235613568. Hong-You Chen and Wei-Lun Chao. On bridging generic and personalized federated learning for image classification. *arXiv preprint arXiv:2107.00778*, 2021. Liam Collins, Hamed Hassani, Aryan Mokhtari, and Sanjay Shakkottai. Exploiting shared representations for personalized federated learning. In *International conference on machine learning*, pp. 2089–2099. PMLR, 2021. Luca Corinzia, Ami Beuret, and Joachim M Buhmann. Variational federated multi-task learning. arXiv preprint arXiv:1906.06268, 2019. Eugene Demidenko. *Mixed models: theory and applications with R*. John Wiley & Sons, 2013. Yuyang Deng, Mohammad Mahdi Kamani, and Mehrdad Mahdavi. Adaptive personalized federated learning. arXiv preprint arXiv:2003.13461, 2020. Alireza Fallah, Aryan Mokhtari, and Asuman E. Ozdaglar. Personalized federated learning: A meta-learning approach. *CoRR*, abs/2002.07948, 2020. URL https://arxiv.org/abs/2002.07948. Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In *International conference on machine learning*, pp. 1126–1135. PMLR, 2017. Pascal Germain, Francis Bach, Alexandre Lacoste, and Simon Lacoste-Julien. PAC-Bayesian theory meets Bayesian inference. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. URL https: //proceedings.neurips.cc/paper/2016/file/84d2004bf28a2095230e8e14993d398d-Paper.pdf. Avishek Ghosh, Jichan Chung, Dong Yin, and Kannan Ramchandran. An efficient framework for clustered federated learning. *Advances in Neural Information Processing Systems*, 33:19586–19597, 2020. Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In *International Conference on Artificial Intelligence and Statistics*, 2010. Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Geoffrey Gordon, David Dunson, and Miroslav Dudík (eds.), Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of *Proceedings of Machine Learning Research*, pp. 315–323, Fort Lauderdale, FL, USA, 11–13 Apr 2011. PMLR. URL https://proceedings.mlr.press/ v15/glorot11a.html. Han Guo, Philip Greengard, Hongyi Wang, Andrew Gelman, Yoon Kim, and Eric P Xing. Federated learning as variational inference: A scalable expectation propagation approach. *arXiv preprint arXiv:2302.04228*, 2023. Conor Hassan, Robert Salomone, and Kerrie Mengersen. Federated variational inference methods for structured latent variable models. *arXiv preprint arXiv:2302.03314*, 2023. Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. *2015 IEEE International Conference on Computer Vision (ICCV)*, pp. 1026–1034, 2015. Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Kallista Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. Foundations and Trends® *in Machine Learning*, 14(1–2):1–210, 2021. Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank Reddi, Sebastian Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for federated learning. In *International conference on machine learning*, pp. 5132–5143. PMLR, 2020. Diederik P Kingma and Max Welling. Auto-encoding variational Bayes, 2013. URL https://arxiv.org/ abs/1312.6114. Nikita Kotelevskii, Maxime Vono, Alain Durmus, and Eric Moulines. Fedpop: A Bayesian approach for personalised federated learning. *Advances in Neural Information Processing Systems*, 35:8687–8701, 2022. Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. *Proceedings of Machine learning and systems*, 2:429–450, 2020. Tian Li, Shengyuan Hu, Ahmad Beirami, and Virginia Smith. Ditto: Fair and robust federated learning through personalization. In *International conference on machine learning*, pp. 6357–6368. PMLR, 2021. Wei Li and Andrew McCallum. Pachinko allocation: Dag-structured mixture models of topic correlations. In Proceedings of the 23rd international conference on Machine learning, pp. 577–584, 2006. Yujie Lin, Pengjie Ren, Zhumin Chen, Zhaochun Ren, Dongxiao Yu, Jun Ma, Maarten de Rijke, and Xiuzhen Cheng. Meta matrix factorization for federated rating predictions. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 981–990, 2020. Othmane Marfoq, Giovanni Neglia, Richard Vidal, and Laetitia Kameni. Personalized federated learning through local memorization. In *International Conference on Machine Learning*, pp. 15070–15092. PMLR, 2022. Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communicationefficient learning of deep networks from decentralized data. In *Artificial intelligence and statistics*, pp. 1273–1282. PMLR, 2017. Sashank Reddi, Zachary Charles, Manzil Zaheer, Zachary Garrett, Keith Rush, Jakub Konečný, Sanjiv Kumar, and H. Brendan McMahan. Adaptive federated optimization, 2020. URL https://arxiv.org/ abs/2003.00295. Karan Singhal, Hakim Sidahmed, Zachary Garrett, Shanshan Wu, John Rush, and Sushant Prakash. Federated reconstruction: Partially local federated learning. *Advances in Neural Information Processing Systems*, 34: 11220–11232, 2021. Adam Thor Thorgeirsson and Frank Gauterin. Probabilistic predictions with federated learning. *Entropy*, 23 (1):41, 2020. Jianyu Wang, Zachary Charles, Zheng Xu, Gauri Joshi, H Brendan McMahan, Maruan Al-Shedivat, Galen Andrew, Salman Avestimehr, Katharine Daly, Deepesh Data, et al. A field guide to federated optimization. arXiv preprint arXiv:2107.06917, 2021. Sumio Watanabe. *Mathematical theory of Bayesian statistics*. CRC Press, 2018. Max Welling and Yee W Teh. Bayesian learning via stochastic gradient Langevin dynamics. In *Proceedings* of the 28th international conference on machine learning (ICML-11), pp. 681–688, 2011. Honglin Yuan, Warren Richard Morningstar, Lin Ning, and Karan Singhal. What do we mean by generalization in federated learning? In *International Conference on Learning Representations*, 2022. URL https: //openreview.net/forum?id=VimqQq-i_Q. Xu Zhang, Yinchuan Li, Wenpeng Li, Kaiyang Guo, and Yunfeng Shao. Personalized federated learning via variational Bayesian inference. In *International Conference on Machine Learning*, pp. 26293–26310. PMLR, 2022. ## Appendices A Derivations Of Equation 6 Here we provide the detailed derivations of Equation 6 which are derived based on Section 2.2 of (Kingma & Welling, 2013). The main goal of these derivations is to devise an upper bound on the negative logarithm of the intractable denominator of the posterior probability of model parameters, i.e., p(*θ, β*c|{y nk , xnk } c) = p(*θ, β*c, {y nk } c|{x nk } c)/p({y nk } c|{x nk } c), to be able to approximate p(*θ, β*c|{y nk , xnk } c), in a tractable way. For this purpose, we consider an arbitrary distribution q(*θ, β*c|{y nk , xnk } c) as a surrogate for the posterior. Since the KL divergence of two distributions is always non-negative, we can use the KL divergence between the true posterior and our surrogate to devise an obvious and trivial upper bound on − log p({y nk } c|{x nk } c) as the initial step in Equation 19. As the minimum of a non-negative number is always non-negative, we replace the KL divergence with its minimum value with respect to the surrogate distribution q(*θ, β*c|{y nk , xnk } c), to make this upper bound as tight as possible (Equation 20). Moreover, since − log p({y nk } c|{x nk } c) is independent of the surrogate distribution, we move this term inside the minimum as shown in Equation 21. The rest of the proof comes from the definition of KL divergence, the multiplication rule of probability, and properties of logarithms. For the sake of simplicity in notation we have {y nk , xnk } c def = *X, Y* in the following equations. − log p(Y |X) ≤ − log p(Y |X) + Always ≥ 0. z }| { DKL(q(θ, βc|X, Y )kp(θ, βc|X, Y )) (19) ⇒ − log p(Y |X) ≤ − log p(Y |X) + Always ≥ 0. z }| { min qDKL(q(θ, βc|X, Y )kp(θ, βc|X, Y )) (20) ⇒ − log p(Y |X) ≤ min q− log p(Y |X) + DKL(q(θ, βc|X, Y )kp(θ, βc|X, Y )) (21) = min q Eq(θ,βc|X,Y )[− log p(Y |X) + log q(θ, βc|X, Y ) p(θ, βc|X, Y ) ] = min q Eq(θ,βc|X,Y )[log q(θ, βc|X, Y ) p(θ, βc|X, Y )p(Y |X) ] = min q Eq(θ,βc|X,Y )[log q(θ, βc|X, Y ) p(θ, βc, Y |X) ] (22) $$(22)$$ ## B Derivations Of Equation 8 We provide details for Equation 8, which is derived based on the definition of KL divergence, properties of logarithms, and the multiplication rule of probability. In the following equations {y nk , xnk } c def = *X, Y* for the simplicity in notations. p(Y |X) = p(θ, βc, Y |X) p(θ, βc|X, Y ) = p(θ, βc, Y |X) p(θ, βc|X, Y ) × q(θ, βc|X, Y ) q(θ, βc|X, Y ) = p(θ, βc, Y |X) q(θ, βc|X, Y ) × q(θ, βc|X, Y ) p(θ, βc|X, Y ) = t(θ)r(β c)`(Y |f(θ, βc, X)) qλ(θ|X, Y )qλ(β c|θ, X, Y ) ×q(θ, βc|X, Y ) p(θ, βc|θ, X, Y ) ⇒ − log(p(Y |X)) = − log(`(Y |f(θ, βc, X))) + log( qλ(θ|X, Y ) t(θ)) + log( qλ(β c|θ, X, Y ) r(β c)) − log( q(θ, βc|X, Y ) p(θ, βc|θ, X, Y ) ) ⇒ Eq(θ,βc|X,Y )[− log(p(Y |X))] = − log(p(Y |X)) = Eq(θ,βc|X,Y )[− log(`(Y |f(θ, βc, X)))] + Eq(θ,βc|X,Y )[log( qλ(θ|*X, Y* ) t(θ))] + Eq(θ,βc|X,Y )[log( qλ(β c|*θ, X, Y* ) r(β c))] − Eq(θ,βc|X,Y )[log( q(θ, βc|*X, Y* ) p(θ, βc|*X, Y* ) )] $$(23)$$ ⇒ − log(p(Y |X)) + DKL(q(θ, βc|X, Y )kp(θ, βc|*X, Y* )) = Eq(θ,βc|X,Y )[− log(`(Y |f(θ, βc, X)))] + Eqλ(βc|θ,X,Y )[DKL(qλ(θ|*X, Y* )kt(θ))] + Eqλ(θ|X,Y )[DKL(qλ(β c|*θ, X, Y* )kr(β c))] = Expected Loss z }| { Eq(θ,βc|X,Y )[− log(`(Y |f(θ, βc, X)))] + DKL(qλ(θ|*X, Y* )kt(θ)) | {z } Global Regularizer + Eqλ(θ|X,Y )[DKL(qλ(β c|*θ, X, Y* )kr(β c))] | {z } Local Regularizer =Eq(θ,βc|X,Y )[− log(`(Y |f(θ, βc, X)))] + DKL(q(θ, βc|*X, Y* )kt(θ)r(β c))) (23) ## C Proof Of Corollary 1 The proof of this corollary is derived from the proof of Theorem 3 in (Germain et al. (2016)). More specifically, Equation 246comes from Jensen inequality, Equation 25 is a result of Donsker-Varadhan change of measure inequality, and Equation 26 comes from Markov's inequality. ηED[− log `(Y |X)] = ηED[− log Eq(θ,βc|X,Y )[`(Y |X, θ, βc)]] ≤ ηED[Eq(θ,βc|X,Y )[− log `(Y |X, θ, βc)]] (24) ≤ ηEX,Y [Eq(θ,βc|X,Y )[− log `(Y |X, θ, βc)]] + DKL(q(θ, βc|X, Y )kπ(θ, βc)) + log Eπ(θ,βc)[exp ηED[− log(`(Y |X, θ, βc))] − ηEX,Y [− log(`(Y |X, θ, βc))]] (25) ≤ w.p > 1 − δ ηEX,Y [Eq(θ,βc|X,Y )[− log `(Y |X, θ, βc)]] + DKL(q(θ, βc|X, Y )kπ(θ, βc)) + log 1 δ EX,Y Eπ(θ,βc) -exp ηED[− log(`(Y |X, θ, βc))] − ηEX,Y [− log(`(Y |X, θ, βc))] (26) $$(24)$$ We note that as opposed to Theorem 3 in (Germain et al., 2016), we did not assume the empirical data samples (*X, Y* ) are derived IID from a data distribution and interestingly this proof, which is a slightly revised version of the proof of Theorem 3 in (Germain et al., 2016), is correct for non-IID empirical data samples as well. The rationale behind this is that none of the steps in the aforementioned proof relies on the IID property of the empirical data samples. More specifically, this proof starts with calculating the true risk, ED, and moving the logarithm inside the expected value using Jensen inequality. After that we use the Donsker-Varadhan inequality which says Eq[φ(f)] < DKL(qkπ) + log(Eπ[e φ(f)]) (Germain et al., 2016). To use this inequality we define φ(f) = ED − EX,Y . The crucial aspect of this proof is the Donsker-Varadhan inequality, which holds true for any function φ(f) = ED − EX,Y and whether the data we used to compute the empirical risk, EX,Y , is IID or not, doesn't affect its validity. Finally, the last inequality is the Markov's inequality that does not need IID assumption as well. ## D Extended Femnist Experiment Analysis In this appendix, we further analyze the FEMNIST experiment results to establish the robustness of the findings presented in Figure 5a. We demonstrate that local regularization consistently improves generalization 6Throughout this paper `(Y |X) stands for marginalized likelihood over the surrogate posterior, therefore we have: `(Y |X) = Eq(θ,βc|X,Y )[`(Y |*X, θ, β*c)]. $$(25)$$ $$(26)$$ ![15_image_0.png](15_image_0.png) Figure 6: Average FEMNIST test accuracy for different kl hyper parameters (τ ), averaged across 5 runs with different random seeds. ![15_image_1.png](15_image_1.png) Figure 7: Test accuracy of FEMNIST (τ = 10−9) vs. number of hold out clients. performance across different experimental setups, reducing the gap between non-participating and participating clients. We conducted additional experiments, running the FEMNIST scenario five times with different seed values (0, 10, 20, 30, 40). We then calculated the average and variance of both hold-out and participating test accuracy across these runs. The results, presented in Figure 6, provide a smoother visualization of the trend. As the figure demonstrates, we still observe a noticeably larger generalization gap for τ = 0 compare to τ > 0. This supports our initial findings and further emphasizes the importance of the KL divergence term in promoting generalization, even with increased experimental rigor. The experiment results provided in both Figure 5a and Figure 6 involved holding out only 20 clients (0.58% of the population) to ensure a fair comparison with other baselines. This small held-out set, might not fully represent the overall data distribution due to the inherent stochasticity in the remaining 3380 participating clients. To investigate this further, we conducted additional experiments on FEMNIST for τ = 10−9 with varying sizes of held-out sets (170, 340, 680, 850, and 1700 clients, representing 5%, 10%, 20%, 25%, and 50% of the population). As shown in Figure 7, these results indicate that increasing the size of the held-out set leads to an increase in the participation gap, with the participating clients eventually outperforming the nonparticipating ones. This suggests that the initial observation was indeed influenced by the small size of the held-out set and its potential deviation from the overall data distribution.
Review 1: Summary: This paper introduces Federated Variational Inference (FedVI), a novel algorithm designed specifically to enhance personalization and generalization in federated learning (FL). The authors claim that FedVI more effectively handles data heterogeneity. The FL process is formulated using a hierarchical generative model and formalized using Bayesian Inference. Variational Inference is then used to enhance learning efficiency. Theoretical analyses are provided to justify the performance of FedVI. Empirical studies demonstrate that FedVI outperforms state-of-the-art methods. Strengths and Weaknesses: Strengths: - The paper is well-written and well-motivated in general. Improving the effectiveness of FL is a promising research direction. - The presented idea behind FedVI is easy to follow. - Both theoretical and experimental results are presented to justify the method. Weaknesses: - It is not clear about the extra computation and communication incurred by FedVI. By looking at the major algorithm box, FedVI seems to be much more complex compared to FedAvg. - The extra computation and communication costs have not been explicitly studied in the experiments. - The experimental scales are too small. It would be essential to demonstrate the effectiveness of FedVI on larger-scale datasets, e.g., ImageNet. - Some similar baseline methods are missing, e.g., [1-2]. [1] https://arxiv.org/abs/2010.05273 [2] https://arxiv.org/abs/2302.04228 Requested Changes: As briefly mentioned in the "weakness" section, it would be essential for the author to make the following modifications: - Adding experiments on the extra computation and communication overheads of FedVI. And study the end-to-end wall clock time comparisons between FedVI and other baseline methods. - The experimental scales are too small. It would be essential to demonstrate the effectiveness of FedVI on larger-scale datasets, e.g., ImageNet. - Add comparisons between FedVI and baseline methods like [1-2]. [1] https://arxiv.org/abs/2010.05273 [2] https://arxiv.org/abs/2302.04228 Broader Impact Concerns: I don't find any Broader Impact concerns in the current manuscript. ================================================== Review 2: Summary: This paper presents an algorithm for learning a variational approximation for local posteriors in federated deep learning task. The motivation for the work is that due to heterogeneity among the clients, learning a single global model might lead to poor generalization. Authors also consider a stateless setting, where we cannot assume that clients can retain the local model (nor the local model) at their device. Instead of having a single global model, authors propose a hierarchical model for the data generating process over the clients. Using existing literature, authors are able to prove a PAC Bayes type of result. Their Corollary essentially says, that with probability $>1-\delta$, learning a VB approximation for the proposed model, reduces the the risk over the true data generating distribution (where the slack term of the risk is dependent on the $1/\delta$). On the implementation side, authors learn three separate (global) models: (1) the embedding model, which maps images into a latent space, (2) a global prediction model, and (3) a posterior construction model that outputs parameters for clients variational posterior of the local predictive model. The scores from the models (2) and (3) are combined before computing the prediction loss. The posterior reconstruction model (2), allows the stateless setting. I think the posterior reconstruction model works a lot like the encoding part of a VAE, which maps each data point to the particular posterior means and stds. In the setting of this paper, the posterior parameters are obtained for a batch of client's data. The performance of the proposed method is compared against various FL approaches on two data sets FEMNIST and CIFAR-100. On both of these data sets, the proposed algorithm beats the other methods with somewhat significant margin. Strengths and Weaknesses: # Strengths: I believe the motivation, both the personalization and the statelessness, for the work is well justified and something that would definitely be of interest for the TMLR audience. Also the connection between you generalization bound in eq. (9) and the ELBO itself is an interesting realization. The empirical evaluation seems to suggest that the proposed model outperforms the existing approach, even with some margin. # Weaknesses: ### Writing The writing of the paper needs to improve quite significantly. I do not quite understand for example how the scores computed by the local and global model are "merged" before updating the model. This would be a crucial bit of information for understanding how the local predictions can help in personalization. ### Experiments: So do I understand correctly, that if you set $\tau=0$ in your experiments, then you don't get any regularization from the local priors? If so, I guess the proposed setting wouldn't differ from having a single global model (assuming $\tau=0$)? Now, looking at Fig. 5a, while there are some points where the generalization gap is smaller than with $\tau=0$, it seems to be quite hard to predict how different $\tau > 0$ values work. Would it be possible to somehow repeat the inference multiple times to get less noisy estimates on how the test errors behave as a function of $\tau$? I'm mainly worried that since the FEMNIST is most likely the data set that has some strong heterogeneity among the clients, and if we cannot clearly witness the regularization there, then it might be hard to say if the regularization actually has some statistically significant effect. Requested Changes: **Major** - Further experiments on whether $\tau=0$ for the FEMNIST leads to significantly larger generalization gap than $\tau > 0$. - Clarify how the merging of local and global predictions is done **Minor** - What $\tau$ value was used for the results in Table 1 and Fig. 4? - Page 4: "the best approximation", in general this is not true since the quality of the approximation is completely dependent on the chosen surrogate distribution. - Page 4: The formula in the end: I guess this is actually negative ELBO? - Corollary 1: Please clarify what is the "slight generalization" over the Germain et al. 2016. To me, the bound in equation (9) looks very much the same as the bound in the prior work. - About the local parameters. On the 7th point of the listing in page 7, you say that "Both local and global parameters get updated through back propagation ...". So I guess as local parameters you mean the $\mu_k$ and $\sigma_k$, and not the $\beta$ (which is titled as local parameters on eq (18))? - When you say that "The local and global predictions are merged to get the predictions", how is the merging done? The samples fed to both classifiers are the same (just different parts of the feature vector) right? - I guess Figure 4 is not referred anywhere in the main text? - About Figure 5: If I have understood correctly, the $\tau$ parameter controls the level of local regularization through scaling the KL divergence between the variational posterior and the prior for $\beta_k$ parameter. Could you clarify, would the $\tau=1$ correspond to the actual ELBO objective? Or is there some scaling issue between the data and the prior that might lead to $\tau \neq 1$ being the correct scale? If not, then it would be interesting to have more discussion why the test performance gap seems to somewhat high for the $\tau=1$ in the FEMNIST case, as I would imagine it should lead to better generalization that the $\tau < 1$. - Appendix C: in the first line of eq. (24), it seems like you are writing $\ell(Y \mid X) = E_{q(\theta, \beta^c \mid X, Y)} [\ell(Y \mid X, \theta, \beta^c)]$. I assume that the $\ell(Y \mid X)$ and $\ell(Y \mid X, \theta, \beta^c)$ are the evidence and likelihood. Is this really true for variational $q$? Wouldn't you have that $\ell(Y \mid X) = E_{\pi(\theta, \beta^c)} [\ell(Y \mid X, \theta, \beta^c)]$? Or if $q$ is not the variational approximation, can you please clarify what it is? - Appendix C: what is the "||" after the 2nd $\leq$ (close to equation 24)? Is it supposed to be KL? - Appendix C: I believe the last expectation in the Donsker Varadhan inequality should have a log around it (talking about the expression after "After that we use the Donsker-Varadhan inequality which says"). **Very minor** - Page 14: "Morkov's inequality" - Some of the references look a bit odd. There are a lot of uncapitalized letters, as well as missing venues. - Possibly relevant cite: Han Guo, Philip Greengard, Hongyi Wang, Andrew Gelman, Yoon Kim, Eric P. Xing: Federated Learning as Variational Inference: A Scalable Expectation Propagation Approach. ICLR 2023 Broader Impact Concerns: I see no immediate unaddressed broader impact concerns in this work. ================================================== Review 3: Summary: This paper frames federated learning as a hierarchical probabilistic model, the key advantage of which being the ability to handle data heterogeneity. As inference is intractable, variational inference (VI) is proposed. The authors develop an approach in which point estimates of global parameters are maintained, and used to amortise inference over local parameters, the result being that local parameters do not have to be stored on individual clients. The method is evaluated on FEMNIST and CIFAR-100. Strengths and Weaknesses: It feels as though the paper is split into two distinct parts. In the first, the authors motivate the use of a hierarchical probabilistic model to handle data heterogeneity across clients, and VI for handling the challenge of inference. The generalisation bounds section is a nice addition; however, my main concern is in the correct handling of the hyper parameters $\gamma$ and $\tau$. For anything other than $\gamma, \tau = 1$, (8) does not lower-bound the evidence, so is not an ELBO as described. The authors should make this clear. Further, I suspect that Corollary 1 is only valid for $\gamma$ = $\tau$ also? I could be incorrect on this—clarification from the authors would be appreciated. In the second section, the authors describe their FedVI algorithm. Although one can piece together the parts of this algorithm to relate it back to the hierarchical model and variational approximation described in Section 3, this connection is far from explicit. Some examples of things that need to be made clearer: (1) the likelihood is parameterised by combining the outputs of two different functions, one using global and the other using local parameters. (a) make this clear and (b) how does this combination happen?. (2) The approximate posterior over local parameters, which itself should be clearly defined, is amortised given a subset of the observed data (it would be nice for connections to be drawn to other methods that use amortised inference, such as VAEs). (a) If this is what makes it “stateless”, then this should be made clear. (b) Also, if this is the key contribution, which I think it is, then highlight it. (c) I’m not convinced that this is actually doing VI (i.e. targeting the ELBO), as the expectation in (8) is now over the approximate posterior given the support set and the likelihood is only evaluated at a non overlapping query set. This feels closer to the neural process ML objective (see e.g. [1]). (3) How the posterior constructor model operates as a set function on the set of global features of the query set. Something that would help here is clearly defining the space in which the intermediate variables (e.g. $R^g_{k, q}$) exist. (3) I understand the notion of “stateless” to mean “no local parameters”. It would be great as to why this is beneficial in this case. Citations to use cases in the introduction would help, and clarity on why it’s an issue to store local parameters vs. computing them using a global model (aren’t these then stored locally anyway to obtain the local predictions?). I’m also somewhat confused by “local parameters remain on clients” in section 3.1—isn’t this exactly what you’re trying to avoid by being stateless? (4) There is no description of the baseline methods. Are the architectures used the same as the global model? At the bare minimum these should be included in the appendix. (5) “No assumptions are made about clients’ data generating distributions”. I’m not sure what you mean by this, as you’re using a very specific CNN architecture and categorical distribution which indicates that you are making assumptions. [1] Foong et al. (2020): Meta-learning stationary stochastic process prediction with convolutional neural processes, section 3.2. Requested Changes: Please address the issues I have raised above, all of which I believe are critical to securing my recommendation for acceptance. Broader Impact Concerns: N/A. ================================================== Metareview: Recommendation: Accept with minor revision Comment: The contribution and results of the paper are in principle sufficient for TMLR. I am nevertheless recommending acceptance subject to minor revision through addressing the following points: 1. Notation: the paper is sloppy by using $D_{KL}$ as a shorthand for $E_q \log(q/p)$ even when $q$ and $p$ are not defined over the same space (see e.g. Eqs. 6 and 8 + Appendix). This can be very confusing to readers because this does not follow usual rules of KL divergence, such as non-negativity. In order for the paper to be acceptable, this would need to be clarified, ideally by reserving the notation $D_{KL}$ just for the KL divergence. 2. Related to the comment 11 of reviewer QSyx, the "True risk" term in Eq. (9) does not appear to be the true risk because it is an expectation over $q$, not $p$. This would need to be clarified. 3. As requested by the reviewers, please expand the discussion of the FEMNIST results and their significance. 4. Your response included a new figure (Fig. 1 in the response) that does not seem to be in the revised paper. Please consider adding it. 5. The reviewers raised several followup comments in the discussion after the author response. Please review and respond to these. Typo: Appendix C refers to "Morkov's" inequality. ==================================================
# Towards Fully Covariant Machine Learning Soledad Villar∗*soledad.villar@jhu.edu* Department of Applied Mathematics and Statistics, Johns Hopkins University Mathematical Institute for Data Science, Johns Hopkins University Flatiron Institute, a division of the Simons Foundation David W. Hogg∗*david.hogg@nyu.edu* Center for Cosmology and Particle Physics, Department of Physics, New York University Max Planck Institute for Astronomy, Heidelberg Flatiron Institute, a division of the Simons Foundation Weichi Yao weichiy@umich.edu Michigan Institute for Data Science, University of Michigan George A. Kevrekidis gkevrek1@jhu.edu Department of Applied Mathematics and Statistics, Johns Hopkins University Los Alamos National Laboratory Bernhard Schölkopf bs@tuebingen.mpg.de Max Planck Institute for Intelligent Systems and ELLIS Institute, Tübingen Reviewed on OpenReview: *https: // openreview. net/ forum? id= gllUnpYuXg* ## Abstract Any representation of data involves arbitrary investigator choices. Because those choices are external to the data-generating process, each choice leads to an exact symmetry, corresponding to the group of transformations that takes one possible representation to another. These are the *passive symmetries*; they include coordinate freedom, gauge symmetry, and units covariance, all of which have led to important results in physics. In machine learning, the most visible passive symmetry is the relabeling or permutation symmetry of graphs. The active symmetries are those that must be established by observation and experiment. They include, for instance, translations invariances or rotation invariances of physical law. These symmetries are the subject of most of the equivariant machine learning literature. Our goal, in this conceptual contribution, is to understand the implications for machine learning of the many passive and active symmetries in play. We discuss *dos and don'ts* for machine learning practice if passive symmetries are to be respected. We discuss links to causal modeling and argue that the implementation of passive symmetries is particularly valuable when the goal of the learning problem is to generalize out of sample. We conjecture that the implementation of passive symmetries might help machine learning in the same ways that it transformed physics in the twentieth century. ## 1 Introduction Many important ideas in machine learning (ML) have come from—or been inspired by—mathematical physics. These include the kernel trick (Courant & Hilbert, 1953; Schölkopf & Smola, 2002) and the use of statistical mechanics techniques to solve probabilistic problems (Hastings, 1970; Gelfand, 2000). Here we suggest another connection between physics and ML, which relates to the representation of observables: When features and labels are represented in a mathematical form that involves investigator choices, methods of ML (or any ∗joint first author relevant model, relationship, method, or function) ought to be written in a form that is exactly equivariant to changes in those investigator choices. These ideas first appear in the physics literature in the 1910s (most famously in Einstein 1915). They are given in the introduction of *The Classical Groups* (Weyl, 1946) as a motivation to study group theory. Literally the first sentences of *Modern Classical Physics* (Thorne & Blandford, 2017) are [...] a central theme will be a Geometric Principle: The laws of physics must all be expressible as geometric (coordinate-independent and reference-frame-independent) relationships between geometric objects (scalars, vectors, tensors, ...) that represent physical entities. This Geometric Principle leads to the important physical symmetries of coordinate freedom and gauge symmetry; a small generalization would include what we will refer to as units covariance (see the glossary in Appendix A). Each of these symmetries has led to fundamental results in physics. Some of these ideas are also exploited in ML, in particular in the geometric deep learning literature (Bronstein et al., 2021; Weiler et al., 2021a). We argue—in this purely conceptual contribution—that analogs of these symmetries could have an impact on ML, and thus increase the scope of group-equivariant methods in ML. In natural science, there are two types of symmetries (see, for example, Section 4.1 of Rovelli & Gaul 2000). The first kind is *passive*, arising from the arbitrariness of the mathematical representation described above. An example familiar in ML is the equivariance of functions on graphs to the relabeling of the graph nodes. This is an exact, passive symmetry; graph neural network architectures (GNNs) build this passive symmetry in by design (Bruna et al., 2013; Duvenaud et al., 2015; Gilmer et al., 2017; Hamilton, 2020). See Huang et al. (2023) for a recent work describing passive and active symmetries in GNNs. An example familiar to physicists is what we call *units covariance*, which is the requirement that any correct description of the world has inputs and outputs with the correct units (and dimensions; see Appendix A for definitions). This symmetry is extremely powerful (see Section 3). The second kind of symmetries is *active*. These are the ones that must be established by observations and experiments. The fundamental laws of physics do not seem (at current precision) to depend on position, orientation, or time, which in turn imply conservation of momentum, angular momentum, and energy (the celebrated theorem of Noether 1918). Active symmetries like these are empirical and could (in principle) be falsified by experimental tests. Both active and passive symmetries can be expressed in terms of group or groupoid actions and equivariances, but their epistemological content and range of applicability are very different. In this contribution, we argue that passive symmetries apply to essentially all data analysis problems. They have implications for how we structure ML methods. Although we provide some examples, most of our contributions are conceptual. ## Our Contributions: - We introduce the concept of passive and active symmetries to ML. We give a formal definition of passive and active symmetries in terms of group actions and explain how passive symmetries are always in play in problems using real-world data. - We provide guidance on how to structure ML models so that they respect the passive symmetries. We call out some current standard practices that can prevent models from obeying symmetries. We give particularly detailed guidance in the context of data normalization. - We illustrate with toy examples how enforcing passive symmetries in model structure and in normalization can improve regressions. - We demonstrate that imposing passive symmetries can lead to the discovery of important hidden objects in a data problem. We show that a passively equivariant problem can often be made actively equivariant by the introduction of latent variables with appropriate group-theoretic properties. - We draw connections with causal inference. One is that all causal graphs and mechanistic models are constrained to be consistent with the passive symmetries. Another is that the determination that a data problem has all the inputs necessary to express the symmetry exactly looks like a causal inference. We also explain how active symmetries can be expressed in terms of interventions. - We provide a glossary (in Appendix A) that can be used to translate terminology and relate ideas between physics and ML. ## 2 Passive Symmetries Passive symmetries arise from redundancies or free parameters or investigator choices in the representation of data. They are to be contrasted with the active symmetries, which arise from observed or empirical invariances of the laws of physics with respect to parameters, like position, velocity, particle labeling, or angle. Passive symmetries can be established with no need of observations, as they arise solely from the principle that the physical world is independent of the mathematical choices we make to describe it. The groups involved in coordinate freedom can be large and complicated (for example, groups of reparameterizations). In contrast, a big part of the literature on equivariant ML is implicitly or explicitly looking at *active* symmetries. This is possibly because in most problems the coordinate system is fixed before the problem is posed, and both training and test data are expressed in those fixed coordinates. If a data set is made with a fixed coordinate system, but still exhibits an *observable* invariance or equivariance with respect to (say) rotations, then that represents an active symmetry. However, cases of exact active symmetries are rare; they only really appear in natural-science contexts like protein folding or cosmology. For example, in a protein folding problem, the way the protein folds may not depend on its orientation in space (rendering the problem actively O(3) equivariant). This finding relies on the (empirical) observation that the local gravitational field (on Earth), for example, does not affect the folding. This may be approximately true or assumed or experimentally established; it is an active symmetry. In contrast, the fact that the protein folds in a way that doesn't depend on the coordinate system *chosen to describe it* is absolutely and always true; it is not experimentally established; it is a passive symmetry. The relationship between active and passive symmetries is reflected in the relationship between what are sometimes called active and passive transformations, or *alibi* and *alias* transformations, depicted in Figure 1. An active or alibi transformation is one in which the objects of study are moved (rotated, translated, interchanged, etc.). A passive or alias transformation is one in which the coordinate system in which the objects are represented is changed (rotated, translated, relabeled, etc.). Mathematically, the two seem very similar: For example, how do we know whether we rotated all the vectors in our problem by 30 deg, or else rotated the coordinate system used by −30 deg? The answer is that if you rotated *absolutely all* the vectors (and tensors) in your problem, including possibly many latent physical vectors, then there would be no mathematical difference. However, this is not possible in practice. In real problems, where some vectors can't be actively rotated (think, for example of the local gravitational-field vector, or the vector pointing towards the Sun), or some may not be known or measurable, the two kinds of transformations are different. This problem—that a passive symmetry only becomes an active symmetry when it is possible to transform every relevant thing correspondingly—suggests that it might be hard to implement or enforce an exact passive symmetry in a real data-analysis problem. It requires us to incorporate all relevant contextual information. How do we know if all relevant features are part of our data set? We could perform the protein-folding experiment in a closed, isolated environment to make sure no external forces are in play? This is impossible for many practical applications, and furthermore, there could still exist fundamental constants that are not part of our model or knowledge (see Section 5). Another approach is to perform the experiment multiple times after actively putting the molecules into different orientations. If the protein folds differently, we learn that the problem is not symmetric with respect to the 3d coordinates of the molecule, and therefore when a rotation is performed there must be at least one more vector that needs to be rotated as well (for instance, the gravity vector or the eigenvectors of some stress tensor, say). This identification of all necessary inputs to establish the passive symmetry is similar to the problem of performing interventions to learn the existence of confounding factors in causal inference (see Section 6). ![3_image_0.png](3_image_0.png) Figure 1: Figure depicting the difference between active and passive transformations. *(Left panel)*: The passive or alias transformation corresponding to a rotation of the coordinates through an angle θ in the xy-plane. The equivariance of the dynamics with respect to this transformation is a passive symmetry. *(Right panel)*: The active or alibi transformation corresponding to a rotation of the double pendulum state through an angle −θ in the xy-plane. Equivariance with respect to this transformation is an active symmetry. Once a passive symmetry—and all relevant contextual information—is identified, we want to write the data analysis problem or learned function such that it is exactly *equivariant* with respect to the relevant group: If the coordinate system of the inputs is changed, the coordinate system of the output should change correspondingly. ML methods that are not constrained to respect passive symmetries are doomed to make certain kinds of mistakes. We will provide some examples in Section 8 and Section 9. The most restrictive form of the Geometric Principle quoted in Section 1 states that physical law must be written in terms of vectors, tensors, and (coordinate-invariant) scalars. These objects can only be combined by rules set out in the Ricci calculus (Ricci & Levi-Civita 1900; sometimes called Einstein summation notation, Einstein 1916). This calculus was introduced to make objects equivariant to coordinate diffeomorphisms on curved manifolds, but it applies to O(3) and Lorentz symmetry as well. In the Ricci calculus, objects are written in index notation (a scalar has no indices, a vector has one index, and a k-tensor has k indices), outer products are formed, and only certain kinds of sums over pairs of indices are permitted. When the inputs to a function are scalars, vectors, and tensors, and the function conforms to the rules of the Ricci calculus, the function will produce a geometric output (a scalar, vector, or tensor,0 depending on the number of unsummed indices), and the function will be precisely covariant to rotations and reflections of the coordinate system. This is how a large class of passive symmetries is enforced in physics contexts. There are many other passive symmetries, including coordinate diffeomorphisms, reparameterizations (including canonical transformations in Lagrangian and Hamiltonian systems), units covariance (see Section 3), and gauge freedom. Some are easy to implement in ML contexts and some are difficult; not all group equivariances have practical implementations useful for ML methods available at present. Convolutional neural networks (LeCun et al. 1989) are very effective even when strict translation symmetry is not active; this effectiveness might be related to the connection to the passive translation symmetry of the image pixel grid. Sometimes it is difficult to tell whether a symmetry is active or passive. For example, the law of gravity is explicitly O(3) invariant: If you rotate all of the position vectors, you rotate all of the forces correspondingly too. If you rotate all of the initial conditions, you rotate all of the gravitational trajectories correspondingly too. But this symmetry is also a passive symmetry: The law of gravity does not depend on the orientation (or handedness) of the coordinate system. If an active symmetry is in play, the physical law can often be written in terms of invariants such that the symmetry is enforced by construction or definition, thereby making it also a passive symmetry. The discovery of general relativity (Einstein, 1915) can be seen as the discovery that active symmetries—the speed of light is the same for all observers, and the gravitational mass equals the inertial mass—can be converted 0It should be noted here that with the word "vector" and "tensor" here we are making specific technical reference to true vectors and tensors in 3-space, subject to passive O(3) symmetries, like (physical) velocities, accelerations, and stress tensors. We are not including arbitrary lists or tables of data or coefficients, which are sometimes called "vectors" and "tensors" in ML contexts. See Appendix A for more detail. into passive symmetries: When laws are written in a form consistent with the passive symmetries, they automatically enforce the corresponding active symmetries. Indeed, the equations of general relativity were found by looking at every differential equation (to some degree) consistent with the passive symmetry of coordinate diffeomorphisms on curved spacetime manifolds until one was found that reduced to Newtonian gravity in the weak-field limit. We stress that these kinds of insights had a big impact on physics (Earman & Glymour, 1978); only a few years prior to 1915, such considerations would have seemed highly unusual; now this form of argument is canon in theoretical physics (see, for example, Zee 2016). That evolution motivates this contribution; passive symmetries do not feature in most of today's ML practice—if the development of physics is any indication, their potential could be significant. Some valuable ML research has started recently along these directions (Weiler et al., 2021a; Bronstein et al., 2021). ## 3 Example: Units Covariance Perhaps the most universal passive symmetry is units covariance—the behavior of a system does not depend on the units system in which we write the measured quantities. It is a passive symmetry with extremely useful consequences. Consider a mass m near the surface of the Earth, close enough to the surface such that the gravitational field can be considered to be determined by a constant (not spatially varying) vector with magnitude g and direction downwards. *Question 1:* If this mass m is dropped (released at rest) from a height h from above the ground, how much time T does it take to fall to the ground? *Question 2:* If this mass m is launched from the surface at a velocity of magnitude v at an angle θ to the horizontal, how much horizontal distance L will it fly before it hits the surface again? Assume that only *m, g, h* enters the solution;1In particular, assume that the height h and the velocity v are both small enough so that air resistance, say, can be ignored. The answers to these questions are almost completely determined by dimensional (or units-covariance) arguments (see Appendix A for definitions). The mass m has units of kg, the gravitational acceleration magnitude g has units of m s−2, the velocity magnitude v has units of m s−1, the time T has units of s, and the lengths h and L have units of m. The angle θ is dimensionless. The only possible combination of *m, g, h* that has units of time is αph/g, where α is a dimensionless constant, which doesn't depend on any of the inputs. The only possible combination of *m, g, v, θ* that has units of length is β(θ) v 2/g, where β(θ) is a dimensionless function of a single dimensionless input. That is, both Question 1 and Question 2 can be answered up to a dimensionless prefactor without any training data. And both of those answers don't depend in any way on the input mass m (which is the fundamental observation that leads to general relativity; Einstein 1915). This shows that a function—and even a fundamental physical relationship—can sometimes be inferred from units covariance only, that is, from a purely passive symmetry, combined with the *empirical* knowledge that the solution is *independent* of all other observables (which itself is a causal assumption). Unit covariance is widely used in numerical methods, and it has been discussed in ML previously (Villar et al., 2023; Bakarji et al., 2022; Xie et al., 2022). It can help with training, predictive accuracy, and out-of-sample generalization. ## 4 Formal Definition Consider X to be space of all possible physical states of a specific system (for instance x ∈ X could be the positions, velocities, masses, spins, and charges of a set of particles, at a time or possibly at a set of times). We consider maps {Φi: X → H }i∈I where H is the space of encodings (or representations) of the values of those positions, velocities, masses, and so on, in some units system and some coordinate system. That is, any element z ∈ H will be a list of real values of vector and tensor components and scalars. Different maps Φi will have (in general) different coordinate origins, different axis orientations, and different units of measurement. 1We will return to this seemingly innocuous point below. We note that it is an *empirical* statement, which will turn out to have rather significant implications. Provided that every Φi records all of the information necessary to describe the state x ∈ X (or, equivalently, every element z ∈ H contains all of the information necessary to describe the state), for any two encodings Φi and Φj there is an invertible morphism β i j : H → H that makes the diagram (1) commute. $$\begin{array}{c}{{\mathcal{X}\ \xrightarrow{i d}\ \mathcal{X}}}\\ {{\Phi_{i}\Big\downarrow}}\\ {{\mathcal{H}\ \xrightarrow{\beta_{j}^{i}}\ \mathcal{H}}}\end{array}\Big\downarrow\Phi_{j}$$ $\quad(1)$ . The passive symmetries comprise the group P of invertible morphisms β i j that makes the diagram commute. The group P consists of all the possible changes of units or coordinates or automorphisms between encodings or observables. For example, take X to be the space of states of a protein molecule. Each map Φi could encode the positions of each of its atoms in some coordinate system. The passive symmetries include reordering of the atoms, changes of the coordinate system by any invertible morphism, and changes to the units in which positions (lengths) are measured. Active symmetries, on the other hand, can be thought of as transformations of the world that preserve an observable property. They involve interventions in the physical system, and therefore they are typically empirical and approximate. Not every passive symmetry corresponds to an active symmetry, nor vice versa. To define the active symmetries we fix Φ : X → H an encoding as above; a function F : H → Y , where F is a function that delivers a possible observable or prediction or system property; and a group G that acts on the X , H and Y via actions τ , β and ρ respectively. An element y ∈ Y contains some prediction or observable of interest in the system, such as the energy or the future time evolution (trajectory). Given a group element g ∈ G we might draw this commutative diagram: $$\begin{array}{c c c}{{\mathcal{X}}}&{{\xrightarrow{\Phi}}}&{{\mathcal{H}}}&{{F}}\\ {{}}&{{}}&{{\Big\downarrow\tau(g)}}&{{}}\\ {{\mathcal{X}}}&{{\xrightarrow{\Phi}}}&{{\mathcal{H}}}&{{F}}\end{array}\xrightarrow{\mathcal{Y}}$$ $$\text{(2)}$$. We say that the tuple (*G, F, β, ρ*) represents an active symmetry of X if the diagram (2) commutes. To continue the example in which X is the space of states of a protein molecule: If F computes the total electrostatic energy of the protein, there is an active symmetry corresponding to the group G = O(3) of rotations and reflections, in which β(g) is the standard matrix representation of g applied to all the position vectors, and ρ(g) is the identity operator for all g ∈ G. This symmetry is active in the sense that it says how something changes (the energy, and it doesn't) when the molecule's state is changed (it is rotated in space). The alias vs alibi distinction (Section 2) maps onto the correspondence of related passive and active symmetries. The active symmetries correspond to *interventions* in the system, while passive symmetries are purely in the realm of representation. Most of the equivariant ML literature is focused on active symmetries. Projects begin with the question: What active symmetries are in play in this system? In what follows, we reserve the word "equivariance" for active symmetries and use the word "covariance" for passive symmetries, consistent with the use of the word "covariance" in physics contexts (see Appendix A). ## 5 Experiments And Examples Black-body radiation: An important moment in the history of physics was the discovery that the electromagnetic radiation intensity Bλ (energy per time per area per solid angle per wavelength) of thermal black-body radiation can be described with a simple equation (Planck, 1901) $$B_{\lambda}(\lambda)=\frac{2\,h\,c^{2}}{\lambda^{5}}\,\left[\exp\frac{h\,c}{\lambda\,k\,T}-1\right]^{-1}\;,$$ −1, (3) $\left(3\right)$. where h is Planck's constant, c is the speed of light, λ is the wavelength of the electromagnetic radiation, k is Boltzmann's constant, and T is the temperature. In finding this formula, Planck had to posit the existence (and units) of the constant h = 6.62607015 × 10−34 kg m2s −1(Planck's original value was presented with less precision and in erg s, which are different units but the same dimensions). Prior to the introduction of h, the only dimensionally acceptable expression for the black-body radiation intensity was Bλ(λ) = 2 *c k T /λ*4, which is the long-wavelength (infrared) or high-temperature limit of (3). Planck's discovery solved the "ultraviolet catastrophe" of classical physics. This is the problem that, classically, the black-body spectrum, or any thermal object, ought to contain infinite numbers of excited modes at short wavelengths, or high frequencies, and thus infinite energy density. Planck's solution seeded the development of quantum mechanics, which governs the behavior of all matter at small scales, and which cuts off the ultraviolet modes through quantization of energy. Planck's problem can be solved almost directly with the passive symmetry of units covariance. That is, the exponential cut-off of the intensity appears at a wavelength set by the temperature and a new constant, that must have units of action (or action times c, or action divided by k, or one equivalent in terms of the lattice of dimensional features, see Appendix B and Villar et al. 2023). In Figure 2 (left) we perform the following toy experiment: We generate noisy samples of intensities as a function of wavelength and temperature according to (3), and the learning task is to predict the intensity for different values of wavelengths and temperatures. We perform three experiments, described in Appendix B (A) a units-covariant regression (employing the approach of Villar et al. 2023) using only λ, T, c, k; (B) a units covariant regression with an extra dimensional constant found by cross-validation; and (C) a standard multi-layer perceptron regression (MLP) with no units constraints. Our results show that no units-covariant regression for the intensity as a function of *λ, T, c, k* can reproduce accurately the intensity Bλ. However when the regression is permitted to introduce a new dimensional constant (but enforce exact units-covariance given the new constant), it finds a constant with units that is consistent with h (or h times a combination of c and k). The units-covariant model with an extra constant outperforms the baseline MLP. Naïvely this suggests that passive symmetry brings new capabilities. Springy double pendulum: The double pendulum connected by springs is a toy example often used in equivariant ML demonstrations (Finzi et al., 2021; Yao et al., 2021; Villar et al., 2023). The final conditions (position and velocities of both masses after elapsed time T) are related to the initial conditions (position and velocities of the masses at the initial time), and the dynamics is classically chaotic. This means that prediction accuracy, in the end, must be bounded by considerations of the fundamental mathematical properties of dynamical systems. The system is subject to a passive O(3) symmetry (equivariance with respect to orthogonal coordinate transformations), an active O(2) symmetry (equivariance with respect to rotations and reflections in the 2D plane normal to the gravity), and an active time-translation symmetry, arising from the fact that the total energy is conserved. The O(3) symmetry is passive, because it is guaranteed by the fact that all vectors must be described in a coordinate system; nothing physical can change as the vectors undergo passive transformations because of coordinate-system changes. The O(2) symmetry is active, because it is an experimental fact that if the initial conditions are changed by an active or alibi rotation in the plane perpendicular to gravity, the dynamics and final state rotate accordingly. The O(2) active symmetry corresponds to the set of transformations in O(3) that fix the gravity vector. The passive O(3) symmetry requires that the coordinates of all relevant vectors are transformed identically, the positions and momenta of both masses and the gravity vector. If the model doesn't have access to all relevant vectors as inputs then the predictions will not necessarily be O(3) equivariant. We perform an experiment in which we predict the dynamics of the double pendulum using O(3)-equivariant models. The symmetries are implemented by converting the network inputs (scalars and components of vectors) into invariant scalar quantities according to the Ricci calculus (which explicitly encodes O(3)), building the model in the space of the invariant scalars (as per Villar et al. 2021). These O(3)-invariant scalars are used to parameterize an O(3)-invariant Hamiltonian, and the O(3)-equivariant dynamics are predicted by integrating the Hamiltonian using a symplectic integrator, as proposed by Sanchez-Gonzalez et al. (2019) and implemented in Yao et al. (2019). More details are given in Appendix C. ![7_image_0.png](7_image_0.png) Figure 2: *(Left panel)* We predict the intensity of black body radiation as a function of wavelength and temperature. For all experiments, we use an MLP consisting of 3 layers with 20 hidden units each. The standard MLP uses wavelength and temperature as features and it doesn't require the output to be dimensionally correct. The *units covariant without extra constant* learns a scaling of the only dimensionally correct object one can construct with inputs *λ, T, c, k* (see description main in text). The units covariant with extra dimensional constant incorporates a constant with units [kg, m,s, K] *∈ {−*2, −1, 0, 1, 2} 4 as an input feature, it performs a units covariant regression with the original features *λ, T, c, k*, and the extra constant. It then selects a constant with a low validation error and reports the results on the test set. The constant learned for the depicted plot is 1.61e52 kg−1m−1s −1K−1, which is the same units and similar magnitude to the valid physical combination c k h−2. *(Right panel)* Performance of learning the dynamics of the springy double pendulum. We consider the three models (described in the main text): (Known-g) an O(3)-equivariant model where the gravity is an input to the model, (No-g) an O(3)-equivariant model where the gravity is not given, and (learned-g) an O(3)-equivariant model that uses the position and momenta as well as an unknown vector that the model learns. The results show that O(3)-equivariance permits the learning of the gravity vector from data with only minimal impact on performance. See Appendix C for a more detailed description of the experiment. The models considered here are *(Known-g)*—an O(3)-equivariant model that has the positions, momenta, and gravity vector all as features (similar to the models in Villar et al. 2021; Yao et al. 2021); *(No-g)*—an O(3)- equivariant model that is missing the gravity vector as an input feature; and *(Learned-g)*–an O(3)-equivariant model that has the position, momenta and an extra unknown vector as features. The latter model optimizes model weights along with the unknown vector. In the right panel of Figure 2 we show the performance of the three models. We remark that in *(Learned-g)*, the learned vector in the performed experiments was nearly parallel to the true (but unknown) gravity vector g; the angle between the learned and true gravity vector ended up at 0.00016 radians. Non-covariant data normalization In section 9 we discuss covariant vs non-covariant data normalization procedures. In appendix C we provide experiments (in the springy double pendulum setting) that empirically show that non-covariant data normalization can hurt the performance significantly, whereas covariant data normalization does not. ## 6 Connections With Causality There is nothing statistical about the notion of passive symmetries, and thus everything we have said above also applies to causal models (Peters et al., 2017). There are, however, a few comments specific to causality. The passive symmetry discussed in Section 3—and indeed all passive symmetries—can also deliver information pertaining to the (hard problem of) inference of causal structure: treating g as a constant, we can construct a structural causal model with the following vertices: (a) an initial value of v, (b) a value of m, chosen independently, and (c) a final value of L, affected by a noise term θ. Time ordering implies that possible causal arrows are from *v, m, θ* to L. As argued above, dimensional analysis rules out the arrow m → L, leaving us with the non-trivial result that in the causal graph, only *v, θ* cause L. As in Section 3, this conclusion can be reached without any training data or interventions. That said, dimensional analysis makes a strong assumption, which is that all relevant quantities for predicting L have been specified in the list *m, g, v, θ*. For example, if the projectile is large enough or the speed v is high enough, air resistance will come into play, and the size of the object and the density of air will enter, bringing new variables and new combinations of variables that matter to the answer. This difficulty is related to the problem in causal inference of knowing or specifying all possible confounding variables. This can also be linked to the notion of experimental interventions. Suppose we assume that only certain quantities come into the solution (say, *m, g, h*). How would we confirm this in practice? In essence, this is not a probabilistic statement, but one about the behavior of a system under interventions. A set of experiments can indicate that a certain outcome (or effect variable) depends on a certain set of input (cause) variables but is independent of certain other potential cause variables. In this case, the physical law is not inferred from dimensional arguments alone, but from a combination of dimensional and causal arguments. Even if interventions are not available (for g, for example), physicists trying to infer a law will not do so based (purely) on input-output data: they will have prior knowledge from related problems informing them as to which variables are relevant. For example, we may know from having previously solved a related problem that we expect a problem to depend on g. This is a form of qualitative *transfer* that we expect will also become relevant for model transfer in ML (Rojas-Carulla et al., 2018). Finally, we remark that causal language appeared above in Section 2 where we implicitly contrast the active symmetries with the passive symmetries in terms of interventions: The active symmetries are those that make predictions for experiments in which interventions have been made (the molecule has been rotated with respect to the gravitational-field vector, for example). ## 7 Connections To Current Ml Practice Most present-day ML implementations don't impose exact symmetries. Sometimes they approximate equivariances by means of data augmentation (Chen et al., 2020; Huang et al., 2022). In this work we mostly focus on exact symmetries: Given data spaces X and Y and a group G acting on X and Y , equivariant ML restricts the function space to those satisfying f(g · x) = g · f(x) for all f ∈ F, g ∈ G, x ∈ X. There are three main approaches to perform optimization in the space of equivariant functions: - Parameterizing the space of equivariant functions by extending the notion of group convolutions or weight sharing (Kondor & Trivedi, 2018; Cohen & Welling, 2016; Weiler et al., 2021b). - Explicitly parameterizing the space of equivariant functions via equivariant linear layers (via irreducible representations (Thomas et al., 2018; Geiger & Smidt, 2022; Kondor, 2018), or otherwise (Maron et al., 2018; Finzi et al., 2020; 2021). - Finding a set of invariant features and expressing invariant/equivariant functions in terms of those features. Related ideas have been studied in differential geometry and invariant theory (Fels & Olver, 1998), and recently have been used in machine learning (Villar et al., 2021; Blum-Smith & Villar, September 2023; Cahill et al., 2022; Dym & Gortler, 2022; Kaba et al., 2023). This can also be done by imposing symmetry as a soft constraint (Shakerinava et al., 2022; Gupta et al., 2023). The three approaches achieve similar goals, but their practical implementation may be dramatically different. For example, efficiently computing a complete generating set of invariant/equivariant features may be prohibitive, especially for large finite groups. On the other hand, in some cases, one needs to go to high-order tensors for the linear layers to be expressive enough, and this may be hard to construct. More often, it may be possible to construct such a family, but we may lack proof that they are universal approximators of all invariant/equivariant functions within some well-defined context, even in a limiting sense. Even the non-trivial diffeomorphism symmetries of general relativity have been considered for ML (Weiler et al., 2021a). And aside from the previously mentioned results in Convolutional/Graph Neural Networks, another example of successful exact universal parametrization of a family of functions is the implementation of symplectic networks, which exactly preserve a differential 2-form, the symplectic form, on the associated manifolds (Jin et al., 2020; Burby et al., 2020). Their use most relevant in the study of Hamiltonian systems. Overall, equivariant ML models can predict the properties and behaviour of physical systems (see Cheng et al. 2019), and have plenty of scientific applications (Batzner et al., 2022; Musaelian et al., 2022; Stärk et al., 2022; Yu et al., 2021; Wang et al., 2022). Interesting theoretical developments analyze the implicit bias, generalization error, and sample complexity of equivariant ML models (Petrache & Trivedi, 2023; Tahmasebi & Jegelka, 2023; Lawrence et al., 2021; Bietti et al., 2021; Elesedy & Zaidi, 2021; Elesedy, 2021; Huang et al., 2023; Mei et al., 2021). ## 8 Dos And Don'Ts MacKay famously wrote (see Muldoon 2021) Principal Component Analysis is a dimensionally invalid method that gives people a delusion that they are doing something useful with their data. If you change the units that one of the variables is measured in, it will change all the "principal components" This comment is aligned with our mission, but also misleading: If a rectangular data set contains only data with identical units (that is, all features of all records have the same units), then PCA does exactly the right thing. That said, if a rectangular data set has features with different units (for example, if every record contains a position, a temperature, a voltage, and a few intensities), then indeed the output of PCA will be extremely sensitive to the units system in which the features are recorded, and thus not invariant to the units choices. Consider a kernel function with inputs that are lists of features with different units. If the kernel function involves, say, an exponential of a sum of squares of differences of the input features, the output of the kernel function cannot obey the passive symmetry of units covariance. Quantities with different units cannot be summed, and dimensional quantities cannot be exponentiated. On the other hand, if a kernel function can be chosen that is units covariant, then the result of a kernel algorithm can in principle be covariant. These considerations are relevant for the maximum margin hyperplane in kernel support-vector machines (Boser et al., 1992), eigenvectors in kernel PCA (Schölkopf & Smola, 2002), or Gaussian processes (Williams & Rasmussen, 2006). Learning involves optimization. Optimization is of a scalar cost function. If passive geometric groups are in play, like O(3), the parameters that are explicitly or implicitly components of vectors can only be combined into the scalar objective through the Euclidean norm. Otherwise the scalar objective isn't scalar in the geometric sense of "invariant to O(3)", and the optimization won't return a result that is invariant (or equivariant) to O(3). Similarly, if the components of the vector are normalized differently before they are summed in quadrature, the objective won't be invariant to O(3). And similarly, if all the different contributions to the objective aren't converted to the same units before being combined, the model won't be units covariant. The common practices of making objectives with functional forms other than Euclidean norm, normalizing features with data ranges, and combining features with different units, all make common ML methods, by construction, inconsistent with the passive symmetries in play. We say more about normalization below in Section 9. Neural nets, in their current form, violate many rules. For example: Transcendental functions like exp() and arctanh() and most other nonlinear functions can only be applied to scalars—that is, not components of vectors or tensors but only scalars—and only dimensionless. That means that the nonlinearities in neural networks are (or should be) implicitly predicated on the weights removing the units of the input features, and the linear combinations performing some kind of dot products on the inputs. That, in turn, means that the internal weights in the bottom and top layers of a neural network *implicitly* have geometric properties and units. They have geometric properties and units such that the latent variables passed into the nonlinear functions are dimensionless scalars. Because they have these properties, a trained neural network cannot be covariant in the end, unless the inputs and outputs are already covariant scalars. There are exceptions to the restrictions on nonlinear functions: If nonlinearities are mathematically homogeneous, as it is for a pure monomial, or for the RELU function, dimensional scalars (but not vector or tensor components) can be taken as inputs. It is interesting to ask whether the success of RELU in ML might be related to its homogeneity. Above we said that the weights in a neural network implicitly have geometric properties and units. What are these? Imagine, say, at the input layer, that three of the inputs are the components (v1, v2, v3) of a velocity vector, and, at the next layer, these have been multiplied by weights, summed, subtracted from a threshold, and passed into a nonlinear function (such as a sigmoid). Given that a nonlinearity is in play, implicitly the output of the multiplication by weights and summation is a dimensionless scalar—it is inconsistent with the passive symmetries of O(3) covariance and units covariance for a nonlinearity to be applied to anything other than a dimensionless scalar. This condition will only be met if implicitly the three weights (W1, W2, W3) that multiply these vector components are themselves the components of an O(3)-covariant vector with units of inverse velocity. If the network has any nodes in the next layer that have graph connections (weights) to only one or two of the three components (v1, v2, v3), that is, if the network is sparse in the wrong ways, these implicit conditions cannot be met. The passive symmetries thus also put conditions on network architecture or graph structure. L1 and L∞ norms are often inconsistent with the passive symmetries. This is because the sum of absolute values of input components, and the maximum of inputs, are rarely either geometrically, or from a units perspective, covariant. There is a rare exception if all features have the same units, and none of the features are components of geometric objects (they are all dimensionless scalars). Similarly, regularizers favoring flat loss minima (Hochreiter & Schmidhuber, 1997; Dinh et al., 2017; Petzka et al., 2021) are often not units covariant, changing their values under certain weight transformations that leave the overall function invariant. If reformulated as a regularizer that is a covariant function of the training points, this problem vanishes (von Luxburg et al., 2004). Data normalization, batch normalization, and layer normalization are all generally brutal and often violate model equivariances (Aalto et al. 2022 and see Section 9). Finally, we mention that passive symmetries play a crucial role also when it comes to latent variable models, since unobserved latent factors usually come with a large class of allowed gauge transformations (permutations, rotations in the latent space, and coordinate-wise nonlinear transformations) which should be incorporated correctly when studying notions of identifiability (Khemakhem et al., 2020; Buchholz et al., 2022). ## 9 Example: Normalization To make contemporary neural network models numerically stable, it is conventional to normalize the input data, and possibly also layers of the network with either layer normalization or batch normalization. This normalization usually involves shifting and scaling the features or latent variables to bring them closer to being zero mean and unit variance (or something akin to these). For our purposes here, let's focus on data normalization and assume that it works as follows: The training data contains features X which are N × M, where N is the number of training data examples, and M is the number of features per data point. In the simplest possible form, the training data X are given a shift and scaling as $$X^{\prime}\leftarrow\sigma^{-1}\left(X-\mu\right)\,,$$ −1(X − µ) , (4) where σ is some scale or list of M scales derived from the features in the training data set, and µ is some shift or list of M shifts derived from the features in X. It is not uncommon for σ to be a root-variance of the features (or a mean absolute deviation or other distribution-width measure) and for µ to be a mean or median. Naïve normalization like this will in general break the passive symmetries of geometry and units (Aalto et al., 2022). For one, different individual features in X will have different units. It does not make sense to add or average (nor add nor average in the square) features with different units. For another, if a subset of 3 features in X are the components of a 3-vector subject to O(3) symmetry or a subset of 9 features in X are the components of a tensor subject to O(3) symmetry, these components cannot be summed or medianed without violating O(3) equivariance (and thus passive-symmetry covariance), nor can they be independently scaled without violating O(3). What should be done instead? For one, the elements of the training data X that correspond to 3-vector components cannot be all treated monolithically in the computation of the shift µ and scale σ. Instead, the vectors must be dotted into themselves each individually to construct scalar norms. Those scalar norms can subsequently be summed or medianed or averaged or square-rooted. Usefully, the root-mean-square of the components of a 3-vector can be seen as the square root of 1/3 of the dot product of the vector with itself. At application time, the three components of any 3-vector must be scaled identically, not independently, otherwise the vector is (in general) being arbitrarily rotated. In this 3-vector case, the shift µ cannot be a single number but instead, the shift must itself be a 3-vector which is an O(3)-equivariant function of the input vectors. That's natural in many but not all normalization methods in use at present. For another, the features in X that correspond to the elements of tensors must not have their components treated equally in the computation of the shift µ and scale σ. Instead, the tensors must have their spectral norms taken (or have some other O(3)-equivariant norms must be taken), with each tensor treated individually. Those norms can subsequently be summed or medianed or averaged or square-rooted. Unfortunately, taking spectral norms is more expensive than taking moments. Once again, at application time, the tensor components cannot be independently scaled with nine different scales; instead, one scale must be applied consistently to all nine components. Once again, the shift applied cannot be a single number applied to all components but instead the shift must itself be a tensor. These vector and tensor considerations suggest that data normalization needs to be substantially modified to achieve covariance, that is, to accommodate the passive symmetries of vectors and tensors. For yet another, elements of X with different units must be treated differently. For shifts, it makes sense to subtract from each quantity a shift µ that is computed from only those features that share units with the feature in question. For scales, it might make sense to find base-unit scales that make the range of scaled features as close as possible to having unit variance. ## 10 Discussion In this conceptual contribution, we argue that passive symmetries are in play in essentially all ML or data-analysis tasks. They are exact, and true by definition, since they emerge from the redundancies or freedom in coordinate systems, units, or data representation. Enforcement of these symmetries should improve enormously the generalization capabilities of ML methods. We demonstrate this with toy examples. In practice, implementation of the passive symmetries in an ML problem might be very difficult. One reason is that the symmetries are only exact when all relevant problem parameters (including often fundamental, unvaried constants) are known and included in the learning problem. If the problem has a passive symmetry by a group G, but there are missing elements K in the problem formulation (such as Planck's constant or the gravity vector in Section 5), then the active symmetry that is actually in play is the subgroup H of G that fixes K. Naively there should be no difference in the in-distribution performance between enforcing the symmetry by H, or including K to the inputs and enforcing the symmetry induced by G. However, using the full group equivariance is conceptually more elegant and it allows for out-of-distribution generalization (the model can generalize to settings where K has changed). Of course, these unknown constants or features K are pieces of essential contextual information and can be difficult to find or learn. In our toy examples, we show that with sufficient knowledge of the problem (rich training data and knowledge of the group of passive symmetries) the relevant constant K can be learned from the data, including the Planck constant (for the blackbody-radiation problem) and the gravitational acceleration vector (for the double-pendulum example). Identifiability issues may arise when more constants or non-constant features are missing. Another difficulty is that some kinds of symmetries are hard to enforce. For example, complete coordinate diffeomorphisms and problem reparameterizations involve enormous groups which are hard to implement in any realistic ML method. That said, many groups have been implemented usefully, including translations, rotations, permutations, changes of units, and some coordinate transformations (see Weiler et al. 2021a for a review of the latter). In addition to the exact (and true by definition) passive symmetries, and the observed active symmetries, there are other kinds of approximate or weakly broken symmetries we might call *observer symmetries*. These arise from the point that the content of a data record (an image, say) is independent of the minor choices made by the observer in taking that data record (shooting the image, say). The details of the six-axis location and orientation of the camera, and of the exposure time and focus, can be changed without changing the semantic or label content of the image. These symmetries are approximate, because these changes don't lead to invertible changes in the recorded data; there is no group or groupoid in the space of the data. However, the success of convolutional structure in image models might have to do with the importance of these observer symmetries. There is much more to do in this space. One topic that we did not address in this note is the use of symmetries as design principle or *inductive bias* and their interaction with optimization. One feature of modern machine learning is that the models used to fit the data are often overparameterized (Zhang et al., 2021). That means that the model has more parameters than training points, sometimes several orders of magnitude more. In particular, many possible functions fit the data perfectly, but not all of them generalize well to new data points (Hogg & Villar, 2021) (see the double descent, benign overfitting, and related ideas Belkin et al. 2019; Bartlett et al. 2020; Nakkiran et al. 2021; Huang et al. 2020; Sonthalia et al. 2023, among many others). Therefore, the design of the class of functions is very important for the performance of the models. Through the years, the classes of functions that have been empirically proven to be successful, incorporate symmetries in their design (for example, convolutional neural networks, graph neural networks, transformers, etc). It is not fully understood why these models are successful and whether the symmetries are a key aspect for their success. Acknowledgement: It is a pleasure to thank Roger Blandford (Stanford), Ben Blum-Smith (JHU), Wilson Gregory (JHU), Nasim Rahaman (MPI-IS), and Shubhendu Trivedi for valuable comments and discussions. This project was started at the meeting *Machine Learning for Science* at Schloss Dagstuhl, 2022 September 18–23. SV was partially supported by ONR N00014-22-1-2126, the NSF–Simons Research Collaboration on the Mathematical and Scientific Foundations of Deep Learning (MoDL) (NSF DMS 2031985), NSF CISE 2212457, NSF CAREER 2339682, and an AI2AI Amazon research award. This project made use of open-source software, including Python, jax, objax, jupyter, numpy, matplotlib, scikit-learn. All code used in this project is available at repositories https://github.com/weichiyao/TowardsFullyCovariantML. ## References Max Shirokawa Aalto, Ekdeep Singh Lubana, and Hidenori Tanaka. Geometric considerations for normalization layers in equivariant neural networks. In *AI for Accelerated Materials Design NeurIPS 2022* Workshop, 2022. URL https://openreview.net/forum?id=p9fKD1sFog8. Joseph Bakarji, Jared Callaham, Steven L Brunton, and J Nathan Kutz. Dimensionally consistent learning with buckingham pi. *arXiv preprint arXiv:2202.04643*, 2022. Peter L Bartlett, Philip M Long, Gábor Lugosi, and Alexander Tsigler. Benign overfitting in linear regression. *Proceedings of the National Academy of Sciences*, 117(48):30063–30070, 2020. Simon Batzner, Albert Musaelian, Lixin Sun, Mario Geiger, Jonathan P Mailoa, Mordechai Kornbluth, Nicola Molinari, Tess E Smidt, and Boris Kozinsky. E(3)-equivariant graph neural networks for data-efficient and accurate interatomic potentials. *Nature communications*, 13(1):1–11, 2022. Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machine-learning practice and the classical bias–variance trade-off. *Proceedings of the National Academy of Sciences*, 116(32): 15849–15854, 2019. Alberto Bietti, Luca Venturi, and Joan Bruna. On the sample complexity of learning with geometric stability. arXiv:2106.07148, 2021. Ben Blum-Smith and Soledad Villar. Machine learning and invariant theory. *Notices of the American* Mathematical Society, pp. 1205–1213, September 2023. Bernhard E Boser, Isabelle M Guyon, and Vladimir N Vapnik. A training algorithm for optimal margin classifiers. In *Proceedings of the fifth annual workshop on Computational learning theory*, pp. 144–152, 1992. Michael M Bronstein, Joan Bruna, Taco Cohen, and Petar Veličković. Geometric deep learning: Grids, groups, graphs, geodesics, and gauges. *arXiv preprint arXiv:2104.13478*, 2021. Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. *arXiv:1312.6203*, 2013. S. Buchholz, M. Besserve, and B. Schölkopf. Function classes for identifiable nonlinear independent component analysis. In *Advances in Neural Information Processing Systems 35 (NeurIPS 2022)*. Curran Associates, Inc., December 2022. J. W. Burby, Q. Tang, and R. Maulik. Fast neural poincaré maps for toroidal magnetic fields. Plasma Physics and Controlled Fusion, 63(2), 12 2020. doi: 10.1088/1361-6587/abcbaa. Jameson Cahill, Joseph W Iverson, Dustin G Mixon, and Daniel Packer. Group-invariant max filtering. arXiv preprint arXiv:2205.14039, 2022. Shuxiao Chen, Edgar Dobriban, and Jane H Lee. A group-theoretic framework for data augmentation. The Journal of Machine Learning Research, 21(1):9885–9955, 2020. Miranda CN Cheng, Vassilis Anagiannis, Maurice Weiler, Pim de Haan, Taco S Cohen, and Max Welling. Covariance in physics and convolutional neural networks. *arXiv:1906.02481*, 2019. Taco Cohen and Max Welling. Group equivariant convolutional networks. In International conference on machine learning, pp. 2990–2999. PMLR, 2016. R. Courant and D. Hilbert. *Methods of Mathematical Physics*, volume 1. Interscience Publishers, Inc, New York, 1953. Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. *arXiv*, 1703.04933, 2017. David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In *Neural Information Processing systems*, pp. 2224–2232, 2015. Nadav Dym and Steven J Gortler. Low dimensional invariant embeddings for universal geometric learning. arXiv preprint arXiv:2205.02956, 2022. John Earman and Clark Glymour. Lost in the tensors: Einstein's struggles with covariance principles 1912–1916. *Studies in History and Philosophy of Science Part A*, 9(4):251–278, 1978. Albert Einstein. Die feldgleichungen der gravitation. *Sitzungsberichte der Preussischen Akademie der* Wissenschaften zu Berlin, pp. 844–847, 1915. Albert Einstein. Die Grundlage der allgemeinen Relativitätstheorie. *Annalen der Physik*, 354(7):769–822, January 1916. doi: 10.1002/andp.19163540702. Bryn Elesedy. Provably strict generalisation benefit for invariance in kernel methods. *arXiv:2106.02346*, 2021. Bryn Elesedy and Sheheryar Zaidi. Provably strict generalisation benefit for equivariant models. arXiv:2102.10333, 2021. Mark Fels and Peter J Olver. Moving coframes: I. a practical algorithm. *Acta Applicandae Mathematica*, 51: 161–213, 1998. Marc Finzi, Samuel Stanton, Pavel Izmailov, and Andrew Gordon Wilson. Generalizing convolutional neural networks for equivariance to lie groups on arbitrary continuous data. In *International Conference on* Machine Learning, pp. 3165–3176. PMLR, 2020. Marc Finzi, Max Welling, and Andrew Gordon Wilson. A practical method for constructing equivariant multilayer perceptrons for arbitrary matrix groups. *arXiv:2104.09459*, 2021. Mario Geiger and Tess Smidt. e3nn: Euclidean neural networks. *arXiv:2207.09453*, 2022. Alan E. Gelfand. Gibbs sampling. *Journal of the American Statistical Association*, 95(452):1300–1304, 2000. Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1263–1272. JMLR. org, 2017. Sharut Gupta, Joshua Robinson, Derek Lim, Soledad Villar, and Stefanie Jegelka. Structuring representation geometry with rotationally equivariant contrastive learning. *arXiv preprint arXiv:2306.13924*, 2023. William L Hamilton. Graph representation learning. Synthesis Lectures on Artifical Intelligence and Machine Learning, 14(3):1–159, 2020. W. K. Hastings. Monte carlo sampling methods using markov chains and their applications. *Biometrika*, 57 (1):97–109, 1970. ISSN 00063444. Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. *Neural Comput.*, 9(1):1–42, 1997. David W Hogg and Soledad Villar. Fitting very flexible models: Linear regression with large numbers of parameters. *Publications of the Astronomical Society of the Pacific*, 133(1027):093001, 2021. Kevin H Huang, Peter Orbanz, and Morgane Austern. Quantifying the effects of data augmentation. arXiv preprint arXiv:2202.09134, 2022. Ningyuan Huang, David W Hogg, and Soledad Villar. Dimensionality reduction, regularization, and generalization in overparameterized regressions. *arXiv:2011.11477*, 2020. Ningyuan Teresa Huang, Ron Levie, and Soledad Villar. Approximately equivariant graph networks. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. Pengzhan Jin, Zhen Zhang, Aiqing Zhu, Yifa Tang, and George Em Karniadakis. Sympnets: Intrinsic structure-preserving symplectic networks for identifying hamiltonian systems. *Neural Networks*, 132(C), 8 2020. doi: 10.1016/j.neunet.2020.08.017. Sékou-Oumar Kaba, Arnab Kumar Mondal, Yan Zhang, Yoshua Bengio, and Siamak Ravanbakhsh. Equivariance with learned canonicalization functions. In *Proceedings of the 40th International Conference* on Machine Learning, volume 202 of *Proceedings of Machine Learning Research*, pp. 15546–15566. PMLR, 23–29 Jul 2023. Ilyes Khemakhem, Ricardo Pio Monti, Diederik P. Kingma, and Aapo Hyvärinen. ICE-BeeM: Identifiable conditional energy-based deep models based on nonlinear ICA. In Advances in Neural Information Processing Systems 33, 2020. Risi Kondor. N-body networks: a covariant hierarchical neural network architecture for learning atomic potentials. *arXiv:1803.01588*, 2018. Risi Kondor and Shubhendu Trivedi. On the generalization of equivariance and convolution in neural networks to the action of compact groups. *Proceedings of the 35th International Conference on Machine* Learning, 2018. Hannah Lawrence, Kristian Georgiev, Andrew Dienes, and Bobak T Kiani. Implicit bias of linear equivariant networks. *arXiv:2110.06084*, 2021. Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. *Neural Computation*, 1 (4):541–551, 1989. Haggai Maron, Heli Ben-Hamu, Nadav Shamir, and Yaron Lipman. Invariant and equivariant graph networks. In *International Conference on Learning Representations*, 2018. Song Mei, Theodor Misiakiewicz, and Andrea Montanari. Learning with invariances in random features and kernel models. *arXiv:2102.13219*, 2021. Conor Muldoon. DeepMind's EigenGame is not a game! *medium*, May 2021. https://towardsdatascience.com/deepminds-eigengame-is-not-a-game-f580b3709316. Albert Musaelian, Simon Batzner, Anders Johansson, Lixin Sun, Cameron J Owen, Mordechai Kornbluth, and Boris Kozinsky. Learning local equivariant representations for large-scale atomistic dynamics. arXiv:2204.05249, 2022. Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, and Ilya Sutskever. Deep double descent: Where bigger models and more data hurt. *Journal of Statistical Mechanics: Theory and* Experiment, 2021(12):124003, 2021. Emmy Noether. (translated and republished as) Invariant variation problems. Transport Theory and Statistical Physics, 1(3):186–207(1971), 1918. J. Peters, D. Janzing, and B. Schölkopf. *Elements of Causal Inference - Foundations and Learning* Algorithms. MIT Press, Cambridge, MA, USA, 2017. ISBN 978-0-262-03731-0. Mircea Petrache and Shubhendu Trivedi. Approximation-generalization trade-offs under (approximate) group equivariance. *arXiv preprint arXiv:2305.17592*, 2023. Henning Petzka, Michael Kamp, Linara Adilova, Cristian Sminchisescu, and Mario Boley. Relative flatness and generalization. In *Advances in Neural Information Processing Systems*. Curran Associates, Inc., 2021. Max Planck. On the law of the energy distribution in the normal spectrum. *Ann. Phys*, 4(553):1–11, 1901. M. M. G. Ricci and T. Levi-Civita. Méthodes de calcul différentiel absolu et leurs applications. Mathematische Annalen, 54(1):125–201, 1900. M. Rojas-Carulla, B. Schölkopf, R. Turner, and J. Peters. Invariant models for causal transfer learning. Journal of Machine Learning Research, 19(36):1–34, 2018. Carlo Rovelli and Marcus Gaul. Loop quantum gravity and the meaning of diffeomorphism invariance. In Towards quantum gravity, pp. 277–324. Springer, 2000. Alvaro Sanchez-Gonzalez, Victor Bapst, Kyle Cranmer, and Peter Battaglia. Hamiltonian Graph Networks with ODE Integrators. *arXiv:1909.12790*, 2019. B. Schölkopf and A. J. Smola. *Learning with Kernels*. MIT Press, Cambridge, MA, USA, 2002. Mehran Shakerinava, Arnab Kumar Mondal, and Siamak Ravanbakhsh. Structuring representations using group invariants. In *Advances in Neural Information Processing Systems*, volume 35, pp. 34162–34174. Curran Associates, Inc., 2022. Rishi Sonthalia, Xinyue Li, and Bochao Gu. Under-parameterized double descent for ridge regularized least squares denoising of data on a line. *arXiv preprint arXiv:2305.14689*, 2023. Richard P. Stanley. Smith normal form in combinatorics. *Journal of Combinatorial Theory, Series A*, 144: 476–495, 2016. Hannes Stärk, Octavian Ganea, Lagnajit Pattanaik, Regina Barzilay, and Tommi Jaakkola. Equibind: Geometric deep learning for drug binding structure prediction. In International Conference on Machine Learning, pp. 20503–20521. PMLR, 2022. Behrooz Tahmasebi and Stefanie Jegelka. The exact sample complexity gain from invariances for kernel regression. In *Thirty-seventh Conference on Neural Information Processing Systems*, 2023. Nathaniel Thomas, Tess Smidt, Steven Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor field networks: Rotation-and translation-equivariant neural networks for 3d point clouds. arXiv:1802.08219, 2018. Kip S. Thorne and Roger D. Blandford. Modern Classical Physics: Optics, Fluids, Plasmas, Elasticity, Relativity, and Statistical Physics. Princeton University Press, 2017. ISBN 9781400848898. Soledad Villar, David W Hogg, Kate Storey-Fisher, Weichi Yao, and Ben Blum-Smith. Scalars are universal: Equivariant machine learning, structured like classical physics. *Advances in Neural Information Processing* Systems, 34:28848–28863, 2021. Soledad Villar, Weichi Yao, David W Hogg, Ben Blum-Smith, and Bianca Dumitrascu. Dimensionless machine learning: Imposing exact units equivariance. *Journal of Machine Learning Research*, 24(109):1–32, 2023. Ulrike von Luxburg, Olivier Bousquet, and Bernhard Schölkopf. A compression approach to support vector model selection. *J. Mach. Learn. Res.*, 5:293–323, 2004. Rui Wang, Robin Walters, and Rose Yu. Approximately equivariant networks for imperfectly symmetric dynamics. *arXiv:2201.11969*, 2022. Maurice Weiler, Patrick Forré, Erik Verlinde, and Max Welling. Coordinate independent convolutional networks - isometry and gauge equivariant convolutions on riemannian manifolds. *arXiv*, 2106.06020, 2021a. Maurice Weiler, Patrick Forré, Erik Verlinde, and Max Welling. Coordinate independent convolutional networks–isometry and gauge equivariant convolutions on riemannian manifolds. *arXiv:2106.06020*, 2021b. Hermann Weyl. *The Classical Groups*. Princeton University Press, 1946. Christopher K. I. Williams and Carl Edward Rasmussen. *Gaussian processes for machine learning*. MIT press (Cambridge, MA), 2006. Xiaoyu Xie, Arash Samaei, Jiachen Guo, Wing Kam Liu, and Zhengtao Gan. Data-driven discovery of dimensionless numbers and governing laws from scarce measurements. *Nature Communications*, 13(1): 7562, 2022. Weichi Yao, Afonso S Bandeira, and Soledad Villar. Experimental performance of graph neural networks on random instances of max-cut. In *Wavelets and Sparsity XVIII*, volume 11138, pp. 111380S. International Society for Optics and Photonics, 2019. Weichi Yao, Kate Storey-Fisher, David W. Hogg, and Soledad Villar. A simple equivariant machine learning method for dynamics based on scalars. *arXiv*, 2110.03761, 2021. Rose Yu, Paris Perdikaris, and Anuj Karpatne. Physics-guided ai for large-scale spatiotemporal data. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pp. 4088–4089, 2021. Anthony Zee. *Group theory in a nutshell for physicists*, volume 17. Princeton University Press, 2016. Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning (still) requires rethinking generalization. *Communications of the ACM*, 64(3):107–115, 2021. ## A Glossary We provide here a glossary to translate terminologies among machine learning, mathematics, and physics. active symmetry: A symmetry is *active* when it is an observed or empirical regularity of the laws of physics. Examples include the observation that the fundamental laws don't depend on the location or time at which the experiment takes place. We provide a formal definition in Section 4. conservation law: We say that a quantity obeys a *conservation law* if changes in that quantity (with time) inside some closed volume can are quantitatively explained by fluxes of that quantity through the surface of that volume. Active symmetries can lead to conservation laws in dynamical systems (when the dynamics is Lagrangian; Noether 1918). coordinate freedom: When physical quantities are measured, or represented in a computer, they must be expressed in some coordinate system. The redundancy of this representation—the fact that the investigator had many choices for the coordinate system—leads to the passive symmetry *coordinate* freedom: If the inputs to a physics problem are moved to a different coordinate system (because of a change in the origin or orientation), the outputs of the problem must be correspondingly moved. In much of the literature "coordinate freedom" is only used in relationship to general covariance, but it applies in all contexts (including non-physics contexts) in which a coordinate system has been chosen. covariance: When a physical law is equivariant with respect to a passive symmetry, then the law is said to be *covariant* with respect to that symmetry. dimensions: Dimensions are the abstract generalization of units. Two quantities that can be given the same units (possibly with a units change for one of them) have identical *dimensions*. dimensional analysis: The technique in physics of deducing scalings by consideration of units covariance is *dimensional analysis*. equivariance: Let G be a group that acts on vector spaces X and Y as ρX : G → Sym(X) and ρY : G → Sym(Y ) respectively. Namely, ρX (and similarly ρY ) maps each element of G to a bijective function from X to itself satisfying some rules described in the definition of "group action". We say that a function f : X → Y is *equivariant* if for any group element g ∈ G and any possible input x, the function obeys f(ρX(g)(x)) = ρY (g)(f(x)). This is typically expressed by saying that the following commutative diagram commutes for all g ∈ G: $$\begin{array}{c}{{X\ \xrightarrow{\ f}\ Y}}\\ {{\rho_{X}(g)\Big\downarrow}}\\ {{X\ \xrightarrow{\ f}\ Y}}\end{array}$$ $$\left(5\right)$$ The actions of G in X and Y induce an action on the space of maps from X to Y . If f ∈ Maps(*X, Y* ) then we can define ρXY : G → Sym(Maps(*X, Y* )) such that ρXY (g)(f) = ρY (g) ◦ f ◦ ρX(g) −1. The equivariant maps are the fixed points of this action. While an equivariance is a mathematical property of a map, in this contribution we use the word "equivariance" mainly in the context of active symmetries, and "covariance" in the context of passive symmetries. gauge freedom: Some physical quantities in field theories (for example the vector potential in electromagnetism) have additional degrees of freedom that go beyond the choice of coordinate system and units. These freedoms lead to additional passive symmetries that are known as *gauge freedom*. general covariance: The covariance of relevance in general relativity (Einstein, 1916) is known as general covariance. Because general relativity is a metric theory on an intrinsically curved spacetime of 3 + 1 dimensions that is invariant to arbitrary diffeomorphisms of the coordinate system, this is a very strong symmetry. General covariance is sometimes called "coordinate freedom", but it is a special case thereof. group: A *group* G is a set with a binary operation · satisfying the following: (1) Associativity: for all a, b, c ∈ G we have (a · b) · c = a · (b · c); (2) Identity element: there exists an element e ∈ G so that e · a = a · e = a for all a ∈ G; (3) Inverse: for all a ∈ G there exists a unique element b such that a · b = b · a = e; this element is the inverse of a and it is typically denoted as a −1. group action: We consider a group G, a space X, and a map ρ : G → Sym(X), where Sym(X) denotes the bijective maps from X to itself. Lightly abusing notation, sometimes this map is expressed as ρ : G × X → X. We say ρ is an *action* of G on X if it satisfies the following properties: (1) Identity: ρ(e)(x) = x for all x ∈ X, where e is the group identity element. (2) Compatibility: ρ(a)(ρ(b)(x)) = ρ(a · b)(x) for all *a, b* ∈ G and x ∈ X. group representation: A *representation* of a group G is an action ρ : G → GL(V ), where GL(V ) is the space of invertible linear transformations of the vector space V . Sometimes it is said that V is a representation of G (and the action is implicitly known). When V is a finite dimensional vector space, the group representation allows us to map the multiplication of group elements to multiplication of matrices. invariance: An equivariance in which the action in the output space is trivial is called an *invariance*. Physicists sometimes use the word invariant (gauge invariant, for example) for things we would call covariant. passive symmetry: A symmetry is *passive* when it arises from a choice in the representation of the data. Examples include coordinate freedom, gauge freedom, and units covariance. These symmetries are exact and true by definition. We provide a formal definition in Section 4. scalar: A number (with or without units), whose value does not depend on the coordinate system in which it is represented, is a *scalar*. Thus, say, the charge of a particle is a scalar, but the x coordinate of its velocity is not a scalar. symmetry: Given a mathematical object X of any sort, (such as a manifold, metric space, equation, etc), any intrinsic property of X which causes it to remain invariant under certain classes of transformations (such as rotation, reflection, inversion, or other operations) is called a *symmetry*. For our purposes, the symmetries of interest can be expressed as equivariances or invariances, both defined above. tensor: A multi-linear function of k − 1 vectors that outputs a vector, or a multi-linear function of k vectors that outputs a scalar, is a k-*tensor*. A rectangular array of data is not usually a tensor according to this definition. A vector can be seen as a 1-tensor (the linear function corresponding to the vector being the inner product with that vector), and a scalar can be seen as a 0-tensor. There is an alternative definition of tensor in terms of transformations with respect to the O(d) group, analogous to the primary definition of "vector" below. units: All physical quantities are measured with a system of what we call *units*. A quantity can be transformed from one unit system to another by multiplication with a dimensionless number. Almost all quantitiesincluding almost all scalars, vectors, and tensors—have units. units covariance: The left-hand side and the right-hand side of any equation must have the same units. This symmetry is called (by us) *units covariance* (contra Villar et al. 2023 where it is called "units equivariance"). vector: An ordered list of d numbers, all of which have the same units, that is subject to the passive O(d) symmetry corresponding to coordinate-system rotations, is a *vector* in d dimensions. These rotations are performed by the standard rotation (and reflection) matrix representation of the elements of O(d). See the definition of "tensor" for an alternative definition: The inner (or dot) product of two vectors produces a scalar; for this reason, a vector can be seen as a 1-tensor. A generic ordered list of d features is not usually a vector according to this definition. ## B Units Covariant Regression: The Black Body Experiment For our first experiments, we consider the problem of black-body radiation, in which the intensity Bλ(λ; T) of radiation at wavelength λ is a function of temperature T. The true relationship is given by (3), and we use it to construct a toy inference problem in which the units of the input quantities are non-trivial. The training data are made by computing intensities Bλ(λ; T) according to (3) at five temperatures (300, 1000, 3000, 10000, and 30000 K), and on a wavelength grid of 40 wavelengths on a logarithmically spaced grid from 10−8to 10−4 m. To each evaluation of intensity we add a draw of zero-mean Gaussian noise with root-variance 0.1 times the true value of that intensity. The training data are cut on intensity, such that only data points with intensities above 106in SI units are retained. The remaining data points so constructed comprise the training data, with features x being the wavelengths and temperatures, and labels y being the noisy values of the intensity. In some cases we augment the features with copies of the speed of light c and the thermal (Boltzmann's) constant k. At each of the training data points, there are two or four fundamental features (the first 2, or all, of the list *λ, T, c, k*), depending on the regression. The test data are similarly generated except that they are generated at temperatures of 6000, 20000, and 60000 K. That is, the test data extend outside the temperature range of the training data, and the test and training data have no temperatures in common. Once the intensity cut is made, there are 126 data points in the training set and 108 in the test set. We perform three regressions, the output of which are shown in Figure 2: In the first (dubbed "standard MLP"), a 3-layer multi-layer perceptron from scikit-learn, with hidden-layer sizes of 20, 20, and 20 is trained on the logarithm of the first two training-set features (features *λ, T*) and the logarithm of the training-set labels. The trained MLP is used to predict the test-set labels. This model incorporates no explicit symmetries. In the second regression (dubbed "units covariant without extra dimensional constant"), the same design of MLP is used, but instead of inputting the logarithms of the fundamental features, the input to the MLP is the set of logarithms of all the dimensionless combinations possible to make from the four features *λ, T, c, k*, following the approach of Villar et al. (2023). This approach uses the Smith normal form (Stanley, 2016) to find products of integer powers of the input features that are dimensionless, and one product of integer powers of the inputs that has the same units as the label. The output of the MLP is multiplied by the combination of the input features with the correct units to be an intensity. In this case, there are no non-trivial dimensionless features, so the MLP sets one amplitude only, and the predictions are pure power laws (as is visible in Figure 2). In the third regression (dubbed "units covariant with extra dimensional constant"), the features are augmented with one dimensional quantity q, and then the same procedure is followed as for the previous units-covariant case. If the quantity q has units that are independent (in the appropriate sense) from the units of the four fundamental features, then a new dimensionless constant becomes possible and the regression becomes non-trivial. The units of q are chosen from an exhaustive list of all possible units that involve powers between −2 and 2 of kg, m, s, and K. The value of q is chosen, at each of these units choices, to be such that the range of dimensionless features in the training data has unit median. Again the MLP input is logarithms of dimensionless features and the output is multiplied by the Smith normal form returned combination with the correct units to be an intensity. Many choices for the units and value of q lead to good regression accuracy; all of them make q close to some combination of *h, c, k*, necessarily including h. ## C Springy Double Pendulum Setting. We consider the dissipationless spherical double pendulum with springs, with a pivot o and two masses connected by springs. The kinetic energy T and potential energy U of the system are given by $$KE=\frac{|\mathbf{p}_{1}|^{2}}{2m_{1}}+\frac{|\mathbf{p}_{2}|^{2}}{2m_{2}},\tag{6}$$ $$PE=\frac{1}{2}k_{1}(|\mathbf{q}_{1}-\mathbf{q}_{o}|-l_{1})^{2}+\frac{1}{2}k_{2}(|\mathbf{q}_{2}-\mathbf{q}_{1}|-l_{2})^{2}-m_{1}\,\mathbf{g}\cdot(\mathbf{q}_{1}-\mathbf{q}_{o})-m_{2}\,\mathbf{g}\cdot(\mathbf{q}_{2}-\mathbf{q}_{o}),\tag{7}$$ where q1, p1 are the position and momentum vectors for mass m1, similarly q2, p2 for mass m2, and a position qo for the pivot. The springs have scalar spring constants k1, k2, and natural lengths l1, l2. The gravitational acceleration vector is g. In this work, we fix qo with values (0, 0, 0) in base length units and g with (0, 0, −1) in base acceleration units, as well as (m1, m2, k1, k2, l1, l2) set to (1, 1, 1, 1, 1, 1), where each element of the list has appropriate base units. The prediction task is to learn the positions and momenta over a set of T later times t given the initializations of the pendulum positions and momenta at t0, $$\mathbf{z}(t)=(\mathbf{q}_{1}(t),\mathbf{q}_{2}(t),\mathbf{p}_{1}(t),\mathbf{p}_{2}(t)),\quad t\in\{t_{0},t_{1},\ldots,t_{T}\}.$$ The training inputs consist of N = 500 different initializations of the pendulum positions and momenta {z (i)(t (i) 0 )} N i=1, and the labels are the set of positions and momenta {z (i)(t (i) 1 ), z (i)(t (i) 2 )*, . . . ,* z (i)(t (i) T )} N i=1 with T = 5. The model is evaluated on a test data set with T = 150 and t0 = 0. Variants. For the same prediction task, we consider three different O(3)-equivariant models, fKnown-g, fLearned-g and fNo-g, depending how the gravitational acceleration vector g is involved. Known-g The model fKnown-g is a function that predicts the dynamics: $$f_{\text{Known-g}}:(\mathbb{R}^{3})^{4}\times\mathbb{R}^{3}\times\mathbb{R}^{3}\times\mathbb{R}\rightarrow(\mathbb{R}^{3})^{4}$$ $$(\mathbf{z}(0),\mathbf{q}_{o},\mathbf{g},\Delta t)\mapsto\hat{\mathbf{z}}(\Delta t)$$ $$({\boldsymbol{\delta}})$$ $$({\mathfrak{g}})$$ where g is known as (0, 0, −1) in the base acceleration units and used with positions and momenta as input features. Learned-g The model fLearned-g is a function that predicts the dynamics: $$f_{\text{L,armed-g}}:(\mathbb{R}^{3})^{4}\times\mathbb{R}^{3}\times\mathbb{R}\rightarrow(\mathbb{R}^{3})^{4}$$ $$(\mathbf{z}(0),\mathbf{q}_{o},\Delta t)\mapsto\hat{\mathbf{z}}(\Delta t)$$ $$(10)$$ where g is unknown but set as a learnable variable and used with positions and momenta as input features. No-g The model fNo-g is a function that predicts the dynamics: $f_{\text{No-g}}:(\mathbb{R}^{3})^{4}\times\mathbb{R}^{3}\times\mathbb{R}\rightarrow(\mathbb{R}^{3})^{4}$ $(\mathbf{z}(0),\mathbf{q}_{o},\Delta t)\mapsto\hat{\mathbf{z}}(\Delta t)$ $$(12)$$ $$(11)$$ where g is unknown and not used as an input feature. We evaluate the performance of the three predictive models based on the state relative error at a given time t in terms of the positions and momenta of the masses, $${\mathrm{State.RelErr}}(t)={\frac{{\sqrt{\left({\hat{\mathbf{z}}}(t)-\mathbf{z}(t)\right){}^{\top}\left({\hat{\mathbf{z}}}(t)-\mathbf{z}(t)\right)}}}{{{\sqrt{\hat{\mathbf{z}}(t){}^{\top}{\hat{\mathbf{z}}}(t)}}+{\sqrt{\mathbf{z}(t){}^{\top}\mathbf{z}(t)}}}}},\quad t\in\{t_{1},\ldots,t_{T}\},$$ where zˆ(t) denotes the predicted positions and momenta at time t and z(t) the ground truth. Model. In all the variants of the experiment, the learned function f is implemented by a Hamiltonian neural network (Sanchez-Gonzalez et al., 2019). The model learns an scalar O(3)-invariant function H of the input vectors, and uses a symplectic integrator to predict the dynamics: $$\frac{\mathrm{d}\mathbf{q}_{s}}{\mathrm{d}t}=\frac{\partial\mathscr{H}}{\partial\mathbf{p}_{s}},\qquad\frac{\mathrm{d}\mathbf{p}_{s}}{\mathrm{d}t}=-\frac{\partial\mathscr{H}}{\partial\mathbf{q}_{s}},\qquad s=1,2.$$ We implement H to be O(3)-invariant by simply restricting H to be a function of the inner products of the possible input vectors q1, q2, p1, p1, qo and possibly g, following the fundamental theorem for invariant $$(13)$$ | Training MSE | Test MSE | Test rollout error | | |-------------------------------|-----------------|----------------------|-----------------| | No normalization | 0.0000 ± 0.0000 | 0.0028 ± 0.0013 | 0.0029 ± 0.0001 | | Non-equivariant normalization | 0.0184 ± 0.0006 | 0.2587 ± 0.0233 | 0.1177 ± 0.0043 | | Equivariant normalization | 0.0000 ± 0.0000 | 0.0070 ± 0.0011 | 0.0053 ± 0.0007 | Table 1: Empirical performance of the different data normalization procedures. theory for O(d) (see Weyl 1946 for the theory, and Villar et al. 2021 for a discussion on machine learning implications). Namely, Hvariant(q1, q2, p1, p2) = h((v ⊤w)v,w∈Vvariant) (14) where VKnown-g = {q1, q2, p1, p2, g = (0, 0, 1)}; VLearned-g = {q1, q2, p1, p2, g} where g is a variable that is jointly optimized with the parameters that define H ; VNo-g = {q1, q2, p1, p2}. Note that qo = 0 so all the corresponding inner products are zero and therefore dropped from the model. The model predictions are computed as fvariant = symplectic-integration(Hvariant(q1, q2, p1, p2), ∆t). (15) Note that this model is time-translation-equivariant, can be O(3)-equivariant (depending on the variant), but it isn't units-covariant. Our experiments show that the O(3)-equivariant variant with known gravity has the best performance, closely followed by the model with learned gravity. We note that the model learns a vector very close to the ground-truth gravity vector, and therefore learns an equivariant model. The non equivariant model with no gravity vector performs quite poorly, as expected. The results are presented in Figure 2. Data normalization For the data normalization experiment, we consider the standard variant where the gravity vector is known. We normalize the inputs of H in (15) before computing the inner products. We consider the input data matrix with rows indexed by i = 1*, . . . , N* and columns of the form $$({\mathcal{H}}_{\mathrm{variant}}(\mathbf{q}_{1},\mathbf{q}_{2},\mathbf{p}_{1},\mathbf{p}_{2}),\Delta_{t}).$$ $$(\mathbf{q}_{1}^{(i)}(t),\mathbf{q}_{2}^{(i)}(t),\mathbf{p}_{1}^{(i)}(t),\mathbf{p}_{2}^{(i)}(t),\mathbf{g}=(0,0,-1))_{t=t_{0},\ldots,t_{150}}$$ $$\left(16\right)$$ (t), g = (0, 0, −1))t=t0*,...,t*150 (16) Non-equivariant data normalization For the naive data normalization we consider the data matrix with N rows and 3 × 4 × 150 columns (the first 4 columns of (16)) and we normalize it by columns. Namely, for each entry of the matrix we subtracts the mean of its column and divide by the standard deviation of the column. This operation does not respect any of the symmetries of the problem, therefore when we feed this normalized data to our standard model (15), the performance is bad, as shown in Table 1. Equivariant data normalization The equivariant data normalization takes all the vectors {q (i) 1 (t), q (i) 2 (t)}i,t and computes their 3 × 3 empirical covariance matrix Cq. Similarly it computes Cp. The normalized model uses the formulation (15) with $$\mathcal{V}_{\mathrm{normalized}}=\left\{\frac{\mathbf{q}_{1}}{\sqrt{(1/3)\operatorname{tr}(C_{\mathbf{q}})}},\frac{\mathbf{q}_{2}}{\sqrt{1/3\operatorname{tr}(C_{\mathbf{q}})}},\frac{\mathbf{p}_{1}}{\sqrt{(1/3)\operatorname{tr}(C_{\mathbf{p}})}},\frac{\mathbf{p}_{2}}{\sqrt{(1/3)\operatorname{tr}(C_{\mathbf{p}})}},\mathbf{g}=(0,0,-1)\right\}.$$ The performance is comparable to the one with no normalization, and several orders of margnitude better than the performance of the non-equivariant data normalization method. $$(17)$$
Review 1: Summary: The paper considers the problem of building predictive models that are equivariant with respect to passive symmetries, i.e. symmetries that arise from arbitrary choices such as coordinate systems. These are distinct from so called "active" symmetries which are (often approximate) empirically verified symmetries of systems. The paper contains an extensive introduction to the main concepts, some validation of a proposed strategy on two toy examples, and some dos and donts recommendations for practitioners. Strengths and Weaknesses: Strengths: - The paper is clear and well written; - The distinction between active and passive symmetries is potentially important and not widely appreciated in the community; - the historical perspective and links with physics and dimensional analysis are interesting and illuminating. Weaknesses: - The paper is somewhat philosophical in outlook. The authors are clearly aware of this and per se it's not a problem, but I think more effort should be made to explain the practical implications. - The main contribution is not entirely clear (see below). Requested Changes: - The procedure followed in the practical examples should be explained in detail, possibly providing pseudocode or access to notebooks. - A clearer explanation of the novelty (I guess the introduction of an additional feature vector to account for missing information which is learnt from data) should be given. - The method of Villar et al which is at the root of the proposed method should also be described, at least summarily, in order to make it clearer what are the main changes. Broader Impact Concerns: No ethical concerns here. ================================================== Review 2: Summary: The paper discusses ways of incorporating passive symmetries into ML frameworks at a conceptual level. This is different than the study of active symmetries as done in equivariant network literature. Strengths and Weaknesses: The paper is written at a conceptual level. The major weakness is the lack of concrete results (theory or experiments) which can be evaluated in the reviews. In the abstract, the paper arguably translates between different languages of physics, mathematics, and machine learning. Although I see such traces in the glossary, these vocabularies are not fundamental in the later discussion. Requested Changes: TMLR may not be best suited for such conceptual contributions so I'd like to recommend submitting elsewhere. Broader Impact Concerns: NA ================================================== Review 3: Summary: This paper is a think-piece that argues that machine learning models should encode passive symmetries (i.e. natural equivariances due to the arbitrariness of the mathematical system used to encode phenomena). The paper first introduces notions of passive versus active symmetries, and discusses how much of the work in invariant/equivariant machine learning has targeted active symmetries but largely ignored passive symmetries. The authors use toy experiments to demonstrate that taking passive symmetries into account can improve data efficiency. The authors then comment on connections between passive symmetry and causal learning, and describe how our choices of nonlinear activation function and normalization layers lead to violations of passive symmetry. Strengths and Weaknesses: ## Strengths Overall, I found this paper to be very thought provoking and interesting to read. While invariance/equivariances have become quite popular in machine learning models, this paper demonstrates a very notable area of opportunity (passive symmetries) that have been largely ignored by the existing literature. Though this paper is more of a think piece rather than a traditional ML publication, I believe that the ideas it conveys will be of interest not only to those who study symmetry in ML but also to the larger ML community as a whole. **Clarity.** Overall the paper is very well written and easy to follow, even for someone who does not have a strong background in group theory. However, there is a bit of redudancy that could make the paper more streamlined (see Weaknesses). **Experiments.** The toy settings in Section 6 convey a promising illustration of the authors' main ideas. ## Weaknesses - The experiments in Section 6 assume significant familiarity with prior work. The authors should include a more thorough description of the different methods, perhaps in the supplementary material, to assist those not familiar with the work. - Sections 9 and 10 felt a bit too speculative, especially after the toy experiments in Section 6 provide nice grounded evidence. It would be nice to include some specific toy experiments here to demonstrate the consequences of violating passive symmetries. Right now, these sections simply demonstrate a violation of principles. - The paper feels unnecessarily long, and (at least in the first 6 sections) somewhat redundant/repetative. I think that this paper could fit within the standard 12 page limits of a TMLR submission without needing to cut much content. For example: - Get rid of the page break after the abstract - Move the glossary to the appendix (it is very helpful, but disrupts the reading flow). - Sections 3-5 seem to repeat many of the same ideas but with slight variation. It is possible that including the formal definitions of Section 5 before introducing the content in Section 3 could reduce the need to re-introduce passive and active symmetries multiple times. Requested Changes: ## Major (will not vote for acceptance without these changes) - Add Section 6 experimental details to the appendix ## Very nice to have (but not absolutely necessary) - Can you include experiments that demonstrate how using nonlinearities/normalization that violate passive symmetries actually impacts performance? This section would become much stronger (and easier to understand) with some explicit experimental examples. - Shorten the paper and/or move some of the sections into supplementary material - ideally to fit within 12 pages ## Extremely minor (typos) - Page 6 towards the bottom "sometimes Einstein summation notation, Einstein 1916" <- should this be "sometimes *called* Einstein summation notation"? - Page 8 "The two approaches are theoretically eqiuvalent" <- should be "three" approaches Broader Impact Concerns: N/A ================================================== Metareview: Recommendation: Accept as is Comment: The paper adresses timely questions about symmetries in ML models and how taking "passive symmetries" into account may affect performance. The paper's scope is quite general and may catch the attention of a broad audience. It provides detailed numerical experiments backing up the proposed ideas and conjectures. The experiments are convincing and sufficiently detailed to be reproduced. However, as a general rule I recommend the authors to add a link to the code before the final submission. ==================================================
# Fair And Useful Cohort Selection Konstantina Bairaktari *bairaktari.k@northeastern.edu* Khoury College of Computer Sciences Northeastern University Paul Langton *langton.p@northeastern.edu* Khoury College of Computer Sciences Northeastern University Huy Le Nguyen *hu.nguyen@northeastern.edu* Khoury College of Computer Sciences Northeastern University Niklas Smedemark-Margulies *smedemark-margulie.n@northeastern.edu* Khoury College of Computer Sciences Northeastern University Jonathan Ullman jullman@ccs.neu.edu Khoury College of Computer Sciences Northeastern University Reviewed on OpenReview: **https://openreview.net/forum?id=wRepWp1KC7** ## Abstract A challenge in fair algorithm design is that, while there are compelling notions of individual fairness, these notions typically do not satisfy desirable composition properties, and downstream applications based on fair classifiers might not preserve fairness. To study fairness under composition, Dwork & Ilvento (2019) introduced an archetypal problem called *faircohort-selection problem*, where a single fair classifier is composed with itself to select a group of candidates of a given size, and proposed a solution to this problem. In this work we design algorithms for selecting cohorts that not only preserve fairness, but also maximize the utility of the selected cohort under two notions of utility that we introduce and motivate. We give optimal (or approximately optimal) polynomial-time algorithms for this problem in both an offline setting, and an online setting where candidates arrive one at a time and are classified as they arrive. ## 1 Introduction The rise of algorithmic decision making has created a need for research on the design of fair algorithms, especially for machine-learning tasks like classification and prediction. Beginning with the seminal work of Dwork et al. (2012), there is now a large body of algorithms that preserve various notions of fairness for individuals. These notions of individual fairness capture the principle that similar people should be treated similarly, according to some task-specific measure of similarity. While these algorithms satisfy compelling notions of individual fairness in isolation, they will often be used as parts of larger systems. To address this broader context, Dwork & Ilvento (2019) initiated the study of fairness under *composition*, where one or more fair classifiers will be combined to make multiple decisions, and we want these decisions to preserve the fairness properties of those underlying classifiers. Their work introduced a number of models where fair mechanisms must be composed, demonstrated that naïve methods of composing fair algorithms do not preserve fairness, and identified strategies for preserving fairness in these settings. Importantly, these strategies treat the underlying classifiers as a *black-box* so that composition can be modular, eliminating the need to redesign the underlying classifier for every possible use. Our work studies the archetypal *fair cohort selection problem* introduced by Dwork & Ilvento (2019). In this problem, we would like to select k candidates for a job from a universe of n possible candidates. We are given a classifier that assigns a *score* si ∈ [0, 1] to each candidate,1 with the guarantee that the scores are individually fair with respect to some similarity metric D. We would like to select a set of k candidates such that the probability pi of selecting any candidate should be fair with respect to the same metric. Preserving Fairness. Since our goal is to treat the scores s1*, . . . , s*n as a black-box, without knowing the underlying fairness metric, we posit that the scores are fair with respect to some D, i.e. they satisfy $$\forall i,j,\ |s_{i}-s_{j}|\leq{\mathcal{D}}(i,j),$$ $$(1)$$ $$(2)$$ ∀i, j, |si − sj | ≤ D(*i, j*), (1) but that this metric is *unknown*. Thus, we will design our cohort selection algorithm so that its output probabilities p1*, . . . , p*n will satisfy $$\forall i,j,\ |p_{i}-p_{j}|\leq|s_{i}-s_{j}|\leq{\mathcal{D}}(i,j)$$ ∀i, j, |pi − pj | ≤ |si − sj | ≤ D(*i, j*) (2) as this guarantees that we preserve the underlying fairness constraint. Without further assumptions about the fairness metric, the only way to preserve fairness is to satisfy (2). We can trivially solve the fair cohort selection problem by ignoring the scores and selecting a uniformly random set of k candidates, so that every candidate is chosen with the same probability k/n. Thus, in this paper we propose to study algorithms for fair cohort selection that produce a cohort with optimal (or approximately optimal) utility subject to the fairness constraint. Specifically, we consider two variants of the problem: Linear Utilities. For the linear utility model, we assume that 1. the utility for selecting a cohort is the sum of independently assigned utilities for each member, and 2. the scores given by the original classifier accurately reflect the utility of each member of the cohort. Assumption 1 essentially says that members of the cohort are not complements or substitutes and assumption 2 makes sense if the task that we designed the classifier to solve and the task that the cohort is being used for are closely related. Under these assumptions, it is natural to define the utility for a cohort selection algorithm to be Pi pisi, which is the expectation over the choice of the cohort of the sum of the scores across members in the cohort. Ratio Utilities. For the ratio utility model, we continue to rely on assumption 1, but we now imagine that the expected utility for the cohort is some other linear function Pi piui where the variables ui are some unknown measure of utility in [0, 1]. Assuming that for every candidate i the score siis generally correlated with the utility ui even if they are not exactly the same, we normalize by Pi siui, as the original scores can still be a reasonable choice of selection probabilities that satisfy the fairness constraint. Since the utility function is unknown, our goal is now to produce a cohort that maximizes the utility in the *worst case* over possible utility functions. As we show (Lemma 2.1), maximizing the worst-case utility amounts to assigning probabilities that maximize the quantity mini pi/si. Optimizing the ratio utility implies a lower bound on the cohort utility under any utility function that satisfies assumption 1, including our linear utility above. However, it does not necessarily optimize the linear utility, thus the two utility models are distinct. Our technical contributions are polynomial-time algorithms for fair and useful cohort selection with both linear and ratio utilities, in two different algorithmic models. 1In the model of Dwork et al. (2012), fairness requires that the classifier be randomized, so we can think of the output of the classifier as continuous scores rather than binary decisions. Offline Setting. In this setting, we are given all the scores s1*, . . . , s*n at once, and must choose the optimal cohort. We present a polynomial-time algorithm for each model that computes a fair cohort with optimal expected utility. Online Setting. In this setting, we are given the scores s1, s2*, . . .* as a stream. Ideally, after receiving si, we would like to immediately accept candidate i to the cohort or reject them from the cohort. However, this goal is too strong (Dwork & Ilvento, 2019), so we consider a relaxation where candidate i can be either rejected at any point during the online process, or kept on hold until later, and we would like to output a fair cohort at the end of the stream with optimal expected utility while minimizing the number of candidates who are kept on hold. We must keep at least k candidates pending in order to fill our cohort. For ratio utilities we give a fair and optimal algorithm in this setting that keeps at most O(k) candidates on hold. For linear utilities, we give an *approximately* fair and optimal algorithm. Specifically, we present a polynomial-time algorithm for this online setting where the fairness constraints are satisfied with an ε additive error and utility is optimized up to an additive error of O(k √ε), for any desired ε > 0, while ensuring that the number of users on hold never exceeds O(k + 1/ε). To interpret our additive error guarantee, since the fairness constraint applies to the probabilities p1*, . . . , p*n, allowing the fairness constraint to be violated by an additive error of, say, ε = 0.01 means that every candidate is selected with probability that is within ±1% of the probability that candidate would have been selected by some fair mechanism. ## 1.1 Techniques We start with a brief overview of the key steps in our algorithms for each setting. The formal description of the algorithms can be found in Sections 3 and 4. All omitted proofs are in the appendix. Offline Setting. Our offline algorithm is based on two main properties of the fair cohort selection problem. First, we use a dependent-rounding procedure that takes a set of probabilities p1*, . . . , p*n such that Pn i=1 pi = P k and outputs a random cohort C, represented by indicator random variables p˜1, . . . , p˜n ∈ {0, 1} with n i=1 p˜i = k such that E (˜pu) = pu for every candidate u. Thus, it is enough for our algorithm to come up with a set of marginal probabilities for each candidate to appear in the cohort, and then run this rounding process, rather than directly finding the cohort. To find the marginal probabilities that maximize the linear utility with respect to the scores s1*, . . . , s*n ∈ [0, 1], we would like to solve the linear program (LP) $$\begin{array}{r l}{{\mathrm{maximize}}}&{{}\sum_{i=1}^{n}p_{i}s_{i}}\end{array}$$ $$\begin{array}{r l}{{\mathrm{s.t.}}}&{{}\sum_{i=1}^{n}p_{i}\leq k}\\ {{}}&{{}{\forall i,j,\ |p_{i}-p_{j}|\leq|s_{i}-s_{j}|}}\\ {{}}&{{}{\forall i,\ 0\leq p_{i}\leq1}}\end{array}$$ In this LP, the first and third constraints ensure that the variables pu represent the marginal probability of selecting candidate u in a cohort of size k. The second constraint ensures that these probabilities p are fair with respect to the same measure D as the original scores s (i.e. |pu − pv| ≤ |su − sv| ≤ D(*u, v*)). Although we could have used the stronger constraint |pu − pv| ≤ D(*u, v*), writing the LP as we do means that our algorithm does not need to know the underlying metric, and that our solution will preserve any stronger fairness that the scores s happen to satisfy. While we could use a standard linear program solver, we can get a faster solution that is also useful for extending to the online setting by noting that this LP has a specific closed form solution based on "waterfilling". Specifically, if Pn i=1 si ≤ k, then the optimal solution simply adds some number c ≥ 0 to all scores and sets pu = min{su + c, 1}, and an analogous solution works when Pn i=1 si > k. For the ratio utility, although computing the optimal marginal probabilities does not correspond to solving a linear program, the solutions for the two utility functions are the same when Pn i=1 si ≤ k. When Pn i=1 si > k, we maximize the ratio of marginal probability over score by scaling all the scores down by the same factor k/Pn i=1 si. Online Setting. In the online setting we do not have all the scores in advance, thus for the linear utility we cannot solve the linear program, and do not even know the value of the constant c that determines the solution. We give two algorithms for addressing this problem. The basic algorithm begins by introducing some *approximation*, in which we group users into 1/ε groups based on their scores, where group g contains users with scores in ((g − 1)*ε, gε*]. This grouping can only reduce utility by O(k √ε), and can only lead to violating the fairness constraint by ε. Since users in each bucket are treated identically, we know that when we reach the end of the algorithm, we can express the final cohort as containing a random set of ng members from each group g. Thus, to run the algorithm we use *reservoir sampling* to maintain a random set of at most k candidates from each group, reject all other members, and then run the offline algorithm at the end to determine how many candidates to select from each group. The drawback of this method is that it keeps as many as k/ε candidates on hold until the end. Thus, we develop an improved algorithm that solves the linear program in an online fashion, and uses the information it obtains along the way to more carefully choose how many candidates to keep from each group. This final algorithm reduces the number of candidates on hold by as much as a quadratic factor, down to 2k + 1 ε . For ratio utility, we are able to fully maximize the utility due to the way we decrease scores when the sum is greater than k. When the sum of scores is less than k, we must be careful in order to avoid being unfair to candidates eliminated early on. Thus, we maintain three groups; the top candidates, candidates undergoing comparisons, and candidates given uniform probability. The groups are dynamic and candidates can move from the first to the second and then the third group before getting rejected. Once the sum of scores exceeds k the groups are no longer needed. The algorithm considers at most O(k) candidates at any time. ## 1.2 Related Work Individual Fairness and Composition. Our work fits into the line of work initiated by Dwork et al. (2012) on *individual fairness*, which imposes constraints on how algorithms may distinguish specific pairs of individuals. Within this framework, difficulties associated with composing fair algorithms were first explored by Dwork & Ilvento (2019), which introduced the fair-cohort-selection problem that we study. Issues of composition in pipelines were further studied by Dwork et al. (2020). Because the scores figure into both our fairness constraint and utility measure, our work has some superficial similarity to work on *meritocratic fairness*. At a high-level meritocratic fairness (Joseph et al., 2016; Kearns et al., 2017; Joseph et al., 2017; Kleine Buening et al., 2022) is a kind of individual fairness where we assume there exists an intrinsic notion of merit and requires that candidates with higher merit be given no less reward than candidates with lower merit. In this work, we study a notion of individual metric fairness that, intuitively, tries to preserve the distances between the scores and not necessarily their order. Our algorithms turn out to also preserve the ordering, but meritocratically fair algorithms will not, in general, preserve the distances. We note that in our cases the scores s1*, . . . , s*n might or may not be reflective of true merit, since we assume that these scores satisfy individual fairness with respect to some underlying metric D, which may or may not reflect meritocratic values. The work by Kleine Buening et al. (2022) on set selection under meritocratic fairness is the most related to our work. Yet, their setting is different as the authors make the assumption that the utility function is non-linear and it depends on the combination of the selected candidates. One of our main assumptions is that every individual contributes to the cohort utility separately. The differences between the two problems are also highlighted in their work. Individually Fair Ranking and Cohort Selection. Our problem has some similarity to *fair ranking*, where we have to produce a permutation over all n candidates instead of just selecting a small cohort of k n candidates. Any algorithm for ranking implies an algorithm for cohort selection, since we can select the top k elements in the ranking as our cohort, and a cohort selected this way may inherit some notion of fairness from the ranking. However, we do not know of any ranking algorithms that can be used in this way to satisfy the notions of fairness and optimality we study in this work. In particular, the most closely related work on individually fair ranking by Bower et al. (2021) uses an incomparable formulation of the ranking problem, and it is not clear how to express our constraints in their framework. In addition to the difference in how fairness and utility are defined, we are not aware of any fair ranking papers that work in an online model similar to the one we study. Group Fairness. A complementary line of work, initiated by Hardt et al. (2016) considers notions of *group* fairness, which imposes constraints on how algorithms may distinguish in aggregate between individuals from different groups. While our work is technically distinct from work on group fairness, cohort/set selection has also been studied from this point of view (Zehlike et al., 2017; Stoyanovich et al., 2018) and different approaches for fair ranking have been proposed (Yang & Stoyanovich, 2017; Celis et al., 2018; Singh & Joachims, 2018; Yang et al., 2019; Zehlike & Castillo, 2020). Issues of composition also arise in this setting, as noted by several works (Bower et al., 2017; Kannan et al., 2019; Arunachaleswaran et al., 2021). ## 2 Preliminaries 2.1 Models We consider the problem of selecting a cohort using the output of an individually fair classifier as defined in Dwork & Ilvento (2019). Definition 2.1 (Individual Fairness (Dwork et al., 2012)). Given a universe of individuals U and a metric D, a randomized binary classifier C : U → {0, 1} is individually fair if and only if for all *u, v* ∈ U, |P(C(u) = 1) − P(C(v) = 1)| ≤ D(*u, v*). We restate the formal definition of the problem for convenience. Definition 2.2 (Fair Cohort Selection Problem). Given a universe of candidates U, an integer k and a metric D, select a set S of k individuals such that the selection is individually fair with respect to D, i.e. for all pairs of candidates u, v ∈ U, |P(u ∈ S) − P(v ∈ S)| ≤ D(*u, v*). In this work, we are interested in the setting of fairness under composition, and designing algorithms that exploit the fairness properties of their components instead of having direct access to D. An algorithm which solves this problem will either preserve or shrink the pairwise distances between the selection probabilities of candidates. We can think of the probability of C selecting a candidate u as a continuous score su. Definition 2.3 (Fairness-Preserving Cohort Selection Problem). Given a classifier C who assigns score si to candidate i, select a cohort of k individuals where each individual i has marginal selection probability pi such that for any pair of individuals i, j, |pi − pj *| ≤ |*si − sj |. In some contexts that we define below, we consider a relaxation of this definition by adding a small error ε to the pairwise distances. Definition 2.4 (ε-Approximate Fairness-Preserving Cohort Selection Problem). Given a classifier C who assigns score si to any individual i and a parameter ε ∈ (0, 1], select a cohort of k individuals where each individual i has marginal selection probability pi such that for all pairs of individuals i, j |pi−pj *| ≤ |*si−sj |+ε. When the initial classifier C is individually fair and the cohort selection algorithm preserves fairness εapproximately, then the cohort selection probabilities satisfy ε-individual fairness. Definition 2.5 (ε-Individual Fairness). Given a universe of individuals U, a metric D and an ε in [0, 1], a randomized binary classifier C : U → {0, 1} is ε-individually fair if and only if for all *u, v* ∈ U, |P(C(u) = 1) − P(C(v) = 1)| ≤ D(*u, v*) + ε. The problem of fairness-preserving cohort selection may be studied in an *offline* setting, where the universe of candidates is known in advance, as well as in an *online* setting, in which candidates arrive one-at-atime. Dwork & Ilvento (2019) prove that making immediate selection decisions while preserving fairness is impossible, so we relax this to a setting in which we do not need to give immediate decisions as candidates arrive. To control the degree of relaxation, we consider the number of candidates who wait for a response during the selection stage; we seek to minimize the number of these pending candidates. Individual fairness can be achieved by making uniform random selections among candidates, which is trivially possible in the offline case, and can be implemented in the online setting using reservoir sampling (Vitter, 1985). Therefore, it is important to consider an extension to the cohort selection problem in which we also want to maximize the utility of the selected cohort. We consider two measures of utility and construct algorithms for cohort selection which optimize these measures. Let the selection scores for individuals under classifier C be s1*, . . . , s*n, and let their marginal probabilities of selection under an algorithm A be p1*, . . . , p*n. Utilities Correlated with Classifier Output. We may consider that the classifier scores s directly indicate the qualifications of an individual and that the utility of a cohort is the sum of the scores of each member. Then, our evaluation measure becomes the expected utility of the selected cohort. Definition 2.6 (Linear Utility). Consider a set of n candidates whose scores from classifier C are s1*, . . . , s*n and whose selection probabilities by algorithm A are p1*, . . . , p*n. We define the linear utility of A to be Utilitylinear (A, {si}) = Pn i=1 sipi. As seen in Example 2.1, the maximum linear utility under the fairness-preserving constraint is not a monotone function of the input scores; as the score siincreases, the maximum linear utility may either increase, decrease, or stay constant. Yet, we show in Lemma 3.1 that it is robust to small input perturbations. Therefore, it can handle minor noise or errors in the input value. We exploit this property to develop an ε-individually fair algorithm for online cohort selection. Example 2.1. Suppose we want to select 2 people from a set of 4 candidates and classifier C assigns scores s1 = 0.1, s2 = 0.3, s3 = 0.6 and s4 = 0.9. The optimal fairness-preserving solution has marginal selection probabilities p1 = 0.125, p2 = 0.325, p3 = 0.625 and p4 = 0.925 and utility P4 i=1 pisi = 1.3175. By increasing the score of the first individual to s 0 1 = 0.3, the cohort selection probabilities become p 0 1 = 0.275, p02 = 0.275, p03 = 0.575 and p 0 4 = 0.875. The new utility is P4 i=1 p 0 i s 0 i = 1.2975, which is lower than the previous one. Arbitrary Utilities. Alternatively, we may consider the case where there exists an arbitrary, unknown utility value for each candidate u1*, . . . , u*n in [0, 1], which may differ from the scores s. Given si and ui, a simple quantity to study is the ratio utility achieved by an algorithm A: Pi P piui i siui . Since we do not know the distribution of utility, we must consider the utility achieved by an algorithm A for a worst-case utility vector ~u. Lemma 2.1. The worst case ratio utility is equal to the minimum ratio of selection probability and classifier score of one candidate min~u Pi P piui i siui = mini pi si . We use this equivalence to redefine the ratio utility as follows. Definition 2.7 (Ratio Utility). Given n candidates with scores si and a cohort selection algorithm A with marginal selection probabilities pi, let the ratio utility of an algorithm A be defined according to the coordinate with the minimum ratio: Utilityratio (A, {si}) = mini pi si . Of course other utility measures exist; we study the measures defined above because they capture a natural intuition about real world scenarios. We present an example to demonstrate the properties of these two utility functions and the performance of pre-existing cohort selection algorithms. Example 2.2. Consider the case where we would like to select 2 out of 3 candidates with scores s1 = 0.5, s2 = 0.5, s3 = 1. The optimal solution in terms of ratio and linear utility is to pick {1, 3} and {2, 3}, each with probability 0.5. This solution achieves ratio utility 1 and linear utility 1.5. The weighted sampling algorithm by Dwork & Ilvento (2019) selects each subset with probability proportional to its weight, and would select {1, 2} with probability 1/4, {1, 3} with probability 3/8, and {2, 3} with probability 3/8. The ratio utility of this solution is 3/4 and its linear utility is 11/8. PermuteThenClassify by Dwork & Ilvento (2019) selects {1, 2} with probability 1/12 and {1, 3} or {2, 3} with probability 11/24 each. This solution achieves ratio utility 11/12 and linear utility 35/24. Hence, we see that weighted sampling and PermuteThenClassify are sub-optimal for both utility definitions. ## 2.2 Dependent Rounding Our cohort selection algorithms for ratio and linear utility in the offline and online settings are based on a simple dependent rounding algorithm described in the appendix. This algorithm makes one pass over a list of numbers in [0, m], where m ∈ R, and rounds them so that their sum is preserved and the expected value of each element after rounding is equal to its original value. The algorithm operates on two entries at a time - call these a and b. If a + b ≤ m, the algorithm randomly rounds one of them to a + b and the other one to 0 with the appropriate probabilities. If a + *b > m*, it rounds one to m and the other to the remainder. This rounding procedure is a special case of rounding a fractional solution in a matroid polytope (in this case, we have a uniform matroid). This problem has been studied extensively with rounding procedures satisfying additional desirable properties (see e.g. Chekuri et al. (2010)). Here we use a simple and very efficient rounding algorithm for the special case of the problem arising in our work. Lemma 2.2. Let a1, . . . , an be a list of numbers in [0, m] *with* x =Pn i=1 ai*. There is a randomized algorithm* that outputs a˜1, . . . , a˜n ∈ [0, m] *such that* b x m c of the ai will be equal to m, one ai will be x − b xm cm, the rest will be equal to 0, and for all i ∈ {1*, . . . , n*}, E[˜ai] = ai*. When* m = 1, we call this algorithm round-pr and when a1, . . . , an are natural numbers we call it *round-nat*. We use the rounding procedure in two ways. We call round-pr when we want to round a list of real numbers in [0, 1] which represent selection probabilities and round-nat to round natural numbers which correspond to counts. Corollary 2.1. If m = 1 and Pn i=1 ai = k ∈ N, then after the dependent rounding of round-pr k *elements* will be equal to 1 *and the rest will be equal to* 0. ## 3 Linear Utility The first definition of utility we study is that of linear utility. In this setting, the aim of the cohort selection is to maximize the expected sum of scores of the group of k people selected while preserving fairness. We can formulate this problem as a linear program, as shown in Section 1.1. The key idea of the solution is to move all the selection scores up or down by the same amount, depending on the value of their sum, and clip the probabilities that are less than zero or over one. The algorithm we propose for the online setting solves approximately a relaxation of the cohort selection problem, where the probabilities of two candidates can differ by at most the given metric plus a small constant ε. The new problem is defined as the linear program presented in Section 1.1, where the second constraint, ∀*i, j* ∈ [n], |pi − pj *| ≤ |*si − sj |, is replaced by ∀i, j ∈ [n], |pi − pj *| ≤ |*si − sj | + ε. In the offline setting, the algorithm has full access to the set of candidates and their scores from classifier C. By Corollary 2.1, if the classifier's scores sum up to k, then the rounding algorithm can form a cohort by simply using the input scores as the marginal probabilities of selection. Yet, the sum of the scores assigned by C might not be k. If it is less than k, Algorithm 1 moves all the probabilities up by the same amount and clips those that exceed 1, so that their sum becomes equal to k. In more detail, the marginal selection probability of candidate i becomes pi = min{si + c, 1}, where constant c is such that Pn i=1 pi = k. This adjustment preserves the probability differences between the pairs of candidates, unless some candidate gets assigned probability 1, in which case some differences decrease. As a result, the differences of the new probabilities will be bounded by the same metric as the scores. The case where the sum of scores is greater than k is treated similarly. More specifically, the new marginal probabilities are of the form pi = max{0, si −c}. After the adjustment, Algorithm 1 selects the cohort by running the dependent rounding procedure. Theorem 3.1. For any classifier C that assigns scores s1, . . . , sn to n candidates, Algorithm 1 solves the fairness-preserving cohort selection problem by selecting k candidates with marginal probabilities p1*, . . . , p*n which achieve optimal linear utility Pn i=1 pisi. Corollary 3.1. If C *is individually fair, then Algorithm 1 is individually fair.* For the online setting of the problem with linear utility, we present Algorithm 2 which reads C's output from a stream and selects a cohort with high utility while deferring the decision for a small number of candidates. Alg. 1: Offline Cohort Selection for Linear Utility Input: scores s1*, . . . , s*n ∈ [0, 1] from C, cohort size k Output: set of accepted candidates 1 sum ←Pn i=1 si 2 if sum < k **then** // move scores up 3 c ← k−sum n; pi ← si + c, ∀i ∈ [n] 4 **while** ∃pi > 1 do 5 S<1 ← {j : pj < 1} 6 pj ← pj + pi−1 |S<1| , ∀j ∈ S<1 7 pi ← 1 8 **else** // move scores down 9 c ← sum−k n; pi ← si − c, ∀i ∈ [n] 10 **while** ∃pi < 0 do 11 S>0 ← {j : pj > 0} 12 pj ← pj +pi |S>0| , ∀j ∈ S>0 13 pi ← 0 // Now list sums to k and all pi ∈ [0, 1] 14 {p˜i} ←round-pr(p1*, . . . , p*n, 1) // select cohort of size k 15 **return** candidates with non-zero p˜i While processing the stream, this algorithm only rejects candidates and releases all the acceptances at the end of the stream. The main difference in comparison to the offline cohort selection algorithm is that Algorithm 2 splits the candidates into groups with similar scores, within an ε interval, and treats any member of a group as equivalent. Hence, the final probability of being selected in the cohort is equal for any candidate of the same group. This leads to a relaxation of the problem, which we call ε-approximate fairness-preserving cohort selection problem. As we mentioned, the algorithm splits the candidates from the stream into groups according to their score from C. Particularly, the interval (0, 1] is divided into m intervals of size ε each, where m = d 1 ε e. The i-th candidate gets assigned to group 0 if si = 0 or group g ∈ {1, . . . , m} if si ∈ ((g −1)*ε, gε*]. Once candidate i is in the group, their score gets rounded up and their new score sˆiis the same as that of all the other members of the group, sˆ g = gε. The use of the groups affects the performance of the algorithm in terms of not only individual fairness, but also utility. Lemma 3.1 shows that the decrease in utility is caused only by the use of rounding, as Algorithm 2 achieves the same linear utility as the corresponding offline algorithm when the scores are rounded to multiples of ε. Lemma 3.1. Given selection scores s1, . . . , sn from C, for a set of n *candidates and a parameter* ε ∈ (0, 1], we split (0, 1] *into* m = d 1 ε e intervals of length ε and for all i ∈ [n] we set sˆi = gε, where g *is such that* si ∈ ((g − 1)ε, gε]. When Algorithm 1 runs for input sˆ1, . . . , sˆn and cohort size k it solves the ε-approximate fairness-preserving cohort selection problem with marginal selection probabilities p1, . . . , pn, and it achieves linear utility Pn i=1 pisi ≥Pn i=1 p ∗ i si − k(ε + 2√ε)*, where* p ∗ 1 , . . . , p∗n is the optimal solution for the offline fairness-preserving problem for input s1*, . . . , s*n. Since for each group we keep only some people on hold, we preserve the probability information of the rejected candidates by considering that each pending candidate represents themselves and a fraction of the rejected people from their group. The fraction of people represented by the i-th candidate is denoted by ni. One approach is to maintain at most k people pending per group uniformly at random and have every candidate within a certain group represent the same fraction of people. This basic algorithm keeps k/ε candidates on hold. Our algorithm reduces the number of people pending by allowing candidates of the Alg. 2: Online Cohort Selection for Linear Utility Input: stream of scores s1*, . . . , s*n ∈ [0, 1] from C, cohort size k, constant ε ∈ (0, 1] Output: set of accepted candidates 1 n ← 0; sum ← 0// number of candidates and sum of scores 2 n g ← 0, for all groups g ∈ [d 1 ε e]// size of group g 3 for candidate i *in stream* do 4 add i to group g where si ∈ ((g − 1)*ε, gε*] 5 n g ← n g + 1 6 sˆi ← gε; sum ← sum + ˆsi 7 ni ← 1; n ← n + 1 // Compute group scores for this input 8 if sum < k **then** 9 c ← k−sum n 10 s g ← gε + c, for all groups g 11 **while** ∃ group g *with* s g > 1 do 12 F<1 ← {group f : s f < 1} 13 n<1 ←Pf∈F<1 n f 14 s f ← s f + n g (s g−1) n<1, ∀f ∈ F<1 15 s g ← 1 16 **else if** sum > k **then** 17 c ← sum−k n 18 s g ← gε − c, for all groups g 19 **while** ∃ group g *with* s g < 0 do 20 F>0 ← {group f : s f > 0} 21 n>0 ←Pf∈F>0 n f 22 s f ← s f + n g s g n>0 , ∀f ∈ F>0 23 s g ← 0 24 **else** s g ← gε, for all groups g 25 for *group* g do 26 if s g > 0 **then** 27 {ni: i in g} ← round-nat({ni: i in g}, v = b 1 s g c) // we ensure niv ≤ 1 28 reject candidate i if ni = 0 29 **else** 30 reject all candidates in g 31 s˜i ← nis g, for all groups g and candidates i in g // Now candidate scores sum up to k and all s˜i in [0, 1] 32 {s˜i} ← round-pr({s˜i: i in any group}, 1)// select cohort of size k 33 **return** candidates with non-zero s˜i same group to represent varying fractions of people. Procedure round-nat is used to eliminate candidates and determine what fraction of people's selection probabilities each candidate represents. Theorem 3.2. For any classifier C that assigns scores s1, . . . , sn to n *candidates, Algorithm 2 solves the* online ε-approximate fairness-preserving cohort selection problem for any ε ∈ (0, 1] *by selecting a cohort* of size k with marginal probabilities p1, . . . , pn*, achieves linear utility* Pn i=1 pisi ≥Pn i=1 p ∗ i si − k(ε + 2√ε) (where p ∗ 1 , . . . , p∗n is the optimal solution for the offline fairness-preserving problem for input s1, . . . , sn*), and* keeps at most O(k + 1 ε ) *candidates pending.* Corollary 3.2. If C is individually fair, then Algorithm 2 is ε-individually fair. ## 4 Ratio Utility In Definition 2.7 we consider the ratio utility obtained by a selection algorithm, and show that this is controlled by the minimum ratio of pi and si. We begin with the scenario of selecting k of n individuals when all candidates are known in advance. Dwork & Ilvento (2019) give a solution to this scenario (with non-optimal utility, as shown in Example 2.2); we present Algorithm 3, an alternate one that achieves the optimal ratio utility. Notice that the sum of classifier scores Pi si need not add up to k. If the sum exceeds k, the algorithm simply scales down all probabilities so that the new sum is k. It is not hard to show that this operation preserves fairness and gives optimal utility. This multiplicative scaling will not work when the sum is smaller than k, however, since it increases the probability difference among candidates and can be unfair. Intuitively, the solution in this case is to additively increase all probabilities by the same amount, thus preserving fairness. However, some care is needed, as no probability can exceed 1. Alg. 3: Offline Cohort Selection for Ratio Utility Input: scores s1*, . . . , s*n ∈ [0, 1] from C, cohort size k Output: set of accepted candidates 1 sum ←Pn i=1 si 2 if sum < k **then** // move scores up 3 c ← k−sum n; pi ← si + c, ∀i ∈ [n] 4 **while** ∃pi > 1 do 5 S<1 ← {j : pj < 1} 6 pj ← pj + pi−1 |S<1| , ∀j : pj < 1 7 pi ← 1 8 **else** // move scores down 9 pi ← si·k sum , ∀i ∈ [n] // Now list sums to k and all pi ∈ [0, 1] 10 {p˜i} ←round-pr(p1*, . . . , p*n, 1) // select cohort of size k 11 **return** candidates with non-zero p˜i Lemma 4.1. If sum < k, Algorithm 3 increases each input score si to a final output pi = si + αi ≥ si *such* that all of the candidates j with pj < 1 *receive the same cumulative adjustment value* αj = v. Theorem 4.1. For any classifier C that assigns scores s1, . . . , sn to n candidates, Algorithm 3 solves the fairness-preserving cohort selection problem by selecting k candidates with marginal probabilities p1*, . . . , p*n that achieve the optimal value of ratio utility mini pi si . Corollary 4.1. If C *is individually fair, then Algorithm 3 is individually fair.* We now consider the online scenario, in which our goal is to keep as few candidates pending as possible. It is clear that the number of candidates on hold must be at least k since we need to accept k candidates at the end. We provide an algorithm that achieves optimal ratio utility for the online fairness-preserving cohort selection problem, while leaving only O(k) candidates pending. We use a parameter α ∈ [0, 1/2], which controls the number of candidates pending, with α = 1/2 by default. The update procedure depends on the sum of scores of the candidates seen so far. We maintain a set of k/α candidates with highest scores called top, and two sets rest and rand of the remaining candidates. A new candidate i is added to either top (and thus bumps some other candidate from top to rest), or they are added to rest. We make sure Alg. 4: Online Cohort Selection for Ratio Utility Input: stream of scores s1*, . . . , s*n ∈ [0, 1] from C, cohort size k, constant α ∈ [0, 1/2] Output: set of accepted candidates 1 sum ← 0 2 top ← ∅; rest ← ∅; rand ← ∅ 3 for candidate i *in stream* do 4 sum ← sum + si; pi ← si 5 if sum < k **then** 6 if |top| < dk/αe **then** add i to top 7 **else if** min(sj ) in top < si **then** 8 move min element from top to rest 9 add i to top 10 **else** add i to rest 11 {pi: i ∈ rest} ←round-pr({pi: i ∈ rest }, 1 − α) 12 for j in rest *with* pj = 0 do 13 remove j from rest 14 add j to unif. reservoir sample of size k 15 reject candidate that was eliminated from the unif. reservoir sample 16 set rand to unif. reservoir sample 17 **else** 18 if *first occurrence of sum* ≥ k **then** 19 reject all candidates in rand and remove rand 20 store top and rest in pending 21 incr ← k sum ; scale ← k sum 22 **else** 23 incr ← sum−si sum ; scale ← scale · incr 24 pi ← pi· scale 25 pj ← pj · incr, ∀j ∈ pending 26 add i to pending 27 {pi: i ∈ pending} ←round-pr({pi: i ∈ pending}, 1) 28 reject j and remove it from pending if pj = 0 29 if sum < k **then** 30 c ← k−sum n; pi ← pi + c, ∀i ∈ top ∪ rest 31 pi ← k−Pi∈top∪rest pi |rand|, ∀i ∈ rand 32 **while** ∃pi > 1 do 33 S(≥1) ← {i : pi ≥ 1}; c ← pi−1 n−|S(≥1)| 34 pj ← pj + c, ∀j ∈ top ∪ rest with pj < 1 35 set nmodified to number of modified people 36 pj ← pj + c·(n−|S(≥1)|−nmodified) |rand|, ∀j ∈ rand 37 pi ← 1 38 {pi: i ∈ top ∪ rest ∪ rand} ←round-pr({pi: i ∈ top ∪ rest ∪ rand}, 1) 39 set pending to indices of nonzero pi 40 **return** pending the list rest is not too big by rounding and eliminating candidates. Eliminated candidates are sampled uniformly to enter rand, which has size k. During the online phase, it is tempting to use the idea from the offline case to eliminate candidates; take two candidates from rest with scores a and b and round them to a + b and 0. However, we must be careful when rounding rest to ensure that probabilities will not later exceed 1 if the stream ends with sum < k. The key idea (and motivation for having top) is that candidates not in top have increments at most α, which we can see as follows. For rest to be non-empty, we must have at least *n > k/α* candidates. Let x be the number of candidates who are in top when the algorithm finishes and achieve probability 1. For each of the other candidates, the increment pi − siis less than (k − x)/(n − x) *< k/n*, since *k < n*. Thus that cumulative increment is at most α, and it is safe to round probabilities in rest to 0 and 1 − α. If the stream ends with Pi si < k, we will increase the scores of everyone pending, and use rand to compensate for already eliminated candidates. Let A be the set of candidates in top and rest and A¯ be the set of all others seen. As in the offline case, we will evenly increase the probabilities of all candidates by adding the appropriate c to each candidate, and using water-filling where some candidates reach 1. For candidates in A, this proceeds exactly as in the offline case. For candidates in A¯, we increase the probabilities without explicitly storing all of them by maintaining a set called rand consisting of k uniformly random candidates. Each member of rand receives probability equal to 1/k times the sum of the probabilities of the candidates in A¯. Since everyone in A¯ has the same probability, this rounding clearly preserves the marginal probabilities. Finally, we use the offline algorithm to select the cohort from the union of rand and A. The case where the sum of probabilities exceeds k is simpler. The algorithm always scales down all probabilities so that they add up to exactly k. When a new candidate appears, they receive a probability equal to what C gives them, times the current scaling factor, and get added to top ∪ rest. The algorithm then scales down all probabilities so that the sum is exactly k and reduces the size of top ∪ rest by repeatedly rounding pairs of candidate as in the offline setting. In this case, the set rand is not used. Theorem 4.2. For any classifier C that assigns scores s1, . . . , sn to n candidates, Algorithm 4 solves the fairness-preserving cohort selection problem by selecting k candidates with marginal probabilities p1*, . . . , p*n that achieve the optimal value of ratio utility. The algorithm leaves no more than O(k) candidates pending at any time. Corollary 4.2. If C *is individually fair, then Algorithm 4 is individually fair.* ## 5 Conclusion In this work, we defined two notions of utility for the problem of cohort selection, linear and ratio utility, and designed polynomial time algorithms that optimize them (or approximately optimize them) while preserving the fairness of the given classifier. This means that if the given classifier is individually fair, then our cohort selection algorithms are also individually fair with respect to the same metric. We studied two settings, the standard offline setting and an online setting where we can reject candidates at any stage of the process and accept candidates only at the end, keeping the number of candidates that are waiting for the decision low. While our algorithms for ratio utility and offline linear utility are optimal in terms of fairness and utility, our online algorithm for linear utility achieves ε-individual fairness with an additive error in the utility and the number of candidates kept on hold. Overall, our approach is based on the assumptions that every candidate contributes to the utility of the cohort separately and that the candidate utilities are correlated with their selection scores given by the individually fair classifier. As the linear utility requires the assumption that the utilities of the candidates are their classification scores, we tried to relax it by defining the ratio utility in which the utilities are unknown but still correlated with the classification scores. The natural extension of this work would be to design algorithms that optimize a utility function where the candidate utilities are known and decoupled from the classification scores. Another interesting direction would be to relax our first assumption and study utility functions where the candidates do not contribute separately, but the cohort utility depends on the combination of candidates selected. ## Acknowledgments KB and JU were supported by NSF awards CCF-1750640 and CNS-2120603. KB and HN were supported by NSF grant CCF-1750716. ## References Eshwar Ram Arunachaleswaran, Sampath Kannan, Aaron Roth, and Juba Ziani. Pipeline Interventions. In *Innovations in Theoretical Computer Science Conference*, ITCS '21, 2021. https://arxiv.org/abs/ 2002.06592. Amanda Bower, Sarah N Kitchen, Laura Niss, Martin J Strauss, Alexander Vargas, and Suresh Venkatasubramanian. Fair pipelines, 2017. https://arxiv.org/abs/1707.00391. Amanda Bower, Hamid Eftekhari, Mikhail Yurochkin, and Yuekai Sun. Individually fair rankings. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. https://arxiv.org/abs/2103.11023. L. Elisa Celis, Damian Straszak, and Nisheeth K. Vishnoi. Ranking with fairness constraints. In *45th* International Colloquium on Automata, Languages, and Programming, ICALP 2018, July 9-13, 2018, Prague, Czech Republic, volume 107 of *LIPIcs*, pp. 28:1–28:15. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2018. doi: 10.4230/LIPIcs.ICALP.2018.28. URL https://doi.org/10.4230/LIPIcs.ICALP. 2018.28. https://arxiv.org/abs/1704.06840. Chandra Chekuri, Jan Vondrák, and Rico Zenklusen. Dependent randomized rounding via exchange properties of combinatorial structures. In *IEEE Symposium on Foundations of Computer Science*, FOCS '10. IEEE, 2010. https://arxiv.org/abs/0909.4348. Cynthia Dwork and Christina Ilvento. Fairness under composition. In *Innovations in Theoretical Computer* Science, ITCS '19, 2019. http://arxiv.org/abs/1806.06122. Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. Fairness through awareness. In *Innovations in Theoretical Computer Science*, ITCS '12. ACM, 2012. https://arxiv.org/ abs/1104.3913. Cynthia Dwork, Christina Ilvento, and Meena Jagadeesan. Individual Fairness in Pipelines. In Symposium on Foundations of Responsible Computing, FORC '20, 2020. https://arxiv.org/abs/2004.05167. Moritz Hardt, Eric Price, and Nathan Srebro. Equality of opportunity in supervised learning. In Conference on Neural Information Processing Systems, NIPS '16, 2016. https://arxiv.org/abs/1610.02413. Matthew Joseph, Michael J. Kearns, Jamie Morgenstern, and Aaron Roth. Fairness in learning: Classic and contextual bandits. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 325–333, 2016. https://arxiv.org/abs/1605.07139. Matthew Joseph, Michael Kearns, Jamie Morgenstern, Seth Neel, and Aaron Roth. Fair algorithms for infinite and contextual bandits, 2017. https://arxiv.org/abs/1610.09559. Sampath Kannan, Aaron Roth, and Juba Ziani. Downstream effects of affirmative action. In Conference on Fairness, Accountability, and Transparency, FAT* '19. ACM, 2019. https://arxiv.org/abs/1808. 09004. Michael Kearns, Aaron Roth, and Zhiwei Steven Wu. Meritocratic fairness for cross-population selection. In *Proceedings of the 34th International Conference on Machine Learning - Volume 70*, ICML'17, pp. 1828–1836. JMLR.org, 2017. https://arxiv.org/abs/1805.08716. Thomas Kleine Buening, Meirav Segal, Debabrota Basu, Anne-Marie George, and Christos Dimitrakakis. On meritocracy in optimal set selection. In *Equity and Access in Algorithms, Mechanisms, and Optimization*, EAAMO '22, New York, NY, USA, 2022. Association for Computing Machinery. ISBN 9781450394772. doi: 10.1145/3551624.3555305. URL https://doi.org/10.1145/3551624.3555305. Ashudeep Singh and Thorsten Joachims. Fairness of exposure in rankings. In *Proceedings of the 24th ACM* SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD '18, pp. 2219–2228, New York, NY, USA, 2018. Association for Computing Machinery. ISBN 9781450355520. doi: 10.1145/3219819. 3220088. URL https://doi.org/10.1145/3219819.3220088. https://arxiv.org/abs/1802.07281. Julia Stoyanovich, Ke Yang, and H. V. Jagadish. Online set selection with fairness and diversity constraints. In *Advances in Database Technology - EDBT 2018*, Advances in Database Technology - EDBT, pp. 241– 252. OpenProceedings.org, 2018. doi: 10.5441/002/edbt.2018.22. Jeffrey S. Vitter. Random sampling with a reservoir. *ACM Trans. Math. Softw.*, 11(1):37–57, March 1985. ISSN 0098-3500. doi: 10.1145/3147.3165. URL http://doi.acm.org/10.1145/3147.3165. Ke Yang and Julia Stoyanovich. Measuring fairness in ranked outputs. In *Proceedings of the 29th International Conference on Scientific and Statistical Database Management*, SSDBM '17, New York, NY, USA, 2017. Association for Computing Machinery. ISBN 9781450352826. doi: 10.1145/3085504.3085526. URL https://doi.org/10.1145/3085504.3085526. https://arxiv.org/abs/1610.08559. Ke Yang, Vasilis Gkatzelis, and Julia Stoyanovich. Balanced ranking with diversity constraints. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI-19, pp. 6035–6042. International Joint Conferences on Artificial Intelligence Organization, 7 2019. https: //arxiv.org/abs/1906.01747. Meike Zehlike and Carlos Castillo. Reducing disparate exposure in ranking: A learning to rank approach. In *Proceedings of The Web Conference 2020*, pp. 2849–2855, New York, NY, USA, 2020. Association for Computing Machinery. ISBN 9781450370233. URL https://doi.org/10.1145/3366424.3380048. https://arxiv.org/abs/1805.08716. Meike Zehlike, Francesco Bonchi, Carlos Castillo, Sara Hajian, Mohamed Megahed, and Ricardo Baeza-Yates. Fa*ir: A fair top-k ranking algorithm. In *Proceedings of the 2017 ACM on Conference on Information* and Knowledge Management, CIKM '17, pp. 1569–1578, New York, NY, USA, 2017. Association for Computing Machinery. ISBN 9781450349185. doi: 10.1145/3132847.3132938. URL https://doi.org/ 10.1145/3132847.3132938. https://arxiv.org/abs/1706.06368. ## A Proofs And Algorithm From Section 2 A.1 Proof Of Lemma 2.1 Lemma 2.1. The worst case ratio utility is equal to the minimum ratio of selection probability and classifier score of one candidate min~u Pi P piui i siui = mini pi si . Proof. Let j be the index of the candidate with the smallest ratio of model output and classifier score, i.e. pj sj ≤ pi si , ∀i 6= j. Compare the minimum over all utility vectors to a particular choice of utility vector u ∗ satisfying u ∗ j = 1, and u ∗ i6=j = 0. We know that the ratio for any particular vector will be at least as large as the minimum: min~u Pi P piui i siui ≤ Pi piu ∗ P i i siu ∗ i = pju ∗ j sju ∗ j = pj sj = mini pi si . We can also obtain a bound from the other direction. Let m be the smallest ratio between model output and classifier score m = mini pi/si and u ∈ [0, 1]n be any utility vector with Pi ui > 0. Then, for all i ∈ [n] we have piui ≥ msiui. Therefore, min~u Pi P piui i siui ≥ mini pi si ## A.2 Dependent Rounding Algorithm Here we include a detailed description of the dependent rounding algorithm (Algorithm 5) mentioned in Section 2.2. ## A.3 Proof Of Lemma 2.2 Lemma 2.2. Let a1*, . . . , a*n be a list of numbers in [0, m] with x =Pn i=1 ai. There is a randomized algorithm that outputs a˜1, . . . , a˜n ∈ [0, m] such that b x m c of the ai will be equal to m, one ai will be x − b xm cm, the Algorithm 5: Rounding Input: a list of n numbers a1, a2*, . . . , a*n ∈ R≥0 and the maximum value of a rounded number m ∈ R≥0 Output: list of rounded numbers a˜1, a˜2*, . . . ,* a˜n ∈ R≥0 1 pendingIndex ← 1 2 for i *from* 2 to n do 3 if ai = 0 and apendingIndex = 0 **then** continue to next i 4 a ← ai; b ← apendingIndex 5 choose u randomly from *Unif*(0, 1) 6 if a + b ≤ m **then** 7 if u < a a+b then 8 ai ← a + b ; apendingIndex ← 0 ; pendingIndex ← i 9 **else** 10 ai ← 0 ; apendingIndex ← a + b 11 end 12 **else** 13 if u < m−b 2m−a−b then 14 ai ← m ; apendingIndex ← a + b − m 15 **else** 16 ai ← a + b − m ; apendingIndex ← m ; pendingIndex ← i 17 end 18 end 19 end 20 **return** a1, a2*, . . . , a*n rest will be equal to 0, and for all i ∈ {1*, . . . , n*}, E[˜ai] = ai. When m = 1, we call this algorithm round-pr and when a1*, . . . , a*n are natural numbers we call it round-nat. Proof. We begin by showing that for all i ∈ [n], E[˜ai] = ai. At step i, we have two numbers a and b which get rounded and obtain new values denoted by a˜ and ˜b, respectively. The rounding depends on the value of a + b. If a + b is less than or equal to β, then E[˜a] = (a + b) a a+b = a. If a + b is greater than β and at most 2β, then E[˜a] = vβ−b 2β−a−b + (a + b − β)β−a 2β−a−b = a. Similarly, we obtain E[ ˜b] = b. Since the expected values remain constant throughout the process, we conclude that for all i ∈ [n], E[˜ai] = ai. We notice that for any step i of the algorithm and for all j that are smaller than i but are not the pendingIndex, aj = 0 or aj = β. As a result, at the end of the algorithm all elements with index j such that *j < n* and j 6= pendingIndex and one of the n-th or the pendingIndex elements are rounded to either 0 or β. The remaining element is the only one that can have a value in all [0, β]. Since Pn i=1 ai = sum, b sum β c elements are β and if the remainder sum − b sum β cβ is non-zero, it is assigned to the remaining element. ## A.4 Proof Of Corollary 2.1 Corollary 2.1. If m = 1 and Pn i=1 ai = k ∈ N, then after the dependent rounding of round-pr k elements will be equal to 1 and the rest will be equal to 0. Proof. The proof follows directly from Lemma 2.2. ## B Proofs From Section 3 B.1 Proof Of Theorem 3.1 Theorem 3.1. For any classifier C that assigns scores s1*, . . . , s*n to n candidates, Algorithm 1 solves the fairness-preserving cohort selection problem by selecting k candidates with marginal probabilities p1*, . . . , p*n which achieve optimal linear utility Pn i=1 pisi. Proof. Algorithm 1 consists of two parts. In the first part, it modifies the input scores so that they sum up to k, which is the size of the cohort, and for the second part it randomly selects k individuals by calling the round-pr subroutine. We can simplify the first part by rewriting it in a more concise way. If the sum of C's scores s1*, . . . , s*n is less than k, then for any candidate i ∈ [n] we set pi = min{si + b, 1}, with b in [0, 1] such that Pn i=1 pi = k. More specifically, pi are initially set to si + c so that their sum is equal to k. Their sum will remain equal to k, because the following loop only redistributes probability mass among candidates. If at any iteration some candidate i has pi > 1, then their marginal selection probability is set to 1 and the excess probability mass is redistributed evenly to all candidates with marginal probabilities less than 1. At the end, any probability pi that is less than 1 is equal to si plus a constant b that consists of the initial c and the fractions of the probabilities that exceeded 1. Similarly, we have that if the sum of C's scores is greater than k, then for any candidate i, pi = max{si − b, 0} for a real number b ∈ [0, 1] such that Pn i=1 pi = k. If the sum is equal to k, the cohort selection marginal probabilities are equal to C's scores. Finally, by Lemma 2.2 we obtain that for any i ∈ [n] the expected value of indicator p˜iis pi, and since p˜iis either 0 or 1, the i-th candidate is selected with probability pi. First, we want to show that the cohort formed by Algorithm 1 preserves fairness. Depending on the value of Pn i=1 si, we have three cases. 1. Pn i=1 si = k. The input scores are used unaltered as the marginal probabilities for the cohort selection and, thus, we have that for any pair of indices *i, j*, |pi − pj | = |si − sj |. 2. Pn i=1 si < k. The cohort selection marginal probabilities are of the form pi = min{si + b, 1}. For any pair of individuals *i, j*, if both have probability of being selected 1, then |pi − pj | = 0. Else, if pi = 1 and pj = sj + b, we have |pi − pj | < |si − sj | because si + b ≥ 1. Finally, if pi = si + b and pj = sj + b, then it holds that |pi − pj | = |si − sj |. As a result, we conclude that for any pair of individuals *i, j*, we have |pi − pj *| ≤ |*si − sj |. 3. Pn i=1 si > k. In this case, the cohort selection probabilities are of the form pi = max{si − b, 0}. For any pair of individuals *i, j*, if both have zero probability of being selected then |pi − pj | = 0. Else, if pi = 0 and pj = sj − b, we have |pi − pj | < |si − sj |. Finally, if pi = si − b and pj = sj − b, then it holds that |pi − pj | = |si − sj |. Thus, for any pair of individuals *i, j*, we have |pi − pj *| ≤ |*si − sj |. Second, we show that this cohort optimizes linear utility. The fairness-preserving solution that optimizes linear utility solves the linear program defined in Section 1.1 and satisfies the first constraint with equality, i.e. Pn i=1 pi = k. This holds because otherwise we would be able to increase pi by setting p 0 i = min{pi+d, 1}, for some d ∈ (0, 1], so that Pn i=1 p 0 i = k and obtain greater utility while not violating any constraint. We assume that there exists a different fairness-preserving solution p 0 1 , . . . , p0n which achieves higher utility, i.e. Pn i=1 p 0 i si >Pn i=1 pisi. Without loss of generality we can assume that the original probabilities si are sorted in increasing order. Specifically, we have s1 ≤ s2 ≤ *. . .* ≤ sn. The solution of Algorithm 1 maintains the same order, i.e. p1 ≤ p2 ≤ *. . .* ≤ pn. Let i be the individual with the smallest index for whom the two solutions differ. There are two possible cases. If p 0 i < pi, then since Pn i=1 pi =Pn i=1 p 0 i = k there exists an individual with *j > i* such that p 0 j > pj . In addition, we see that pi > 0 and pj < 1. The values of the probabilities depend on the sum of the input scores in comparison to k. If the sum is greater than k, all pi that are not zero are of the form pi = si − b. Hence, considering that p 0 i < pi ≤ pj < p0j we obtain |p 0 i−p 0 j | = p 0 j−p 0 i > sj−b−(si−b) = sj−si = |si−sj |. Similarly, if the sum is less than k, the values of pi that are not one are of the form pi = si+b, therefore giving |p 0 i−p 0 j | = p 0 j −p 0 i > sj +b−(si+b) = sj −si = |si−sj |. If the sum is equal to k, we have |p 0 i − p 0 j | = p 0 j − p 0 i > pj − pi = sj − si = |si − sj |. In all three cases the constraints of the optimization are violated. If p 0 i > pi, then there exists an individual with *j > i* such that p 0 j < pj . Let j be the smallest such index. If there exists another index *l > j* such that p 0 l ≥ pl, then by the previous argument the constraints are not satisfied. Therefore, for any candidate l after j p0l < pl. This solution achieves non-optimal utility because there exist candidates with *h < l* and p 0 h > ph, such that we can move probability mass from candidates h to individuals l without violating the constraints. By constructing a solution p 00 1 , . . . , p00n which gives a greater utility than p 0 1 , . . . , p0n , we arrive at a contradiction. Therefore, Algorithm 1 finds the optimal fairness-preserving solution. ## B.2 Proof Of Corollary 3.1 Corollary 3.1. If C is individually fair, then Algorithm 1 is individually fair. Proof. The individual fairness condition for Algorithm 1 is satisfied by the assumption that the input scores are individually fair. More specifically, if the individual scores from C are individually fair with respect to a metric D, we obtain that ∀i, j ∈ [n], |pi − pj | ≤ |si − sj | ≤ D(*i, j*). ## B.3 Proof Of Lemma 3.1 Lemma 3.1. Given selection scores s1*, . . . , s*n from C, for a set of n candidates and a parameter ε ∈ (0, 1], we split (0, 1] into m = d 1 ε e intervals of length ε and for all i ∈ [n] we set sˆi = gε, where g is such that si ∈ ((g − 1)*ε, gε*]. When Algorithm 1 runs for input sˆ1*, . . . ,* sˆn and cohort size k it solves the ε-approximate fairness-preserving cohort selection problem with marginal selection probabilities p1*, . . . , p*n, and it achieves linear utility Pn i=1 pisi ≥Pn i=1 p ∗ i si − k(ε + 2√ε), where p ∗ 1 , . . . , p∗n is the optimal solution for the offline fairness-preserving problem for input s1*, . . . , s*n. Proof. We have that for all individuals i in [n], 0 ≤ sˆi − si ≤ ε. Therefore, we obtain that for any pair of individuals i, j, |sˆi − sˆj *| ≤ |*si − sj | + ε. By Theorem 3.1 we have that |pi − pj *| ≤ |*sˆi − sˆj |. Combining the two inequalities, we obtain that fairness is preserved ε-approximately. Note that Algorithm 1 always adjusts the scores of candidates such that its final output probabilities sum to k. For any candidate i we observe that since the rounded score sˆiis greater than si by at most ε, the two output probabilities, pi and p ∗ i are also close, at most ε apart. Depending on the sum of the input scores there are three cases. 1. If Pn i=1 si ≤ k and Pn i=1 sˆi ≤ k, then Algorithm 1 shifts all the probabilities up. More specifically, we have that p ∗ i = min{1, si + x} and pi = min{1, sˆi + y}, for some non-negative x and y. Suppose that *y > x*, then for any candidate i whose marginal selection probability pi has not been clipped to 1, pi = ˆsi + *y > s*i + x = p ∗ i . By summing up for all candidates we obtain that k =Pn i=1 p ∗ P i < n i=1 pi = k, which is not feasible. Similarly, suppose that *x > y* +ε, then for any candidate i whose marginal selection probability p ∗ i is has not been clipped, p ∗ i = si + x > sˆi + y = pi. As a result, we get that Pn i=1 p ∗ i >Pn i=1 pi, which is again false. Hence, we see that y ≤ x ≤ y + ε. 2. If Pn i=1 si ≥ k and Pn i=1 sˆi ≥ k, then Algorithm 1 shifts all the probabilities down, so that both sums become equal to k. Thus, p ∗ i = max{0, si −x} and pi = max{0, sˆi −y}, for some non-negative x and y. Suppose that *y < x*, then for any candidate i who has non-zero marginal selection probability p ∗ i , we have that p ∗ i = si − x < sˆi − y = pi. By summing up for all candidates we obtain that k =Pn i=1 p ∗ i <Pn i=1 pi = k, which is not feasible. Similarly, suppose that *y > x* + ε, then for any candidate i whose marginal selection probability piis not 0, pi = ˆsi − *y < s*i − x = p ∗ i . As a result, we get that Pn i=1 p ∗ i >Pn i=1 pi, which is false. Thus, we see that x ≤ y ≤ x + ε. 3. If Pn i=1 si ≤ k and Pn i=1 sˆi ≥ k, then Algorithm 1 sets p ∗ i = min{1, si + x} and pi = max{0, sˆi − y}, for some non-negative x and y. Suppose that x + *y > ε*, then for any candidate i who has non-zero marginal selection probability pi, we have that pi = ˆsi − *y < s*i + x and pi < 1; therefore pi < p∗ i . By summing up the selection probabilities of all the candidates we obtain that k =Pn i=1 P pi < n i=1 p ∗ i = k, which is not feasible. Similarly, suppose that x + y < 0, then for any candidate i whose marginal selection probability p ∗ i is not 1, p ∗ i = si + x < sˆi − y = p ∗ i P . As a result, we get that n i=1 p ∗ i <Pn i=1 pi, which is false. Therefore, we know that 0 ≤ x + y ≤ ε. In all three cases we see that for any candidate i the selection probabilities of the two solutions satisfy |pi − p ∗ i | ≤ ε. Now, consider any coordinate i for which p ∗ i ≥ √ε. Since pi ≥ p ∗ i − ε, we have that pi ≥ (1 − √ε)p ∗ i and, thus, pisi ≥ (1 − √ε)p ∗ i si. Let E be the set of all individuals who have p ∗ i < √ε. 1. If Pn i=1 si ≤ k, then p ∗ i = min{1, si + x}. Thus, 0 ≤ si + x < √ε because both si and x are non-negative. Since both pi and p ∗ i sum up to k, we obtain that −kx ≤Pi∈E pisi ≤ k √ε − kx and −kx ≤Pi∈E p ∗ i si ≤ k √ε − kx. Therefore, Pi∈E pisi ≥Pi∈E p ∗ i si − k √ε. 2. If Pn i=1 si ≥ k and Pn i=1 sˆi ≥ k, then p ∗ i = max{0, si−x} and pi = max{0, sˆi−y}. Thus, si−x < √ε. Furthermore, both solutions assign zero probability to candidates with si − x < −ε. As a result, all individuals in E whose si − x > −ε, have si within an interval of length √ε + ε. Similarly to case 1, we have that Pi∈E pisi ≥Pi∈E p ∗ i si − k( √ε + ε). If we split the linear utility to the utility of individuals in E and not in E, we see that $$\sum_{i=1}^{n}p_{i}s_{i}=\sum_{i\notin E}p_{i}s_{i}+\sum_{i\in E}p_{i}s_{i}\geq(1-\sqrt{\varepsilon})\sum_{i\notin E}p_{i}^{*}s_{i}+\sum_{i\in E}p_{i}^{*}s_{i}-k(\varepsilon+\sqrt{\varepsilon})\geq\sum_{i=1}^{n}p_{i}^{*}s_{i}-k(\varepsilon+2\sqrt{\varepsilon})$$ $\square$ ## B.4 Proof Of Theorem 3.2 Theorem 3.2. For any classifier C that assigns scores s1*, . . . , s*n to n candidates, Algorithm 2 solves the online ε-approximate fairness-preserving cohort selection problem for any ε ∈ (0, 1] by selecting a cohort of size k with marginal probabilities p1*, . . . , p*n, achieves linear utility Pn i=1 pisi ≥Pn i=1 p ∗ i si − k(ε + 2√ε) (where p ∗ 1 , . . . , p∗n is the optimal solution for the offline fairness-preserving problem for input s1*, . . . , s*n), and keeps at most O(k + 1 ε ) candidates pending. Proof. We want to prove that Algorithm 2 and the algorithm described in Lemma 3.1 compute the same solution. In other words, we show that the probability pi that individual i is selected by Algorithm 2 is equal to the probability qi that i is selected by Algorithm 1 applied to the modified individual scores sˆ1*, . . . ,* sˆn, where sˆi = gε if si ∈ ((g − 1)*ε, gε*]. The first step is to prove that the scores s˜1, s˜2*, . . . ,* s˜n which are the input of the final rounding in line 28 satisfy the following properties: $$1.\ \sum_{i=1}^{n}\tilde{s}_{i}=k$$ $$2.\ \operatorname{\mathbb{E}}[{\tilde{s}}_{i}]=q_{i},\,\forall i\in[n].$$ We saw in the proof of Theorem 3.1 that for the offline algorithm all candidates of the same group have the same selection probability qi. We will show that for any person i we have qi = s g, where s gis the final calculated probability of any member of group g to which i belongs. The s g we are referring to is calculated by the final execution of lines 6-22. These lines of Algorithm 2 describe the same procedure as lines 2-15 of Algorithm 1, but from the point of view of groups instead of individual candidates. We consider three cases that depend on the value of the sum of scores from C. Case 1:Pn i=1 sˆi = k. The offline algorithm considers the scores as selection probabilities and, thus, assigns probability qi = ˆsi = gε to candidate i of group g. Similarly, Algorithm 2 assigns probability s g = gε to group g and in line 27 sets s˜i = nis g = nigε = niqi for the people who have not been rejected. Case 2:Pn i=1 sˆi < k. The process that calculates s gstarts by setting s g = gε + c. The offline algorithm initializes the probability of i who is a member of g as qi = ˆsi +c = gε+c. If for all groups g, gε+c ≤ 1, then the adjustment stops for both algorithms and we have that for any group g, any member i of g has qi = s g. If there exists g such that qi > 1, then the corresponding s gexceeds 1 by the same amount. Additionally, at this point the probabilities of all people in the same group as i will exceed 1 by this amount. Therefore, the n<1 of the two algorithms is the same. The offline algorithm runs the loop for all members of all groups that have individuals with qi > 1. The online version aggregates the excess mass from all n g members of group g and redistributes it all at once instead of running separate iterations for every member of the group as the offline does. No extra mass is added after the initialization but it is only moved from group to group. Hence, we obtain that at the end of this process qi = s g. Case 3:Pn i=1 sˆi > k. Similar to case 2, if candidate i is a member of group g, then qi = s g. Those who were rejected have s˜i = 0 and ni = 0. As a result, we see that for any person i, s˜i = niqi. From this we can infer that $$\sum_{i=1}^{n}{\tilde{s}}_{i}=\sum_{i=1}^{n}n_{i}q_{i}=\sum_{g=0}^{m}\sum_{i\in g}n_{i}s^{g}=\sum_{g=0}^{m}n^{g}s^{g}=\sum_{g=0}^{m}\sum_{i\in g}q_{i}=k.$$ As new people are added to the groups, the group probabilities s g become smaller in order for the sum of probabilities n gs gto be equal to k. Therefore, the maximum number v of people that can be represented by a candidate in a given group either stays the same or increases after every iteration. By Lemma 2.2, we obtain that the rounding process maintains the expected value of the number of people each candidate represents equal to their initial value. Since every person begins by representing only themselves, we have that for the i-th candidate E[ni] = 1. Finally, we obtain E[ˆsi] = E[niqi] = E[ni]qi = qi, because the calculation of s gs is deterministic. The final rounding procedure makes the final decisions and outputs 0 if the candidate is rejected and 1 if the candidate is selected. Due to properties 1 and 2, the probability of candidate i being selected by the online algorithm is qi. Thus, Algorithm 2 and the offline algorithm with input scores rounded to multiples of ε have the same selection probabilities. By Lemma 3.1, Algorithm 2 preserves fairness ε-approximately and achieves linear utility Pn i=1 pisi ≥Pn i=1 p ∗ i si − k(ε + 2√ε), where p ∗ 1 , . . . , p∗n is the optimal solution for the offline fairness-preserving problem for input s1*, . . . , s*n. Because of the online probability adjustments, we have that for n ≥ k the sum of all the probabilities is equal to k at the end of each loop. Therefore, we have Pm g=0 ngs g = k. If s f > 0, each person can represent at most b 1 s g c candidates. By Lemma 2, the number of representatives per group is at most $$\left[{\frac{n^{g}}{\left\lfloor{\frac{1}{s^{g}}}\right\rfloor}}\right]\leq{\frac{n^{g}}{\left\lfloor{\frac{1}{s^{g}}}\right\rfloor}}+1\leq2n^{g}s^{g}+1,$$ since ng b 1 sg c ≤ 2ngs g. If we sum up the number of representatives for all groups we obtain $$\sum_{g=0}^{m}\left[{\frac{n^{g}}{\left\lfloor{\frac{1}{s^{g}}}\right\rfloor}}\right]\leq\sum_{g=0}^{m}(2n^{g}s^{g}+1)=2k+\left\lceil{\frac{1}{\varepsilon}}\right\rceil+1.$$ This completes the proof. ## B.5 Proof Of Corollary 3.2 Corollary 3.2. If C is individually fair, then Algorithm 2 is ε-individually fair. Proof. If the individual probabilities of selection by C are individually fair with respect to a metric D, we obtain that ∀*i, j* ∈ [n] $$|p_{i}-p_{j}|\leq|s_{i}-s_{j}|+\varepsilon\leq{\mathcal{D}}(i,j)+\varepsilon.$$ $$\square$$ ## C Proofs From Section 4 C.1 Proof Of Lemma 4.1 Lemma 4.1. If *sum < k*, Algorithm 3 increases each input score si to a final output pi = si + αi ≥ si such that all of the candidates j with pj < 1 receive the same cumulative adjustment value αj = v. Proof. First we observe that pi ≥ si, ∀i. At each step of the algorithm the value of pi either increases, or is clipped at 1. Since si ∈ [0, 1], ∀i, we therefore know that pi ≥ si. Algorithm 3 initially adds a constant amount c to every candidate, then repeatedly redistributes overflow evenly across all candidates with si+αi < 1. We prove by induction that for all candidates i with pi < 1, their increment αi are the same. Consider two candidates *i, j* such that their final pi, pj < 1. As argued above, both pi, pj are smaller than 1 throughout the execution of the algorithm. At the beginning, αi = αj = c so the claim holds. Given that these candidates are equal at a certain step d, we also know they will remain equal at the next step d + 1. By assumption, neither candidate reaches 1 on either of these steps; therefore they will both receive an adjustment. When an adjustment is made, all candidates are affected equally. ## C.2 Proof Of Theorem 4.1 Theorem 4.1. For any classifier C that assigns scores s1*, . . . , s*n to n candidates, Algorithm 3 solves the fairness-preserving cohort selection problem by selecting k candidates with marginal probabilities p1*, . . . , p*n that achieve the optimal value of ratio utility mini pi si . Proof. We first show that Algorithm 3 either preserves or decreases the difference between any pair of individuals. Let pi denote the probability that candidate i is selected by Algorithm 3. Thus we must show, for all i, j, |pi − pj *| ≤ |*si − sj |. We apply Algorithm 3 to a set of candidates and obtain two disjoint sets of output candidates: let T(=1) be the set of candidates whose output pi = 1, and let T(<1) be the set of candidates whose output pi < 1. Let Tall be the union of these two disjoint sets. The algorithm behaves differently depending on the value of Pi si. 1. First, consider when Pi si < k. Let αi be the cumulative adjustment received by candidate i during the algorithm. The adjustments are exactly chosen such that Pi (si + αi) = k. Then we apply round-pr, where we know by Lemma 2.2 that the probability of being selected is preserved during rounding Pr[round-pr selects i] = pi = si + αi We thus need to cover three cases: (a) First, we consider two elements si, sj ∈ T(=1), |pi − pj | = |1 − 1*| ≤ |*si − sj |. (b) Next, we have si, sj ∈ T(<1) By Lemma 4.1, these candidates all receive the same adjustment. Let this adjustment be called b, |pi − pj | = |si + b − (sj + b)| = |si − sj |. (c) Finally we have si ∈ T(=1), sj ∈ T(<1). Note that αi ≤ αj , and si > sj . We see that |pi − pj | = |si + αi − (sj + αj )| = |si − sj + αi − αj *| ≤ |*si − sj |. 2. Next, consider Pi si ≥ k. Here we know P k i si ≤ 1. By Lemma 2.2, pi = P k l sl si. Then, for candidates i and j, we have: $$|p_{i}-p_{j}|=\left|{\frac{k}{\sum_{l}s_{l}}}s_{i}-{\frac{k}{\sum_{l}s_{l}}}s_{j}\right|=\left|{\frac{k}{\sum_{l}s_{l}}}(s_{i}-s_{j})\right|\leq|s_{i}-s_{j}|$$ Thus we see that |si − sj *| ≥ |*pi − pj |. We next show that among fairness-preserving solutions to the cohort selection problem, Algorithm 3 achieves the maximum value of mini pi si . Let T(<1) and T(=1) be defined as above, and note that T(=1) may be empty. Consider for contradiction an arbitrary algorithm A0 with probabilities of selection p 0 i which also preserves fairness while achieving better utility: mini p 0 i si > mini pi si . 1. First, consider the case where Pi si < k and T(=1) is nonempty. Let individual j have the most extreme ratio: pj sj = mini pi si . Consider how to make this ratio minimal. For all individuals in T(<1), increasing si will reduce this ratio: pi si = si+b si= 1 + b si . If any individuals j are in T(=1), they will have received some adjustment αj ≤ b, and thus they will have an even smaller ratio. Therefore, we know that individual j must have sj ≥ si, ∀i and be a member of T(=1), and we have that for Algorithm A, mini pi si = pj sj = 1 sj . ``` By our definition of A0, there is some potentially different most extreme element l providing better utility: p 0 l sl = mini p 0 i si > pj sj . ``` (a) If sl = sj , the largest minimum ratio p 0 l sl that A0can achieve is 1 sl = 1 sj , which is the same ratio as Algorithm A and contradicts our assumption. (b) If sl 6= sj , we know sl < sj , since we already know that sj is at least as big as all other elements. Since pj is 1, we know that pj sj ≥ p 0 j sj > p 0 l sl . This contradicts our assumption that A0 has greater utility than A. 2. Next, consider the case where Pi si < k and T(=1) group is empty. Again, let element j be the most extreme element for algorithm A, i.e. mini pi si = pj sj . Consider A0 on its most extreme element l constructed as in Item 1. (a) This time, if sl = sj , we may have p 0 l > pl, achieving greater utility. To preserve the distances, if A0 adjusts element l by a certain amount, it must adjust all smaller elements by at least the same amount. However, we know that Pi pi = k, so this required extra adjustment will mean that Pi p 0 i > k, and A0 will not be selecting exactly k candidates. (b) If sl < sj , then person j has the largest score, and similar to (2a), if p 0 P j > pj we see that i p 0 i > k. If p 0 j ≤ pj we have the contradiction in (1b). 3. Finally, consider the case where Pi si ≥ k. In Algorithm 3, all elements will be multiplied by a factor of P k i si , and then by Lemma 2.2, any element will satisfy pi = P k l sl si, so we have mini pi/si = mini P k l sl si /si = P k i si Notice that in this case, all elements are adjusted by the same constant ratio. Using extreme element l for algorithm A0 as constructed previously, and again supposing that this element is more extreme than any element in algorithm A, we derive that p 0 l > slP k i si . Since element l was the minimum ratio for algorithm A0, it follows that for all i, p 0 i > si P k i si . Taking the sum on both sides we see Pi p 0 i >Pi si P k i si = k. As before, the number of elements chosen by algorithm A0 will be more than k, which is a contradiction. Thus we conclude that A0cannot exist. ## C.3 Proof Of Corollary 4.1 Corollary 4.1. If C is individually fair, then Algorithm 3 is individually fair. Proof. The proof is analogous to that of Corollary 3.1. ## C.4 Proof Of Theorem 4.2 Theorem 4.2. For any classifier C that assigns scores s1*, . . . , s*n to n candidates, Algorithm 4 solves the fairness-preserving cohort selection problem by selecting k candidates with marginal probabilities p1*, . . . , p*n that achieve the optimal value of ratio utility. The algorithm leaves no more than O(k) candidates pending at any time. Proof. We first show that, for a list of candidate scores s1*, . . . , s*n, the selection probability given by the offline Algorithm 3 for any candidate i is the same as that given by Algorithm 4, and therefore provides an optimal utility solution to the problem. Let Algorithm 4 be denoted A and let A have probability pi of selecting candidate i. Let Algorithm 3 be denoted B with probability qi selecting candidate i. A never accepts candidates until the end of the stream, thus there are two major cases. 1. The stream ends with sum ≥ k, and A selects all candidates in pending. A candidate i is added to pending in one of three ways: (a) Candidate i was in top when the sum reached k. At each round after the sum exceeded k, they must survive round-pr, which by Lemma 2.2 always preserves their marginal probability. Therefore we only need to consider the effect of the incremental scaling adjustments. First, let scalet, sumt, and incrt, represent the values of these variables at some step t when the sum first exceeds k. We initialized scalet ← k sumt . Consider the value of scalet+1: $\text{scale}_{t+1}=\text{incr}_{t}\cdot\text{scale}_{t}=\dfrac{\text{sum}_{t+1}-s_{t+1}}{\text{sum}_{t+1}}\cdot\text{scale}_{t}=\dfrac{\text{sum}_{t}}{\text{sum}_{t+1}}\cdot\dfrac{k}{\text{sum}_{t}}=\dfrac{k}{\text{sum}_{t+1}}$. Thus, we can see by induction that for all time steps t, scalet =k sumt . Furthermore, we can express the final value of a single element si, which by definition is at position i in the stream, as: $$p_{i}=s_{i}\cdot\operatorname{scale}_{i}\cdot\prod_{t=i+1}^{n}\operatorname{incr}_{t}=s_{i}\cdot{\frac{k}{\operatorname{sum}_{i}}}\cdot\prod_{t=i+1}^{n}{\frac{\operatorname{sum}_{t}-s_{t}}{\operatorname{sum}_{t}}}$$ $$=s_{i}\cdot{\frac{k}{\operatorname{sum}_{i}}}\cdot\prod_{t=i+1}^{n}{\frac{\operatorname{sum}_{t-1}}{\operatorname{sum}_{t}}}=s_{i}\cdot{\frac{k}{\operatorname{sum}_{n}}}$$ Thus we see that the final piis adjusted exactly the same way as it would be in the offline case. (b) Candidate i was already in rest or arrived at the moment when the sum reached k. For each iteration, they must survive round-pr, which respects their marginal by Lemma 2.2. From that point forward, they are part of pending and treated the same as in 1a. (c) Candidate i was encountered when sum ≥ k. In this case, they are treated the same as in part 1a above. In either case, when A ends, a subset of candidates are selected from pending using round-pr, which again preserves their marginal probability. Thus pi = qiin these cases. 2. The stream ends with sum < k. A has three sets at this point: top (the greatest dk/αe elements of the stream), rest (at most dk/αe elements rounded to 1 − α) and rand (a randomly selected group of k candidates, disjoint from top and rest). No acceptances are made until the stream ends. The top candidates are placed into top, and elements are added to rest via round-pr, which preserves original marginal probabilities exactly by Lemma 2.2. The only change in probabilities then comes from the additive adjustments made when the stream ends. The main difference between the additive adjustments here and the waterfilling behavior in B is how we treat the people in rand. For the purpose of proof, consider a conceptual algorithm A0that behaves exactly the same as A, except instead of rand it has zeros, a list of all candidates outside of top and rest. When this conceptual algorithm ends, all the mass from water-filling in zeros will be collected into a set of k random candidates, which becomes the equivalent of the list rand in A. In more detail, at the end of A0, each member of top, rest, and zeros is given k−sum n, and any overflow is redistributed using water-filling. Any candidate i now has the same probability of selection by both A0 and B: si + αi. A0then performs a final round-pr step to select the outputs. Thus, in A0, top, rest, and zeros are given the same treatment they would receive in B. Before the final step of selecting candidates by round-pr, A0collects all of the mass accumulated in zeros from water-filling into a random subset of k members from zeros. Thus the only difference between A and A0is that, A0 first kept everyone and later uniformly sampled a subset of k people, whereas A immediately keeps a random subset of k. This subsampling step does not change the marginal probabilities of any element in zeros; their probability before and after collecting the mass of zeros At the end, A selects candidates using round-pr on the entire set top ∪ rest ∪ rand, which does not affect the adjusted marginals si + αi. Thus pi = si + αi = qi∀i. Next, we show that the algorithm keeps at most O(k) candidates pending. Any candidate not in one of: top, rest, rand, pending is considered rejected. The sizes of top and rand are explicitly bounded by dk/αe. rest is not bounded in size explicitly, but note that the set is maintained by constantly applying round-pr({pi}i∈rest, 1 − α). After rounding, at most 1 person in rest has a value < (1 − α). If we ever have more than dk/(1 − α)e elements, we have sum ≥ dk/(1 − α)e(1 − α) > k. This goes to the sum ≥ k case, which no longer adds elements to rest, thus it is bounded in length by dk/(1−α)e. pending is created initially by adding top and rest (dk/(1 − α)e + dk/αe pending), but for subsequent steps is never longer than k by Lemma 2.2. Thus the worst we can do is remain under a sum of k for the entire stream. top, rest, and rand will all be kept pending until the end of the stream, but still we have at most dk/αe + dk/(1 − α)e + dk/αe = O(k) candidates pending. ## C.5 Proof Of Corollary 4.2 Corollary 4.2. If C is individually fair, then Algorithm 4 is individually fair. Proof. The proof is analogous to that of Corollary 4.1.
Review 1: Summary: The paper studies the problem of cohort selection, i.e. selecting $k$ candidates out of $n$, which achieves both fairness and utility. This problem is studied in the offline and online full-information setting, and with linear and ratio utilities. Specifically, the approach considered is to compose predictions of a single classifier to select the cohort. The paper proposes two polynomial-time algorithms for offline settings and two utility functions, and their corresponding online versions. The interesting part of the algorithms are that they are individually fair if the classifier is individually fair. For the online algorithms, the interesting idea is to keep a queue of $O(k)$ candidates pending at any time for future comparison and fair selection. Strengths and Weaknesses: # Strengths 1. The paper addresses a timely problem of individually fair and utility maximising cohort selection while scores over the candidates are yielded from an individually fair classifier. 2. The authors uses ratio utility (a proxy of worst-case utility function) to show a case where the proposed method of Dwork & Ilvento (2019) fails to be utility maximising and the proposed approach triumphs. 3. The idea of using dynamic programming followed by dependent rounding constructs a clear and simple basis for the proposed algorithms. 4. The interesting algorithmic idea of this paper is to maintain a queue of pending applicants so that they can be considered in future while not growing the queue above $O(k)$. # Weaknesses 1. The paper invents ratio utility as a proxy of the worst-case utility function and use it further to show benefits of the proposed method. I am not sure where it really matters in practice. Specifically, i. it is not clear how does it correspond to the fair-utility maximising cohort selection problem under general individualistic utility, i.e. $\max \sum_i p_i u_i(s_1, ..s_n)$ with the constraints similar to the LP program in page 3. ii. it is also not clear how does it correspond to the fair-utility maximising cohort selection under any collective utility, , i.e. $\max \sum_i p_i u_i(\mathrm{cohort}_k, s_1, ..s_n)$ as in Equation (2) in [1]. In brief, when the utility of an individual in the cohort depends on the other selected candidates. A clear understanding of these relations, theoretically and/or numerically, would provide us a motivation to study the ratio utility. Right now, it is not clear. 2. Though the paper studies such a practical problem with existing literature in meritocratic fair selection/ranking, it is surprising that there is no numerical comparison or illustration of the goodness of this method. Without that, it is hard to accept that the proposed methods are effective in practice for general utility functions, as claimed. 3. The paper should at least numerically compare with the meritocratic fair selection and fair ranking algorithms. The justification that meritocratic fairness papers need scores to be reflective of 'true merit' is not agreeable. We can replace the $x_{ij}$ in [1] with scores and still the algorithm in [1] works. [2] shows that meritocratic fair selection can be generalised to include any utility function and any score representing a proxy of 'merit' to conduct fair and utility-maximising cohort selection. Also the argument against not comparing to [3] is weak if a numerical experimentation is conducted. This is the biggest missing link to judge the effectiveness of this work. 4. In reality, no classifier is completely individually fair. They are rather $\epsilon$-individually fair. What happens to the fairness of the proposed algorithms then? [1] Michael Kearns, Aaron Roth, and Zhiwei Steven Wu. Meritocratic fairness for cross-population selection. In International Conference on Machine Learning - Volume 70, pp. 1828–1836. 2017. [2] Thomas Kleine Buening, Meirav Segal, Debabrota Basu, Anne-Marie George, and Christos Dimitrakakis. "On Meritocracy in Optimal Set Selection." In Equity and Access in Algorithms, Mechanisms, and Optimization, pp. 1-14. 2022. [3] Amanda Bower, Hamid Eftekhari, Mikhail Yurochkin, and Yuekai Sun. Individually fair rankings. In International Conference on Learning Representations. 2021. Requested Changes: 1. Can you add a justification against choosing the ratio utility? Where it will be useful in practice (by showing some theoretical or numerical results), or is it just a theoretical tool to prove the worst-case performance for any utility? 2. Can you show experimental results on some (real-world or real-like) selection dataset, where the proposed online or offline algorithms demonstrate benefit over existing algorithms for fair cohort selection? Specifically, given practicality of the problem under investigation and known experimental results in the literature, can you compare against existing individually meritocratic cohort selection techniques like [1] or collective meritocratic cohort selection techniques like [2]? 3. Can you please add results on the fairness of the proposed algorithms when the underlying classifier is only $\epsilon$-individually fair? [1] Michael Kearns, Aaron Roth, and Zhiwei Steven Wu. Meritocratic fairness for cross-population selection. In International Conference on Machine Learning - Volume 70, pp. 1828–1836. 2017. [2] Thomas Kleine Buening, Meirav Segal, Debabrota Basu, Anne-Marie George, and Christos Dimitrakakis. "On Meritocracy in Optimal Set Selection." In Equity and Access in Algorithms, Mechanisms, and Optimization, pp. 1-14. 2022. Broader Impact Concerns: The proposed algorithms, specially the ones in the online setting, can be interesting to ensure fairness in online selection platforms. But without a numerical demonstration or a practical case study, it is hard to conclude about their applicability. ================================================== Review 2: Summary: The paper starts by motivating the problem of composition in algorithmic fairness. It is known that composition of fair decisions may not lead to a fair composed algorithm, and this has been addressed in the context of dependent composition and cohort selection. The authors provide offline and online algorithms for cohort selection under two different utility setups. Strengths and Weaknesses: Strengths: - This type of issue of fairness with composition is vastly understudied and I think it is nice that the authors are tackling some of the problems arising there. These types of settings where the decision we make on each individual also depends on the decision on other individuals are seldom studied (the usual framework looks at classifying/scoring people independently with no capacity constraint) -There is something interesting about how the authors’ algorithms deal with the impossibility to obtain fairness in a fully online setting, by delaying decisions on a fraction of people and trading-off fairness vs how many people the algorithm has to put on “hold”. - It is nice that the paper looks at several types of utilities, and in particular about not having full information about the utility of a candidate/agent. - The algorithms work with a relatively small number of candidates pending for both ratio and linear utilities (of the order of k, the number of people selected in the cohort. In a hiring process, I would imagine that k is very small compared to the number of candidates, so this represent a small fraction of the population) Weaknesses: - Can Algorithm 1 be implemented through a linear program? If so, can the authors discuss a bit more how Algorithm 1 helps over solving the LP directly? Is it because it provides a basis for the online algorithm? It might be nice to highlight this. - My main concerns however are with respect to the ratio utility: i) The ratio utility is a bit weird. I understand why we care about $\sum_i p_i u_i$ where $u_i$ is unknown, I am not sure what the renormalization factor in the ratio represents, however. It would be nice for this to have more discussion. I understand $\sum_i s_i u_i$ as the utility we get if we use the scores directly as probability of selection, but why is that the right benchmark? ii) Related to the above, the results for ratio utilities, starting from Lemma 2.1., seem to heavily rely on optimizing this specific ratio expression. This would not appear if for example we wanted to optimize just $\sum_i p_i u_i$. It’s also very worst case in a weird way; basically the worst case can only happen if the utility is 1 for a single agent and 0 for all others, which seems unrealistic. In fact, if the scores themselves were obtained through a reasonable process (not just fair, but also with some level of accuracy), there should be some correlation between $s_i$ and $u_i$ that would prevent such cases. It would be nice to develop this a bit more. Overall, I think the main idea is interesting and the algorithms are nice, but I think the paper may need a bit more framing/justifying its assumptions before it is published. I think adding more justification and discussion of the ratio utility would be sufficient, in my opinion, to have this at TMLR! Requested Changes: See weaknesses Broader Impact Concerns: No concern here. ================================================== Review 3: Summary: The work considers the fair cohort selection problem, that is, selecting a set of $k$ individuals while satisfying individual fairness. The main contributions are * A relaxation of the online cohort selection problem (when candidates arrive in an online fashion) that allows putting candidates 'on hold', rather than requiring an immediate response. * High utility methods for selecting cohorts (online or offline) for two notions of utility. Linear (which matches the case where there exists a fair classifier with probability of selection closely correlated to the utility of each individual) and Ratio Utility (which aims to capture arbitrary utilities assigned to individuals). Strengths and Weaknesses: **Strengths** 1. The paper considers an important setting for fair classification and improves significantly on prior work. 2. The relaxation of online cohort selection to place candidates 'on hold' is an elegant path around the impossibility results. One suggestion for future work could be to consider whether there are methods that reduce the time on hold or ensure that similar candidates spend similar time on hold if additional opportunities to revisit candidates are intermixed, rather than held to the end of the stream. **Weaknesses** 1. Although the relaxation for online cohort selection is nice, the reader is left wondering whether its complementary version (outputting acceptances throughout the stream and only rejecting at the end) would also work and whether this would be more realistic for some settings. For example, in hiring, the firm may want to make offers to candidates quickly to avoid the candidate accepting an offer from a different firm. Furthermore, it would be helpful to characterize whether similar candidates are left 'on hold' for similar amounts of time in the constructions presented (it seems that this might not hold for adversarial ordering). 2. The algorithms are difficult to parse and would be greatly improved with inline comments/pseudocode. For example, several constants are left without type, which can be inferred but interrupts the flow of reading. There are also places where it is unclear whether and how values are updated, for example, the $n_i$ seem to be updated as a result of the roundnat procedure, but this isn't clear from the notation. There are also several mismatches with the terminology in the text, for example, does "delete all $i$ ..." in line 26 of Algorithm 2 mean "reject"? Requested Changes: **Requested Changes prior to recommendation** * Clarify whether instances of "for any" in algorithms should be "for all". * Clarify in the introduction that the relaxation for the offline setting does not necessarily immediately reject candidates. * Clarify in the introduction whether the $u_i$ are assigned independently to each $i$ or if they can be a function of the whole cohort. (Presumably it is independent.) **Recommended Changes to Strengthen the Work** * Consider devoting more space/words to the new setting proposed for online cohort selection. * Consider revising the algorithm notation and including inline comments to make them more readable and to match the prose descriptions provided. * Consider restating lemmas/theorems in the appendix alongside the proofs, this will make them easier to follow. Broader Impact Concerns: None - the work considers the problem of fair classification/cohort selection in the abstract. ================================================== Metareview: Recommendation: Accept with minor revision Comment: The three reviewers have positive views on the manuscript. There are however several suggestions to improve the manuscript before it is published, particularly: 1) Strengthening discussion and explanation about ratio utility, and its relationship to the fair-utility maximising cohort selection problem under general individualistic utility and under any collective utility; 2) Positioning better the work with respect to existing literature in meritocratic fair selection/ranking. Explicitly mentioning that a meritocratic notion of fairness tries to preserve the order of the scores, whereas this work studies a stronger fairness criterion that preserves the distances between the scores. Cross-referencing with Buening et al. 2022 would be beneficial for the readers. The matters mentioned above were addressed in the rebuttal; however, the manuscript has not been revised accordingly. A conclusion and discussion section would be appropriate to discuss those points. Additionally, there are several suggested modifications from the reviewers that need to be integrated. ==================================================
# Test-Time Adaptation For Visual Document Understanding Sayna Ebrahimi saynae@google.com Google Cloud AI Research Sercan Ö. Arik soarik@google.com Google Cloud AI Research Tomas Pfister *tpfister@google.com* Google Cloud AI Research Reviewed on OpenReview: *https: // openreview. net/ forum? id= zshemTAa6U* ## Abstract For visual document understanding (VDU), self-supervised pretraining has been shown to successfully generate transferable representations, yet, effective adaptation of such representations to distribution shifts at test-time remains to be an unexplored area. We propose DocTTA, a novel test-time adaptation method for documents, that does source-free domain adaptation using unlabeled target document data. DocTTA leverages cross-modality self-supervised learning via masked visual language modeling, as well as pseudo labeling to adapt models learned on a *source* domain to an unlabeled *target* domain at test time. We introduce new benchmarks using existing public datasets for various VDU tasks, including entity recognition, key-value extraction, and document visual question answering. DocTTA shows significant improvements on these compared to the source model performance, up to 1.89% in (F1 score), 3.43% (F1 score), and 17.68% (ANLS score), respectively. Our benchmark datasets are available at https://saynaebrahimi.github.io/DocTTA.html. ## 1 Introduction Visual document understanding (VDU) is on extracting structured information from document pages represented in various visual formats. It has a wide range of applications, including tax/invoice/mortgage/claims processing, identity/risk/vaccine verification, medical records understanding, compliance management, etc. These applications affect operations of businesses from major industries and daily lives of the general populace. Overall, it is estimated that there are trillions of documents in the world. Machine learning solutions for VDU should rely on overall comprehension of the document content, extracting the information from text, image, and layout modalities. Most VDU tasks including key-value extraction, form understanding, document visual question answering (VQA) are often tackled by self-supervised pretraining, followed by supervised fine-tuning using human-labeled data (Appalaraju et al., 2021; Gu et al., 2021; Xu et al., 2020b;a; Lee et al., 2022; Huang et al., 2022). This paradigm uses unlabeled data in a task-agnostic way during the pretraining stage and aims to achieve better generalization at various downstream tasks. However, once the pretrained model is fine-tuned with labeled data on *source* domain, a significant performance drop might occur if these models are directly applied to a new unseen *target* domain - a phenomenon known as *domain shift* (Quiñonero-Candela et al., 2008a;b; Moreno-Torres et al., 2012). The domain shift problem is commonly encountered in real-world VDU scenarios where the training and testtime distributions are different, a common situation due to the tremendous diversity observed for document data. Fig. 1 exemplifies this, for key-value extraction task across visually different document templates and for visual question answering task on documents with different contents (figures, tables, letters etc.) for information. The performance difference due to this domain shift might reduce the stability and reliability of VDU models. This is highly undesirable for widespread adoption of VDU, especially given that the common ![1_image_0.png](1_image_0.png) Figure 1: Distribution shift examples for document samples from the proposed benchmark, DocVQA-TTA. Top row: shows documents from four domains: (i) Emails & Letters, (ii) Figures & Diagrams, (iii) Layout, (iv) Tables & Lists, from our VQA benchmark derived from DocVQA dataset (Mathew et al., 2021). Bottom left: documents from source and target domains for key-value information extraction task from SROIE (Huang et al., 2019) receipt dataset. **Bottom right:** documents from source and target domains for named entity recognition task from FUNSD (Jaume et al., 2019) dataset. use cases are from high-stakes applications from finance, insurance, healthcare, or legal. Thus, the methods to robustly guarantee high accuracy in the presence of distribution shifts would be of significant impact. Despite being a critical issue, to the best of our knowledge, no prior work has studied post-training domain adaptation for VDU. Unsupervised domain adaptation (UDA) methods attempt to mitigate the adverse effect of data shifts, often by training a joint model on the labeled source and unlabeled target domains that map both domains into a common feature space. However, simultaneous access to data from source and target domains may not be feasible for VDU due to the concerns associated with source data access, that might arise from legal, technical, and contractual privacy constraints. In addition, the training and serving may be done in different computational environments, and thus, the expensive computational resources used for training may not be available at serving time. Test-time adaptation (TTA) (or source-free domain adaptation) has been introduced to adapt a model that is trained on the source to unseen target data, without using any source data (Liang et al., 2020; Wang et al., 2021b; Sun et al., 2020; Wang et al., 2021a; Chen et al., 2022; Huang et al., 2021). TTA methods thus far have mainly focused on image classification and semantic segmentation tasks, while VDU remains unexplored, despite the clear motivations of the distribution shift besides challenges for the employment of standard UDA. Since VDU significantly differs from other computer vision (CV) tasks, applying existing TTA methods in a straightforward manner is suboptimal. First, for VDU, information is extracted from multiple modalities (including image, text, and layout) unlike other CV tasks. Therefore, a TTA approach proposed for VDU should leverage cross-modal information for better adaptation. Second, multiple outputs (e.g. entities or questions) are obtained from the same document, creating the scenario that their similarity in some aspects (e.g. in format or context) can be used. However, this may not be utilized in a beneficial way with direct application of popular pseudo labeling or self training-based TTA approaches (Lee et al., 2013), which have gained a lot of attention in CV (Liang et al., 2020; 2021; Chen et al., 2022; Wang et al., 2021a). Pseudo labeling uses predictions on unlabeled target data for training. However, naive pseudo labeling can result in accumulation of errors (Guo et al., 2017; Wei et al., 2022; Meinke & Hein, 2020; Thulasidasan et al., 2019; Kristiadi et al., 2020). Particularly in VDU, it happens due to generation of multiple outputs at the same time that are possibly wrong in the beginning, as each sample can contain a long sequence of words. Third, commonly-used self-supervised contrastive-based TTA methods for CV (He et al., 2020; Chen et al., 2020b;a; Tian et al., 2020) (that are known to improve generalization) employ a rich set of image augmentation techniques, while proposing data augmentation is much more challenging for general VDU. In this paper, we propose DocTTA, a novel TTA method for VDU that utilizes self-supervised learning on text and layout modalities using masked visual language modeling (MVLM) while jointly optimizing with pseudo labeling. We introduce an uncertainty-aware per-batch pseudo labeling selection mechanism, which makes more accurate predictions compared to the commonly-used pseudo labeling techniques in CV that use no pseudo-labeling selection mechanism (Liang et al., 2020) in TTA or select pseudo labels based on both uncertainty and confidence (Rizve et al., 2021) in semi-supervised learning settings. To the best of our knowledge, this is the first method with a self-supervised objective function that combines visual and language representation learning as a key differentiating factor compared to TTA methods proposed for image or text data. While our main focus is the TTA setting, we also showcase a special form of DocTTA where access to source data is granted at test time, extending our approach to be applicable for unsupervised domain adaptation, named DocUDA. Moreover, in order to evaluate DocTTA diligently and facilitate future research in this direction, we introduce new benchmarks for various VDU tasks including key-value extraction, entity recognition, and document visual question answering (DocVQA) using publicly available datasets, by modifying them to mimic real-world adaptation scenarios. We show DocTTA significantly improves source model performance at test-time on all VDU tasks without any supervision. To our knowledge, our paper is first to demonstrate TTA and UDA for VDU, showing significant accuracy gain potential via adaptation. We expect our work to open new horizons for future research in VDU and real-world deployment in corresponding applications. ## 2 Related Work Unsupervised domain adaptation aims to improve the performance on a different target domain, for a model trained on the source domain. UDA approaches for closed-set adaptation (where classes fully overlap between the source and target domains) can be categorized into four categories: (i) distribution alignmentbased, (ii) reconstruction-based, and (iii) adversarial based, and (iv) pseudo-labeling based. Distribution alignment-based approaches feature aligning mechanisms, such as moment matching (Peng et al., 2019) or maximum mean discrepancy (Long et al., 2015; Tzeng et al., 2014). Reconstruction-based approaches reconstruct source and target data with a shared encoder while performing supervised classification on labeled data (Ghifary et al., 2016), or use cycle consistency to further improve domain-specific reconstruction (Murez et al., 2018; Hoffman et al., 2018). Inspired by GANs, adversarial learning based UDA approaches use twoplayer games to disentangle domain invariant and domain specific features (Ganin & Lempitsky, 2015; Long et al., 2018; Shu et al., 2018). Pseudo-labeling (or self-training) approaches jointly optimize a model on the labeled source and pseudo-labeled target domains for adaptation (Kumar et al., 2020; Liu et al., 2021; French et al., 2017). Overall, all UDA approaches need to access both labeled source data and unlabeled target data during the adaptation which is a special case for the more challenging setting of TTA and we show how our approach can be modified to be used for UDA. Test-time adaptation corresponds to source-free domain adaptation, that focuses on the more challenging setting where only source model and unlabeled target data are available. The methods often employ an unsupervised or self-supervised cost function. Nado et al. (2020) adopted the training time BN and used it at test time to adapt to test data efficiently. In standard practice, the batch normalization statistics are frozen to particular values after training time that are used to compute predictions. Nado et al. (2020) proposed to recalculate batch norm statistics on every batch at test time instead of re-using values from training time as a mechanism to adapt to unlabeled test data. While this is computationally inexpensive and widely adoptable to different settings, we empirically show that it cannot fully overcome performance degradation issue when there is a large distribution mismatch between source and target domains. TENT (Wang et al., 2021b) utilizes entropy minimization for test-time adaptation encouraging the model to become more "certain" on target predictions regardless of their correctness. In the beginning of the training when predictions tend to be inaccurate, entropy minimization can lead to error accumulation since VDU models create a long sequence of outputs per every document resulting in a noisy training. SHOT (Liang et al., 2020) combines mutual information maximization with offline clustering-based pseudo labeling. However, using simple offline pseudo-labeling can lead to noisy training and poor performance when the distribution shifts are large (Chen et al., 2022; Liu et al., 2021; Rizve et al., 2021; Mukherjee & Awadallah, 2020). We also use pseudo labeling in DocTTA but we propose online updates per batch for pseudo labels, as the model adapts to test data. Besides, we equip our method with a pseudo label rejection mechanism using uncertainty, to ensure the negative effects of predictions that are likely to be inaccurate. Most recent TTA approaches in image classification use contrastive learning combined with extra supervision (Xia et al., 2021; Huang et al., 2021; Wang et al., 2021a; Chen et al., 2022). In contrastive learning, the idea is to jointly maximize the similarity between representations of augmented views of the same image, while minimizing the similarity between representations of other samples). All these methods rely on self-supervised learning that utilize data augmentation techniques, popular in CV while not yet being as effective for VDU. While we advocate for using SSL during TTA, we propose to employ multimodal SSL with pseudo labeling for the first time which is imore effective for VDU. Self-supervised pretraining for VDU aims to learn generalizable representations on large scale unlabeled data to improve downstream VDU accuracy (Appalaraju et al., 2021; Gu et al., 2021; Xu et al., 2020b;a; Lee et al., 2022; Huang et al., 2022). LayoutLM (Xu et al., 2020b) jointly models interactions between text and layout information using a masked visual-language modeling objective and performs supervised multilabel document classification on IIT-CDIP dataset (Lewis et al., 2006). LayoutLMv2 (Xu et al., 2020a) extends it by training on image modality as well, and optimizing text-image alignment and text-image matching objective functions. DocFormer (Appalaraju et al., 2021) is another multi-modal transformer based architecture that uses text, vision and spatial features and combines them using multi-modal self-attention with a multi-modal masked language modeling (MM-MLM) objective (as a modified version of MLM in BERT (Devlin et al., 2018)), an image reconstruction loss, and a text describing image loss represented as a binary cross-entropy to predict if the cut-out text and image are paired. FormNet (Lee et al., 2022) is a structure-aware sequence model that combines a transformer with graph convolutions and proposes *rich* attention that uses spatial relationship between tokens. UniDoc (Gu et al., 2021) is another multi-modal transformer based pretraining method that uses masked sentence modeling, visual contrastive learning, and visual language alignment objectives which unlike other methods, does not have a fixed document object detector (Li et al., 2021; Xu et al., 2020a). In this work, we focus on a novel TTA approach for VDU, that can be integrated with any pre-training method. We demonstrate DocTTA using the publicly available LayoutLMv2 architecture pretrained on IIT-CDIP dataset. ## 3 Doctta: Test-Time Adaptation For Documents In this section, we introduce DocTTA, a test-time adaptation framework for VDU tasks including key-value extraction, entity recognition, and document visual question answering (VQA). ## 3.1 Doctta Framework We define a *domain* as a pair of distribution D on inputs X and a labeling function l : *X → Y*. We consider source and *target* domains. In the source domain, denoted as hDs, lsi, we assume to have a model denoted as fs and parameterized with θs to be trained on source data {x (i) s , y (i) s } ns i=1, where x (i) s ∈ Xs and y (i) s ∈ Ys are document inputs and corresponding labels, respectively and ns is the number of documents in the source domain. Given the trained source model fs and leaving Xs behind, the goal of TTA is to train ft on the target domain denoted as hDt, lti where ft is parameterized with θt and is initialized with θs and Dt is defined over {x (i) t } nt i=1 ∈ Xt without any ground truth label. Algorithm 1 overviews our proposed DocTTA procedure. Unlike single-modality inputs commonly used in computer vision, documents are images with rich textual information. To extract the text from the image, we consider optical character recognition (OCR) is performed and use its outputs, characters, and their corresponding bounding boxes (details are provided in Appendix). We construct our input X in either of the domains composed of three components: text input sequence XT of length n denoted as (x T 1 , · · · , xTn ) ∈ R (n×d), image XI ∈ R 3×W×H, and layout XB as a 6-dimensional ![4_image_0.png](4_image_0.png) Figure 2: Illustration of how our approach, DocTTA, leverages unlabeled target data at test time to i) learn how to predict masked language given visual cues, ii) generate pseudo labels to supervise the learning, and iii) maximize the diversity of predictions to generate sufficient amount labels from all classes. vector in the form of (xmin, xmax, ymin, ymax*, w, h*) representing a bounding box associated with each word in the text input sequence. Note that for the VQA task, text input sequence is also prepended with the question. For the entity recognition task, labels correspond to the set of classes that denote the extracted text; for the key-value extraction task, labels are values for predefined keys; and for the VQA task, labels are the starting and ending positions of the answer presented in the document for the given question. We consider the closed-set assumption: the source and target domains share the same class labels Ys = Yt = Y with |Y| = C being the total number of classes. ## Algorithm 1 Doctta For Closed-Set Tta In Vdu 1: **Input:** Source model weights θs, target documents {x i t} nt i=1, test-time training epochs ne, test-time training learning rate α, uncertainty threshold γ, questions for target documents in document VQA task 2: **Initialization:** Initialize target model fθt with θs weights. 3: for *epoch* = 1 to ne do 4: Perform masked visual-language modeling in Eq. 1 5: Generate pseudo labels and accept a subset using criteria in Eq. 2 and fine-tune with Eq. 3 6: Maximize diversity in pseudo label predictions Eq. 4 7: θt ← θt − α∇LDocTTA B Update θt via total loss in Eq. 5 8: **end for** ## 3.2 Doctta Objective Functions In order to adapt ft in DocTTA, we propose three objectives to optimize on the unlabeled target data: Objective I: masked visual language modeling (MVLM). Inspired by notable success of masked language modeling for NLP in architectures like BERT (Devlin et al., 2018), as well as the success of MVLM in (Xu et al., 2020a) to perform self-supervised pretraining for VDU, we propose to employ MVLM at test time to encourage the model to learn better the text representation of the test data given the 2D positions and other text tokens. The intuition behind using this objective for TTA is to enable the target model to learn the language modality of the new data given visual cues and thereby bridging the gap between the different modalities on the target domain. We randomly mask 15% of input text tokens among which 80% are replaced by a special token [MASK] and the remaining tokens are replaced by a random word from the entire vocabulary. The model is then trained to recover the masked tokens while the layout information remains fixed. To do so, the output representations of masked tokens from the encoder are fed into a classifier which outputs logits over the whole vocabulary, to minimize the negative log-likelihood of correctly recovering masked text tokens x T m given masked image tokens x I and masked layout x B: $${\mathcal{L}}_{M V L M}(\theta_{t})=-\mathbb{E}_{x_{t}\in{\mathcal{X}}_{t}}\sum_{m}\log p_{\theta_{t}}(x_{t_{m}}^{T}|x_{t}^{I},x_{t}^{B}).$$ $$\left(1\right)$$ Objective II: self training with pseudo labels. While optimizing MVLM loss during the adaptation, we also generate pseudo labels for the unlabeled target data in an online way and treat them as ground truth labels to perform supervised learning on the target domain. Unlike previous pseudo labeling-based approaches for TTA in image classification which update pseudo labels only after each epoch (Liang et al., 2020; 2021; Wang et al., 2021a), we generate pseudo labels per batch aiming to use the latest version of the model for predictions. We consider a full epoch to be one training loop where we iterate over the entire dataset batch by batch. In addition, unlike prior works, we do not use a clustering mechanism to generate pseudo labels as they will be computationally expensive for documents. Instead, we directly use predictions by the model. However, simply using all the predictions would lead to noisy pseudo labels. Inspired by (Rizve et al., 2021), in order to prevent noisy pseudo labels, we employ an uncertainty-aware selection mechanism to select the subset of pseudo labels with low uncertainty. Note that in (Rizve et al., 2021), pseudo labeling is used as a semi-supervised learning approach (not adaptation) and the selection criteria is based on both thresholding confidence and uncertainty where confidence is the Softmax probability and uncertainty is measured with MC-Dropout (Gal & Ghahramani, 2016). We empirically observe that raw confidence values (when taken as the posterior probability output from the model) are overconfident despite being right or wrong. Setting a threshold on pseudo labels' confidence only introduces a new hyperparameter without a performance gain (see Sec. 5.1). Instead, to select the predictions we propose to only use uncertainty, in the form of Shannon's entropy (Shannon, 2001). We also expect this selection mechanism leads to reducing miscalibration due to the direct relationship between the ECE1 and output prediction uncertainty, i.e. when more certain predictions are selected, ECE is expected to reduce for the selected subset of pseudo labels. Assume p (i) be the output probability vector of the target sample x (i) tsuch that p (i) c denotes the probability of class c being the correct class. We select a pseudo label y˜ (i) c for x (i) tif the uncertainty of the prediction u(p (i) c ), measured with Shannon's entropy, is below a specific threshold γ and we update θt weights with a cross-entropy loss: $$\tilde{y}_{c}^{i}=\mathbb{1}\left[u(p_{c}^{(i)})\leq\gamma\right],$$ $$\mathcal{L}_{CE}(\theta_{t})=-\mathbb{E}_{x_{t}\in\mathcal{X}_{t}}\sum\nolimits_{c=1}^{C}\tilde{y}_{c}\log\sigma(f_{t}(x_{t})),\tag{1}$$ where σ(·) is the softmax function. It should be noted that the tokens that are masked for the MVLM loss are not included in the cross-entropy loss as the attention mask for them is zero. Objective III: diversity objective. To prevent the model from indiscriminately being dominated by the most probable class based on pseudo labels, we encourage class diversification in predictions by minimizing 1Expected calibration error (Naeini et al., 2015) which is a metric to measure calibration of a model $$\left(2\right)$$ $$(3)$$ the following objective: $${\mathcal{L}}_{D I V}=\mathbb{E}_{x_{t}\in{\mathcal{X}}_{t}}\sum\nolimits_{c=1}^{C}{\bar{p}}_{c}\log{\bar{p}}_{c},$$ $$\left({4}\right)$$ $\left(5\right)$. p¯c log ¯pc, (4) where p¯ = Ext∈Xtσ(ft(xt)) is the output embedding of the target model averaged over target data. By combining Eqs. 1, 3, and 4, we obtain the full objective function in DocTTA as below: $${\mathcal{L}}_{\mathrm{DocTTA}}={\mathcal{L}}_{M V L M}+{\mathcal{L}}_{C E}+{\mathcal{L}}_{D I V}.$$ LDocTTA = LMV LM + LCE + LDIV . (5) ## 3.3 Doctta Vs. Docuda The proposed DocTTA framework can be extended as an UDA approach, which we refer to as DocUDA (see Appendix for the algorithm and details). DocUDA is based on enabling access to source data during adaptation to the target. In principle, the availability of this extra information of source data can provide an advantage over TTA, however, as we show in our experiments, their difference is small in most cases, and even TTA can be superior when source domain is significantly smaller than the target domain and the distribution gap is large, highlighting the efficacy of our DocTTA approach for adapting without relying on already-seen source data. We note that the UDA version comes with fundamental drawbacks. From the privacy perspective, there would be concerns associated with accessing or storing source data in deployment environments, especially given that VDU applications are often from privacy-sensitive domains like legal or finance. From the computational perspective, UDA would yield longer convergence time and higher memory requirements due to joint learning from source data. Especially given that the state-of-the-art VDU models are large in size, this may become a major consideration. ## 4 Doctta Benchmarks To better highlight the impact of distribution shifts and to study the methods that are robust against them, we introduce new benchmarks for VDU. Our benchmark datasets are constructed from existing popular and publicly-available VDU data to mimic real-world challenges. We have attached the training and test splits for all our benchmark datasets in the supplementary materials. ## 4.1 Funsd-Tta: Entity Recognition Adaptation Benchmark We consider FUNSD, Form Understanding in Noisy Scanned Documents, dataset (Jaume et al., 2019) for this benchmark which is a noisy form understanding collection consists of sparsely-filled forms, with sparsity varying across the use cases the forms are from. In addition, the scanned images are noisy with different degradation amounts due to the disparity in scanning processes, which can further exacerbate the sparsity issue as the limited information might be based on incorrect OCR outputs. As a representative distribution shift challenge on FUNSD, we split the source and target documents based on the sparsity of available information measure. The original dataset has 9707 semantic entities and 31,485 words with 4 categories of entities question, answer, header, and other, where each category (except other) is either the beginning or the intermediate word of a sentence. Therefore, in total, we have 7 classes. We first combine the original training and test splits and then manually divide them into two groups. We set aside 149 forms that are filled with more texts for the source domain and put 50 forms that are sparsely filled for the target domain. We randomly choose 10 out of 149 documents for validation, and the remaining 139 for training. Fig. 1 (bottom row on the right) shows examples from the source and target domains. ## 4.2 Sroie-Tta: Key-Value Extraction Adaptation Benchmark We use SROIE (Huang et al., 2019) dataset with 9 classes in total. Similar to FUNSD, we first combine the original training and test splits. Then, we manually divide them into two groups based on their visual appearance - source domain with 600 documents contains standard-looking receipts with proper angle of view and clear black ink color. We use 37 documents from this split for *validation*, which we use to tune adaptation hyperparameters. Note that the validation split does not overlap with the target domain, which has 347 receipts with slightly blurry look, rotated view, colored ink, and large empty margins. Fig. 1 (bottom row on the left) exemplifies documents from the source and target domains. ## 4.3 Docvqa-Tta: Document Vqa Adaptation Benchmark We use DocVQA (Mathew et al., 2021), a large-scale VQA dataset with nearly 20 different types of documents including scientific reports, letters, notes, invoices, publications, tables, etc. The original training and validation splits contain questions from all of these document types. However, for the purpose of creating an adaptation benchmark, we select 4 *domains* of documents: i) *Emails & Letters* (E), ii) *Tables & Lists* (T), iii) *Figure & Diagrams* (F), and iv) *Layout* (L). Since DocVQA doesn't have public meta-data to easily sort all documents with their questions, we use a simple keyword search to find our desired categories of questions and their matching documents. We use the same words in domains' names to search among questions (i.e., we search for the words of "email" and "letter" for *Emails & Letters* domain). However, for *Layout* domain, our list of keywords is ["top", "bottom", "right", "left", "header", "page number"] which identifies questions that are querying information from a specific location in the document. Among the four domains, L and E have the shortest gap because emails/letters have structured layouts and extracting information from them requires understanding relational positions. For example, the name and signature of the sender usually appear at the bottom, while the date usually appears at top left. However, F and T domains seem to have larger gaps with other domains, that we attributed to that learning to answer questions on figures or tables requires understanding local information withing the list or table. Fig. 1 (top row) exemplifies some documents with their questions from each domain. Document counts in each domain are provided in Appendix. ## 5 Experiments Evaluation metrics: For entity recognition and key-value extraction tasks, we use entity-level F1 score as the evaluation metric, whereas for the document VQA task, we use Average Normalized Levenshtein Similarity (ANLS) introduced by (Biten et al., 2019) (since it is recognized as a better measure compared to accuracy since it doesn't penalize minor text mismatches due to OCR errors). Model architecture: In all of our experiments, we use LayoutLMv2*BASE* architecture which has a 12-layer 12-head Transformer encoder with a hidden size of 768. Its visual backbone is based on ResNeXt101-FPN, similar to that of MaskRCNN (He et al., 2017). Overall, it has ∼200M parameters. We note that our approach is architecture agnostic, and hence applicable to any attention-based VDU model. Details on training and hyper parameter tuning are provided in Appendix. Baselines: As our method is the first TTA approach proposed for VDU tasks, there is no baseline to compare directly. Thus, we adopt TTA and UDA approaches from image classification, as they can be applicable for VDU given that they do not depend on augmentation techniques, contrastive learning, or generative modeling. For UDA, we use two established and commonly used baselines **DANN** (Ganin & Lempitsky, 2015) and **CDAN** (Long et al., 2018) and for TTA, we use the baselines batch normalization BN (Ioffe & Szegedy, 2015; Nado et al., 2020), **TENT** (Wang et al., 2021b), and **SHOT** (Liang et al., 2020). Details on all the baselines are given in Appendix A.2.2. We also provide **source-only**, where the model trained on source and evaluated on target without any adaptation mechanism, and **train-on-target**, where the model is trained (and tested) on target domain using the exact same hyperparameters used for TTA (which are found on the validation set and might not be the most optimal values for target data). While these two baselines don't adhere to any domain adaptation setting, they can be regarded as the ultimate lower and upper bound for performance. ## 5.1 Results And Discussions FUNSD-TTA: Table 1 shows the comparison between DocTTA and DocUDA with their corresponding TTA and UDA baselines. For UDA, DocUDA outperforms all other UDA baselines by a large margin, and Table 1: F1 score results for adapting source to target in **FUNSD-TTA** and **SROIE-TTA** benchmarks. Availability of the labeled/unlabeled data from source/target domains during *adaptation* in UDA and TTA settings and *training* phase in source-only and train-on-target settings are marked. Source-only and train-ontarget serve as lower and upper bounds, respectively for performance on target domain. Standard deviations are in parentheses. | Labeled | Unlabeled | | | | | | |---------------|-----------------|-------------|-----------|--------------|--------------|--------------| | DA category | Methods | Labeled | | | | | | source data | target data | target data | FUNSD-TTA | SROIE-TTA | | | | - | source-only | X | × | × | 80.80 (0.12) | 92.45 (0.08) | | DANN | X | × | X | 82.54 (0.14) | 92.89 (0.13) | | | UDA | CDAN | X | × | X | 83.72 (0.61) | 93.36 (0.18) | | DocUDA (ours) | X | × | X | 89.76 (0.09) | 97.38 (0.15) | | | BN | × | × | X | 80.84 (0.93) | 92.41 (0.45) | | | TTA | TENT | × | × | X | 79.78 (1.28) | 92.42 (0.87) | | SHOT | × | × | X | 80.89 (1.03) | 92.78 (0.65) | | | DocTTA (ours) | × | × | X | 84.23 (0.88) | 94.34 (0.43) | | | - | train-on-target | × | X | × | 99.89 (0.05) | 100.0 (0.00) | improves 8.96% over the source-only. For the more challenging setting of TTA, DocTTA improves the F1 score of the source-only model by 3.43%, whereas the performance gain by all the TTA baselines is less than 0.5%. We also observe that DocTTA performs slightly better than other UDA baselines DANN and CDAN, which is remarkable given that unlike those, DocTTA does not have access to the source data at test time. SROIE-TTA: Table 1 shows the comparison between UDA and TTA baselines vs. DocUDA and DocTTA on SROIE-TTA benchmark. Similar to our findings for FUNSD-TTA, DocUDA and DocTTA outperform their corresponding baselines, where DocTTA can even surpass DANN and CDAN (which use source data at test time). Comparison of DocUDA and DocTTA shows that for small distribution shifts, UDA version of our framework results in better performance. DocVQA-TTA: Table 2 shows the results on our DocVQA-TTA benchmark, where the ANLS scores are obtained by adapting each domain to all the remaining ones. The distribution gap between domains on this benchmark is larger compared to FUNSD-TTA and SROIE-TTA benchmarks. Hence, we also see a greater performance improvement by using TTA/UDA across all domains and methods. For the UDA setting, DocUDA consistently outperforms adversarial-based UDA methods by a large margin, underlining the superiority of self-supervised learning and pseudo labeling in leveraging labeled and unlabeled data at test time. Also in the more challenging TTA setting, DocTTA consistently achieves the highest gain in ANLS score, with 2.57% increase on E → F and 17.68% on F → E. Moreover, DocTTA significantly outperforms DANN on all domains and CDAN on 11 out of 12 adaptation scenarios, even though it does not utilize source data at test time. This demonstrates the efficacy of joint online pseudo labeling with diversity maximization and masked visual learning. Between DocUDA and DocTTA, it is expected that DocUDA performs better than DocTTA due to having extra access to source domain data. However, we observe three exceptions where DocTTA surpasses DocUDA by 1.13%, 0.79%, and 2.16% in ANLS score on E → F and T → F, and L → F, respectively. We attribute this to: i) target domain (F) dataset size being relatively small, and ii) large domain gap between source and target domains. The former can create an imbalanced distribution of source and target data, where the larger split (source data) dominates the learned representation. This effect is amplified due to (ii) because the two domains aren't related and the joint representation is biased in favor of the labeled source data. Another finding on this benchmark is that a source model trained on a domain with a small dataset generalizes less compared to the one with sufficiently-large dataset but has a larger domain gap with the target domain. Results for train-on-target on each domain can shed light on this. When we use the domain with the smallest dataset (F) as the source, each domain can only achieve its lowest ANLS score (39.70% on E, 24.77% on T, and 38.59% on L) whereas with T, second smallest domain Table 2: ANLS scores for adapting between domains in **DocVQA-TTA** benchmark. Source-only and train-on-target serve as lower and upper bounds, respectively for performance on target domain. Standard deviations are shown in Appendix. | Source: | Emails&Letters (E) | | | Figures&Diagrams (F) | | Tables&Lists (T) | | | Layout (L) | | | | |-----------------|----------------------|-------|-------|------------------------|-------|--------------------|-------|-------|--------------|-------|-------|-------| | Target: | F | T | L | E | T | L | E | F | L | E | F | T | | source-only | 37.79 | 25.59 | 38.25 | 5.23 | 7.03 | 3.65 | 13.66 | 20.48 | 14.58 | 53.55 | 33.36 | 33.43 | | DANN | 38.94 | 27.22 | 40.23 | 15.43 | 9.34 | 7.45 | 17.67 | 22.19 | 17.67 | 54.55 | 33.87 | 33.58 | | CDAN | 39.08 | 29.33 | 41.29 | 16.99 | 11.32 | 10.23 | 27.87 | 25.23 | 27.66 | 56.82 | 34.27 | 34.81 | | DocUDA (ours) | 39.23 | 43.54 | 57.99 | 24.21 | 15.76 | 20.45 | 53.19 | 29.91 | 47.81 | 61.09 | 34.85 | 41.80 | | BN | 38.10 | 26.89 | 38.23 | 7.32 | 8.56 | 9.35 | 15.13 | 22.24 | 15.65 | 53.23 | 33.67 | 33.55 | | TENT | 38.34 | 26.42 | 40.45 | 12.38 | 7.34 | 11.29 | 16.01 | 20.23 | 15.02 | 53.34 | 33.59 | 34.55 | | SHOT | 38.98 | 27.55 | 39.15 | 14.34 | 10.10 | 13.21 | 22.56 | 24.33 | 19.15 | 56.23 | 34.56 | 35.65 | | DocTTA (ours) | 40.36 | 35.28 | 49.35 | 22.91 | 15.67 | 16.01 | 35.67 | 30.70 | 26.32 | 59.84 | 37.01 | 39.10 | | train-on-target | 95.28 | 93.54 | 95.01 | 39.70 | 24.77 | 38.59 | 84.59 | 70.66 | 83.73 | 92.32 | 91.36 | 93.41 | | Method | F | T | L | |----------------------------|--------------|--------------|--------------| | Source-only | 37.79 (1.30) | 25.59 (1.78) | 38.25 (0.92) | | DocTTA, conf. | 32.67 (1.68) | 21.50 (1.52) | 6.71 (3.21) | | DocTTA, conf. & unc. | 39.45 (0.87) | 28.47 (0.72) | 47.50 (0.51) | | DocTTA, no LMV LM | 35.66 (0.46) | 25.72 (0.55) | 45.88 (0.34) | | DocTTA, no LDIV | 34.32 (0.53) | 25.17 (0.49) | 46.36 (0.21) | | DocTTA, no pseudo labeling | 33.61 (1.65) | 23.43 (0.87) | 15.89 (1.35) | | DocTTA | 40.36 (0.53) | 35.28 (0.76) | 49.35 (1.20) | Table 3: Ablation analysis on adapting from E to F, T, L in our DocVQA-TTA benchmark with different components including pseudo labeling, LMV LM, LDIV , and pseudo label selection mechanism using confidence only or together with uncertainty. Standard deviations are in parentheses. in dataset size in our benchmark (with 657 training documents), the scores obtained by train-on-target on E and L increases to 84.59% and 83.73%, respectively. Thus, even if we have access to entire target labeled data, the limitation of source domain dataset size is still present. Ablation studies: We compare the impact of different constituents of our methods on the DocVQA-TTA benchmark, using a model trained on Emails&Letters domain and adapted to other three domains. Table 3 shows that pseudo labeling selection mechanism plays an important role and using confidence scores to accept pseudo labels results in the poorest performance, much below the source-only ANLS values and even worse than not using pseudo labeling. On the other hand, using uncertainty and raw confidence together to select pseudo labels yields the closest performance to that of the full (best) method (details are provided in Appendix). MVLM loss and diversity maximization criteria have similar impact on DocTTA's performance. ## 6 Conclusions We introduce TTA for VDU for the first time, with our novel approach DocTTA, along with new realistic adaptation benchmarks for common VDU tasks such as entity recognition, key-value extraction, and document VQA. DocTTA starts from a pretrained model on the source domain and uses online pseudo labeling along with masked visual language modeling and diversity maximization on the unlabeled target domain. We propose an uncertainty-based online pseudo labeling mechanism that generates significantly more accurate pseudo labels in a per-batch basis. Overall, novel TTA approaches result in surpassing the state-of-the-art TTA approaches adapted from computer vision, underlining the importance of VDU-specific TTA approach to push the the state-of-the-art in VDU. ## 7 Reproducibility We have included the details of our experimental setup such as the utilized compute resources, pretrained model, optimizer, learning rate, batch size, and number of epochs, etc. in Sec. A.2 of the Appendix. We have provided the details of our hyper parameter tuning and our search space in Section A.2.3 of the Appendix. For our introduced benchmark datasets, the statistics of each dataset is detailed in Section A.1.2. List of the all the training and validation splits for our proposed benchmarks are also provided in Supplemental/TTA_Benchmarks as json files. To ensure full reproducibility, we will release our code upon acceptance. ## References Srikar Appalaraju, Bhavan Jasani, Bhargava Urala Kota, Yusheng Xie, and R Manmatha. Docformer: End-to-end transformer for document understanding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 993–1003, 2021. Ali Furkan Biten, Ruben Tito, Andres Mafla, Lluis Gomez, Marçal Rusinol, Minesh Mathew, CV Jawahar, Ernest Valveny, and Dimosthenis Karatzas. Icdar 2019 competition on scene text visual question answering. In *2019 International Conference on Document Analysis and Recognition (ICDAR)*, pp. 1563–1570. IEEE, 2019. Dian Chen, Dequan Wang, Trevor Darrell, and Sayna Ebrahimi. Contrastive test-time adaptation. In *CVPR*, 2022. Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In *International conference on machine learning*, pp. 1597–1607. PMLR, 2020a. Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. *arXiv preprint arXiv:2003.04297*, 2020b. Morris H DeGroot and Stephen E Fienberg. The comparison and evaluation of forecasters. Journal of the Royal Statistical Society: Series D (The Statistician), 32(1-2):12–22, 1983. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. *arXiv preprint arXiv:1810.04805*, 2018. Geoffrey French, Michal Mackiewicz, and Mark Fisher. Self-ensembling for visual domain adaptation. arXiv preprint arXiv:1706.05208, 2017. Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In *international conference on machine learning*, pp. 1050–1059. PMLR, 2016. Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In *International conference on machine learning*, pp. 1180–1189. PMLR, 2015. Muhammad Ghifary, W Bastiaan Kleijn, Mengjie Zhang, David Balduzzi, and Wen Li. Deep reconstructionclassification networks for unsupervised domain adaptation. In *European conference on computer vision*, pp. 597–613. Springer, 2016. Jiuxiang Gu, Jason Kuen, Vlad I Morariu, Handong Zhao, Rajiv Jain, Nikolaos Barmpalios, Ani Nenkova, and Tong Sun. Unidoc: Unified pretraining framework for document understanding. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 39–50. Curran Associates, Inc., 2021. URL https://proceedings. neurips.cc/paper/2021/file/0084ae4bc24c0795d1e6a4f58444d39b-Paper.pdf. Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning, pp. 1321–1330. PMLR, 2017. Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pp. 2961–2969, 2017. Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In *Proceedings of the IEEE/CVF conference on computer vision and pattern* recognition, pp. 9729–9738, 2020. Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei Efros, and Trevor Darrell. CyCADA: Cycle-consistent adversarial domain adaptation. In Jennifer Dy and Andreas Krause (eds.), *Proceedings of the 35th International Conference on Machine Learning*, volume 80 of Proceedings of Machine Learning Research, pp. 1989–1998. PMLR, 10–15 Jul 2018. URL https://proceedings.mlr. press/v80/hoffman18a.html. Jiaxing Huang, Dayan Guan, Aoran Xiao, and Shijian Lu. Model adaptation: Historical contrastive learning for unsupervised domain adaptation without source data. *Advances in Neural Information Processing* Systems, 34, 2021. Yupan Huang, Tengchao Lv, Lei Cui, Yutong Lu, and Furu Wei. Layoutlmv3: Pre-training for document ai with unified text and image masking. *arXiv preprint arXiv:2204.08387*, 2022. Zheng Huang, Kai Chen, Jianhua He, Xiang Bai, Dimosthenis Karatzas, Shijian Lu, and CV Jawahar. Icdar2019 competition on scanned receipt ocr and information extraction. In 2019 International Conference on Document Analysis and Recognition (ICDAR), pp. 1516–1520. IEEE, 2019. Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In *International conference on machine learning*, pp. 448–456. PMLR, 2015. Guillaume Jaume, Hazim Kemal Ekenel, and Jean-Philippe Thiran. Funsd: A dataset for form understanding in noisy scanned documents. In 2019 International Conference on Document Analysis and Recognition Workshops (ICDARW), volume 2, pp. 1–6. IEEE, 2019. Agustinus Kristiadi, Matthias Hein, and Philipp Hennig. Being bayesian, even just a bit, fixes overconfidence in relu networks. In *International conference on machine learning*, pp. 5436–5446. PMLR, 2020. Ananya Kumar, Tengyu Ma, and Percy Liang. Understanding self-training for gradual domain adaptation. In *International Conference on Machine Learning*, pp. 5468–5479. PMLR, 2020. Chen-Yu Lee, Chun-Liang Li, Timothy Dozat, Vincent Perot, Guolong Su, Nan Hua, Joshua Ainslie, Renshen Wang, Yasuhisa Fujii, and Tomas Pfister. Formnet: Structural encoding beyond sequential modeling in form document information extraction. *arXiv preprint arXiv:2203.08411*, 2022. Dong-Hyun Lee et al. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In *Workshop on challenges in representation learning, ICML*, volume 3, pp. 896, 2013. David Lewis, Gady Agam, Shlomo Argamon, Ophir Frieder, David Grossman, and Jefferson Heard. Building a test collection for complex document information processing. In Proceedings of the 29th annual international ACM SIGIR conference on Research and development in information retrieval, pp. 665–666, 2006. Peizhao Li, Jiuxiang Gu, Jason Kuen, Vlad I Morariu, Handong Zhao, Rajiv Jain, Varun Manjunatha, and Hongfu Liu. Selfdoc: Self-supervised document representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5652–5660, 2021. Jian Liang, Dapeng Hu, and Jiashi Feng. Do we really need to access the source data? source hypothesis transfer for unsupervised domain adaptation. In *International Conference on Machine Learning (ICML)*, pp. 6028–6039, 2020. Jian Liang, Dapeng Hu, Yunbo Wang, Ran He, and Jiashi Feng. Source data-absent unsupervised domain adaptation through hypothesis transfer and labeling transfer. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2021. In Press. Hong Liu, Jianmin Wang, and Mingsheng Long. Cycle self-training for domain adaptation. *Advances in* Neural Information Processing Systems, 34, 2021. Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In *International conference on machine learning*, pp. 97–105. PMLR, 2015. Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Conditional adversarial domain adaptation. *Advances in neural information processing systems*, 31, 2018. Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. *arXiv preprint arXiv:1711.05101*, 2017. Minesh Mathew, Dimosthenis Karatzas, and CV Jawahar. Docvqa: A dataset for vqa on document images. In *Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision*, pp. 2200–2209, 2021. Alexander Meinke and Matthias Hein. Towards neural networks that provably know when they don't know. In *International Conference on Learning Representations*, 2020. URL https://openreview.net/forum? id=ByxGkySKwH. Jose G Moreno-Torres, Troy Raeder, Rocío Alaiz-Rodríguez, Nitesh V Chawla, and Francisco Herrera. A unifying view on dataset shift in classification. *Pattern recognition*, 45(1):521–530, 2012. Subhabrata Mukherjee and Ahmed Hassan Awadallah. Uncertainty-aware self-training for text classification with few labels. *arXiv preprint arXiv:2006.15315*, 2020. Zak Murez, Soheil Kolouri, David Kriegman, Ravi Ramamoorthi, and Kyungnam Kim. Image to image translation for domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4500–4509, 2018. Zachary Nado, Shreyas Padhy, D Sculley, Alexander D'Amour, Balaji Lakshminarayanan, and Jasper Snoek. Evaluating prediction-time batch normalization for robustness under covariate shift. *arXiv preprint* arXiv:2006.10963, 2020. Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In *Twenty-Ninth AAAI Conference on Artificial Intelligence*, 2015. Alexandru Niculescu-Mizil and Rich Caruana. Predicting good probabilities with supervised learning. In Proceedings of the 22nd international conference on Machine learning, pp. 625–632, 2005. Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. *Advances in neural information processing systems*, 32, 2019. Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1406–1415, 2019. Joaquin Quiñonero-Candela, Masashi Sugiyama, Anton Schwaighofer, and N Lawrence. Covariate shift and local learning by distribution matching, 2008a. Joaquin Quiñonero-Candela, Masashi Sugiyama, Anton Schwaighofer, and Neil D Lawrence. *Dataset shift* in machine learning. Mit Press, 2008b. Mamshad Nayeem Rizve, Kevin Duarte, Yogesh S Rawat, and Mubarak Shah. In defense of pseudo-labeling: An uncertainty-aware pseudo-label selection framework for semi-supervised learning. In *International* Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=-ODN6SbiUU. Claude Elwood Shannon. A mathematical theory of communication. *ACM SIGMOBILE mobile computing* and communications review, 5(1):3–55, 2001. Rui Shu, Hung Bui, Hirokazu Narui, and Stefano Ermon. A DIRT-t approach to unsupervised domain adaptation. In *International Conference on Learning Representations*, 2018. URL https://openreview. net/forum?id=H1q-TM-AW. Yu Sun, Xiaolong Wang, Liu Zhuang, John Miller, Moritz Hardt, and Alexei A. Efros. Test-time training with self-supervision for generalization under distribution shifts. In *ICML*, 2020. Sunil Thulasidasan, Gopinath Chennupati, Jeff A Bilmes, Tanmoy Bhattacharya, and Sarah Michalak. On mixup training: Improved calibration and predictive uncertainty for deep neural networks. *Advances in* Neural Information Processing Systems, 32, 2019. Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In European conference on computer vision, pp. 776–794. Springer, 2020. Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. *arXiv preprint arXiv:1412.3474*, 2014. Dequan Wang, Shaoteng Liu, Sayna Ebrahimi, Evan Shelhamer, and Trevor Darrell. On-target adaptation. arXiv preprint arXiv:2109.01087, 2021a. Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno Olshausen, and Trevor Darrell. Tent: Fully test-time adaptation by entropy minimization. In *International Conference on Learning Representations*, 2021b. URL https://openreview.net/forum?id=uXl3bZLkr3c. Hongxin Wei, Renchunzi Xie, Hao Cheng, Lei Feng, Bo An, and Yixuan Li. Mitigating neural network overconfidence with logit normalization. In *International Conference on Machine Learning*, pp. 23631– 23644. PMLR, 2022. Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google's neural machine translation system: Bridging the gap between human and machine translation. *arXiv preprint arXiv:1609.08144*, 2016. Haifeng Xia, Handong Zhao, and Zhengming Ding. Adaptive adversarial network for source-free domain adaptation. In *Proceedings of the IEEE/CVF International Conference on Computer Vision*, pp. 9010– 9019, 2021. Yang Xu, Yiheng Xu, Tengchao Lv, Lei Cui, Furu Wei, Guoxin Wang, Yijuan Lu, Dinei Florencio, Cha Zhang, Wanxiang Che, et al. Layoutlmv2: Multi-modal pre-training for visually-rich document understanding. arXiv preprint arXiv:2012.14740, 2020a. Yiheng Xu, Minghao Li, Lei Cui, Shaohan Huang, Furu Wei, and Ming Zhou. Layoutlm: Pre-training of text and layout for document image understanding. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1192–1200, 2020b. ## A Appendix A.1 Dataset Details A.1.1 Licence We use three publicly-available datasets to construct our benchmarks. These datasets can be downloaded from their original hosts under their terms and conditions: - FUNSD Jaume et al. (2019) License, instructions to download, and term of use can be found at https://guillaumejaume.github.io/FUNSD/work/ - SROIE Huang et al. (2019) License, instructions to download, and term of use can be found at https://github.com/zzzDavid/ICDAR-2019-SROIE - DocVQA Mathew et al. (2021) License, instructions to download, and term of use can be found at https://www.docvqa.org/datasets/doccvqa ## A.1.2 Dataset Splits We provide the list of the documents in the *source* and *target* domains for our three benchmarks. Files are located at Supplemental/TTA_Benchmarks/. For FUNSD-TTA and SROIE-TTA, the validation splits have 10 and 39 documents, respectively, which are selected randomly using the seed number 42. Validation splits have a similar distribution as the source domain's training data. When performing TTA, we use the target domain data without labels - the labels are only used for evaluation purposes. Table 5 and Table 6 show the statistics of documents on source and target domains in FUNSD-TTA and SROIE-TTA, respectively. Table 4: Number of documents in the source and target domains in FUNSD-TTA and SROIE-TTA benchmarks. We use the validation set selected from the source domain to tune TTA algorithm's hyper parameters. | Table 5: FUNSD-TTA | | Table 6: SROIE-TTA | | |-------------------------------------|-----|-------------------------------------|-----| | Source Training | 139 | Source Training | 600 | | Source Validation | 10 | Source Validation | 39 | | Source Evaluation, Target Training, | 50 | | | | Target Evaluation | | Source Evaluation, Target Training, | 347 | | | | Target Evaluation | | | Layout (L) | Emails&Letters (E) | Tables&Lists (T) | Figures&Diagrams (F) | | |-------------------------------------|----------------------|--------------------|------------------------|-----| | Source Training | 1807 | 1417 | 592 | 150 | | Source Validation | 200 | 157 | 65 | 17 | | Source Evaluation, Target Training, | 512 | 137 | 187 | 49 | | Target Evaluation | | | | | For DocVQA-TTA benchmark, we always choose 10% of source domain data for validation using the same seed (42). Table 7: Number of documents in each domain of our DocVQA-TTA benchmark. ## A.1.3 Text Embeddings And Ocr Annotations For all the benchmarks, we use officially-provided OCR annotations for each datasets. For the tokenization process, we follow Xu et al. (2020a) where they use WordPiece Wu et al. (2016) such that each token in the OCR text sequence is assigned to a certain segment of si ∈ {[A], [B]} prepended by [CLS] if it is the starting token and/or appended by [SEP] if it is the ending token of the sequence. In order to have a fixed sequence length in each document, extra [PAD] tokens are appended to the end, if the sequence exceeds a maximum length threshold (which is 512 in this work). ## A.2 Experiments Details A.2.1 Training. We use PyTorch (Paszke et al., 2019) on Nvidia Tesla V100 GPUS for all the experiments. For **source** training, we use LayoutLMv2*BASE* pre-trained on IIT-CDIP dataset and fine-tune it with labeled source data on our desired task. For all VDU tasks, we build task-specific classifier head layers over the text embedding of LayoutLMv2*BASE* outputs. For entity recognition and key-value extraction tasks, we use the standard cross-entropy loss and for DocVQA task, we use the binary cross-entropy loss on each token to predict whether it is the starting/ending position of the answer or not. We use AdamW (Loshchilov & Hutter, 2017) optimizer and train source model with batch sizes of 32, 32, and 64 for 200, 200, and 70 epochs with a learning rate of 5×10−5for entity recognition, key-value extraction, and DocVQA benchmarks, respectively with an exception of *Figures & Diagrams* domain on which we used a learning rate of 10−5. For BN and SHOT baselines, we followed SHOT implementation for image classification and added a fully connected layer with 768 hidden units, followed by a batch normalization layer right before the classification head. Note that we used the same backbone architecture (LayoutLMv2) as was used in DocTTA and DocUDA for all the baselines methods. For example, ResNet backbone in DANN, CDAN, and SHOT methods was replaced with LayoutLMv2 architecture. Therefore all the baselines receive the inputs exactly similar to our approach. Uncertainty and confidence-aware pseudo labeling For uncertainty-aware pseudo labeling, we set a threshold (γ) above which pseudo labels are rejected to be used for training. Likewise, for confidence-aware pseudo labeling, we set a threshold for the output probability values for the predicted class *below* which pseudo labels are rejected. For the combination of the two, a pseudo label which has confidence (output probability) value above the threshold and uncertainty value (Shannon entropy) below the maximum threshold is chosen for self-training. We used confidence threshold of 0.95 and tuned the uncertainty threshold to be either 1.5 or 2 (see below). ## A.2.2 Baselines Details In this section we discuss more details about UDA and TTA baselines in our work and how they are different from our proposed approach, DocUDA and DocTTA, in both settings. UDA baseliens. We compared DocUDA against **DANN** (Ganin & Lempitsky, 2015) and **CDAN** (Long et al., 2018) methods. **DANN** was proposed as a deep architecture termed as Domain-Adversarial Neural Network (DANN) for unsupervised domain adaptation which consists of a feature extractor, a label predictor, and a domain classifier. The feature extractor is similar to a generator which tries to generate domainindepended features for confusing the domain classifier. On the other hand, the domain classifier acts as the discriminator which tries to predict whether the extracted features are from the source or target domain. Lastly, the label predictor which is trained on the extracted features of the labeled source domain, tries to predict the correct class for a target sample. DANN can be trained with a special gradient reversal layer (GRL) which authors claim gives superior performance compared to when GRL it is not used in the architecture. DANN is an adversarial adaptation method and hence is substantially different from DocUDA which uses pseudo labeling and self-supervised learning in the form of masked visual language modeling. **CDAN** (Long et al., 2018) or Conditional Domain Adversarial Network uses discriminative information conveyed in the classifier predictions to assist adversarial adaptation. The key to the CDAN approach is a novel conditional domain discriminator conditioned on the cross covariance of domain-specific feature representations and classifier predictions. They further condition the domain discriminator on the uncertainty of classifier predictions, prioritizing the discriminator on easy-to-transfer examples. CDAN is another adversarial learning-based adaptation method that tries to disentangle domain specific and domain invariant features for adaptation whereas DocUDA tries to leverage the model's knowledge on both domains at the same time without disentangling or conditional learning on discriminative features. TTA baselines. We compared DocTTA with BN (Ioffe & Szegedy, 2015; Nado et al., 2020), **TENT** (Wang et al., 2021b) and **SHOT** (Liang et al., 2020). BN or batch normalization is a widely used (training time) technique proposed by Ioffe & Szegedy (2015). Nado et al. (2020) adopted the training time BN and used it at test time which is a simple but surprisingly effective method and can be implemented with one line of code change. In standard practice, the batch normalization statistics are frozen to particular values after training time that are used to compute predictions. Nado et al. (2020) proposed to recalculate batch norm statistics on every batch at test time instead of re-using values from training time as a mechanism to adapt to unlabeled test data. While this is computationally inexpensive and widely adoptable to different settings, it is not enough to overcome performance degradation issue when there is a large distribution mismatch between source and target domains. As shown in our experiments and also shown in the literature (Wang et al., 2021b;a; Chen et al., 2022) this method is usually outperformed by methods which rely on stronger adaptation mechanisms such as pseudo labeling. **TENT** (Wang et al., 2021b) proposed to adapt by test entropy minimization where the model is optimized for confidence as measured by the entropy of its predictions. TENT estimates normalization statistics and optimizes channel-wise affine transformations to update online on each batch. While this method was shown to improve BN which only updates BN statistics, it suffers from accumulation of error which can occur in the beginning of the training when predictions tend to be inaccurate especially because VDU models create a long sequence of outputs per every document resulting in a noisy training. DocTTA's training is significantly different from TENT as it primarily uses pseudo labeling, MVLM and diversity losses for adaptation. Lastly, **SHOT** Liang et al. (2020) can be considered as the closest work to ours where it combines mutual information maximization with offline clustering-based pseudo labeling. However, using simple offline pseudo-labeling can lead to noisy training and poor performance when the distribution shifts are large (Chen et al., 2022; Liu et al., 2021; Rizve et al., 2021; Mukherjee & Awadallah, 2020). In DocTTA we also use pseudo labeling but we propose online updates per batch for pseudo labels, as the model adapts to test data. Besides, we equip our method with a pseudo label rejection mechanism using uncertainty, to ensure the negative effects of predictions that are likely to be inaccurate. DocTTA also leverages masked visual langugae modeling on target domain which contributes in learning the structure of the target domain whereas SHOT only depends on pseudo labeling. ## A.2.3 Hyper Parameter Tuning We use a validation set (from source domain) in each benchmark for hyper parameter tuning. Although not optimal, it is more realistic to assume no access to any labeled data in the target domain. We used a simple grid search to find the optimal set of hyper parameters with the following search space: - Learning rate ∈ {10−5, 2.5 × 10−5, 5 × 10−5} - Weight decay ∈ {0, 0.01} - Batch size ∈ {1, 4, 5, 8, 32, 40, 48, 64} - Uncertainty threshold γ ∈ {1.5, 2} ## A.3 Measuring Confidence After Adaptation With Doctta For reliable VDU deployments, confidence calibration can be very important, as it is desired to identify when the trained model can be trusted so that when it is not confident, a human can be consulted. In this section, we focus on confidence calibration and analyze how DocTTA affects it. Figure 3 illustrates reliability diagrams for adapting from Emails & Letters (E) to T, F, and L domains in DocVQA-TTA benchmark. We compares model calibration before and after DocTTA for 'starting position index of an extracted answer' in documents. We illustrate calibration with reliability diagram (DeGroot & Fienberg, 1983; Niculescu-Mizil & Caruana, 2005), confidence histograms (Guo et al., 2017), and the ECE metric. The reliability diagram shows the expected accuracy as a function of confidence. We first group the predictions on target domain into a set of bins (we used 10). For each bin, we then compute the average confidence and accuracy and visualize them (top red plots in Fig. 3). The closer the bars are to the diagonal line, the more calibrated the model would be. Also, lower ECE values indicate better calibrations. It is observed that calibration improves with DocTTA. From this plot, we can also measure ECE as a summary metric (the lower, the better calibration). For instance, DocTTA on E → L yields significantly lower ECE, from 30.45 to 2.44. Although the reliability diagram can explain model's calibration well, it does not show the portion of samples at a given bin. Thus, we use confidence histograms (see bottom of Fig. 3) where the gap between accuracy and average confidence is indicative of calibration. Before adaptation, the model tends to be overconfident whereas, after adaptation with DocTTA, the gap becomes drastically smaller and nearly overlaps. | Source: | | Emails&Letters (E) | Figures&Diagrams (F) | | | | |-----------------|--------------|----------------------|------------------------|--------------|--------------|--------------| | Target: | F | T | L | E | T | L | | Source-only | 37.79 (1.30) | 25.59 (1.78) | 38.25 (0.92) | 5.23 (2.86) | 7.03 (2.42) | 3.65 (2.76) | | DANN | 38.94 (1.20) | 27.22 (1.32) | 40.23 (1.78) | 15.43 (1.34) | 9.34 (3.23) | 7.45 (3.29) | | CDAN | 39.08 (1.59) | 29.33 (0.82) | 41.29 (2.80) | 16.99 (1.56) | 11.32 (2.43) | 10.23 (2.54) | | DocUDA (ours) | 39.23 (1.42) | 43.54 (0.91) | 57.99 (0.12) | 24.21 (0.72) | 15.76 (0.67) | 20.45 (0.43) | | BN | 38.10 (1.01) | 26.89 (0.59) | 38.23 (0.98) | 7.32 (2.43) | 8.56 (2.34) | 9.35 (3.21) | | TENT | 38.34 (0.74) | 26.42 (0.52) | 40.45 (0.81) | 12.38 (3.12) | 7.34 (2.54) | 11.29 (2.45) | | SHOT | 38.98 (0.89) | 27.55 (0.81) | 39.15 (1.23) | 14.34 (3.87) | 10.10 (1.34) | 13.21 (2.54) | | DocTTA (ours) | 40.36 (0.53) | 35.28 (0.76) | 49.35(1.20) | 22.91(0.45) | 15.67(0.78) | 16.01(1.18) | | Train-on-target | 95.28 (1.32) | 93.54 (0.91) | 95.01 (1.34) | 39.70 (1.02) | 24.77 (0.23) | 38.59 (0.78) | Table 8: Standard deviations (in parentheses) for ANLS scores shown in Table 2 of the main paper for adapting between domains in **DocVQA-TTA** benchmark (Part I). | Source: | | Tables&Lists (T) | Layout (L) | | | | |-----------------|--------------|--------------------|--------------|--------------|--------------|--------------| | Target: | E | F | L | E | F | T | | Source-only | 13.66 (1.67) | 20.48 (1.54) | 14.58 (1.30) | 53.55 (1.76) | 33.36 (1.84) | 33.43 (1.94) | | DANN | 17.67 (1.49) | 22.19 (2.34) | 17.67 (2.58) | 54.55 (0.72) | 33.87 (1.02) | 33.58 (0.28) | | CDAN | 27.87 (1.82) | 25.23 (1.24) | 27.66 (2.62) | 56.82 (0.62) | 34.27 (0.82) | 34.81 (0.43) | | DocUDA (ours) | 53.19 (0.92) | 29.91 (0.45) | 47.81(0.41) | 61.09 (0.08) | 34.85 (0.16) | 41.80 (0.06) | | BN | 15.13 (2.04) | 22.24 (1.29) | 15.65 (2.43) | 53.23 (1.08) | 33.67 (1.17) | 33.55 (1.55) | | TENT | 16.01 (2.83) | 20.23 (2.61) | 15.02 (2.83) | 53.34 (0.93) | 33.59 (1.82) | 34.55 (1.44) | | SHOT | 22.56 (1.12) | 24.33 (2.54) | 19.15 (2.39) | 56.23 (1.20) | 34.56 (1.02) | 35.65 (1.23) | | DocTTA (ours) | 35.67 (1.10) | 30.70 (0.80) | 26.32 (1.27) | 59.84 (0.04) | 37.01 (0.05) | 39.10 (0.06) | | Train-on-target | 84.59 (1.02) | 70.66 (0.82) | 83.73 (0.23) | 92.32 (0.01) | 91.36 (0.04) | 93.41 (0.05) | Table 9: Standard deviations (in parentheses) for ANLS scores shown in Table 2 of the main paper for adapting between domains in **DocVQA-TTA** benchmark (Part II). ![17_image_0.png](17_image_0.png) Figure 3: Comparing confidence calibration with and without DocTTA when adapting from Emails & Letters domain to other domains in DocVQA-TTA benchmark. ## A.4 Standard Deviations Here we show the standard deviations obtained over 3 seeds for results reported in Table 2 of the main paper in Table 8 (part I) and 9 (part II), respectively. ## A.5 Docuda Algorithm In DocUDA, we use source data during training on target at test time. Therefore, DocUDA has an additional objective function which is a cross-entropy loss using labeled source data: $${\mathcal{L}}_{C E_{S r c}}(\theta_{t})=-\mathbb{E}_{x_{s}\in{\mathcal{X}}_{s}}\sum\nolimits_{c=1}^{C}y_{c}\log\sigma(f_{t}(x_{s})),$$ $$({\mathfrak{h}})$$ yc log σ(ft(xs)), (6) And the overall objective function of DocUDA is Eq. 5 plus Eq. 6: $${\mathcal{L}}_{\mathrm{DocUDA}}={\mathcal{L}}_{M V L M}+{\mathcal{L}}_{C E}+{\mathcal{L}}_{D I V}+{\mathcal{L}}_{C E s r e}.$$ $$\left(7\right)$$ LDocUDA = LMV LM + LCE + LDIV + LCESrc . (7) Algorithm 2 shows how DocUDA is performed on VDU tasks. Algorithm 2 DocUDA for closed-set UDA in VDU 1: **Input:** labeled source documents {x (i) s , y (i) s } ns i=1, target documents {x i t} nt i=1, test-time training epochs ne, test-time training learning rate α, uncertainty threshold γ 2: **Initialization:** Initialize target model fθt with LayoutLMv2*BASE* weights trained on IIT-CDIP dataset. 3: for *epoch* = 1 to ne do 4: Perform masked visual-language modeling in Eq. 1 5: Generate pseudo labels and accept a subset using criteria in Eq. 2 and fine-tune with Eq. 3 6: Maximize diversity in pseudo label predictions Eq. 4 7: Perform supervised training using labeled source data with Eq. 3 8: θt ← θt − α∇LDocUDA B Update θt via total loss in Eq. 7 9: **end for** ## A.6 Qualitative Results Here we show a randomly selected document from our FUNSD-TTA benchmark. Comparing the results before and after using DocTTA shows that our method can refine some wrong predictions made by the unadapted model. ![18_image_0.png](18_image_0.png) Figure 4: From left to right we show predictions made by (i) an unadapted model, (ii) after using DocTTA, iii) ground truth labels. ## A.7 Additional Baseline Results Here we show the performance of our model against AdaContrast (Chen et al., 2022) for TTA and SHOTUDA (Liang et al., 2020) on DocVQA-TTA benchmark when adapting from *Emails & Letters* domain to F, T, and L. | Source | Emails&Letters (E) | | | |-------------------|----------------------|-------|-------| | Target | F | T | L | | SHOT (UDA) | 39.02 | 31.35 | 48.87 | | DocUDA (ours) | 39.23 | 43.54 | 57.99 | | AdaContrast (TTA) | 37.21 | 27.43 | 38.69 | | DocTTA (ours) | 40.36 | 35.28 | 49.35 | Table 10 ## A.8 Layout Illustration In our method, layout refers to a bounding box associated with each word in the text input sequence and is represented with a 6-dimensional vector in the form of (xmin, xmax, ymin, ymax*, w, h*). where (xmin, ymin) corresponds to the position of the lower left corner and (xmax, ymax) represents the position of the upper right corner of the bounding box and w and h denote the width and height of the box, respectively as shown below ![19_image_0.png](19_image_0.png) w Figure 5: Illustration of layout as a bounding box associated with each word in the text input sequence.
Review 1: Summary: - This work introduces a new benchmark for domain adaptation for document understanding tasks such as form understanding and VQA. - As the authors observe domain adaptation for document images understanding is not a well studied problem. Authors show that a simple in-domain self supervised training using MLVM and retraining using pseudo labels can help to some extent. - Strengths and Weaknesses: ### Strengths - The empirical results show that the proposed , unsupervised approach that doesn't use source data helps to improve the performance on the target domain. - Paper is generally well written ### Weaknesses - The proposed approach is a trivial application of existing methods for domain adaptation in document image understanding. The proposed approach is essentially an in-domain self supervised training using MVLM on the target data and a supervised training using pseudo labels. Although these experiments are worthy contributions, the technical contribution is limited. MVLM based pretraining is quite popular in vision and language community. Self supervised learning using this objective, on the target domain is a a trivial contribution. The second objective is training using pseudo labels, which is widely used in domain adaptation literature. - For the FUNSD-TTA, what is the rationale behind the splitting criteria - sparse vs dense text. How does that make a "shift" from domain adaptation perspective ? Similarly for SROIE-TTA, the criteria for the split is more or less intuitive and not backed by any supporting evidence or reasoning. - Requested Changes: - In page 2 authors write "pseudo-labelling can result in accumulation of errors.." in the case of VDU. Can the authors please explain this in the context of VQA on document images. This reviewer could not understand what is written above it either. - Authors use a baseline from Nado et al. that uses batch normalization. But this work is not discussed anywhere in the related works. Request the authors to add details of of all the three baselines and how it compares with the approach proposed in this work. - In Fig2, align the text on the left with the rows that show different embedding. For example, 1D pos. emb. is shown against the segment embedding - It will be helpful if an illustration of DocTTA framework for DocVQA is provided as it comes with an extra input in the form of a question. The current Figure only shows an image in the input. - In page 5, it is written that layout X^B is a 6 dimensional vector. When question tokens are introduced, what will be this vector be, for a question token? - One aspect that this reviewer is confused about is how the training happens for DocTTA. Is MVLM and supervised training using MVLM happening concurrently ? If that is the case, this reviewer has following questions in this regard 1. For a token classification style task on datasets like FUNSD, if a token from the document is maksed, how can the model generate a label for it (label as in the label corresponding to the semantic entity) 2. For the VQA task, when some one tokens are masked does the model have enough information to find the answer to the question 3. Would not it be better to perform the MVLM first, and then use pseudo-label based supervised training. Will it be possible for the authors to perform this experiment ? - In Algorithm 1, Input takes in only target documents. However for VQA, would not question also be a part of the input? - Page 6. in section 3.3, third sentence, there is a typo. - How are the baselines used in this work modified/adapted for the problem of VQA. This reviewer feels that more details on what are these baselines and how are they used for the VDU problem needs to be added Broader Impact Concerns: The paper does not include any statement(s) on the ethical implications. This reviewer could not think of any. ================================================== Review 2: Summary: This paper proposes DocTTA, a test-time adaptation algorithm for visual document understanding (VDU) which effectively adapts representations learned from self-supervised learning algorithms to source-free domain adaptation settings in new target domains. The authors propose new benchmark datasets for this task and demonstrate the efficacy of their approach. Strengths and Weaknesses: Strengths: - The problem is important and relatively under-explored in the field. I can see this work sparking more interest in this domain. - Most of the paper is clearly written and easy to read. For example, the explanation for how the pre-training happens (via the masked visual language modeling task, self-training with pseudolabels, and diversity objective), were straightforward. - The authors also introduce new benchmarks for the VDU domain adaptation task that are constructed from existing, publicly available data - FUNSD for entity recognition, SROIE for key-value extraction, and DocVQA for visual question-answer. - The authors provided extensive detail on how the datasets were constructed, their design decisions on how to construct the datasets, etc. Weaknesses: - Although there do not seem to exist relevant baselines to compare DocTTA against, I'm curious why the authors decided to adapt methods from quite a while back as their baselines (e.g. DANN, which is from 2015). - The authors mention in the paper (as well as in their ablation studies) that the way in which they handled the pseudo-labeling is quite important for achieving good performance, but it's not clear to me why this is the case. Requested Changes: - When looking at Table 2, the discrepancies in ANLS scores between all the existing approaches and train-on-target are quite large. Would the authors address this in the text? - Elaborating a bit more on why they decided to adapt methods such as DANN and CDAN as their baselines would be helpful. - Talking a bit more in detail and clarifying the pseudo-labeling component of the adaptation procedure would be helpful. Section 3.2 was a bit difficult to parse. Broader Impact Concerns: N/A ================================================== Review 3: Summary: The paper aims to do domain adaptation (adapting models trained on a source main to a target domain) using unlabeled target-domain document data. The approach assumes that optical character recognition is already performed, so we already have information on text and bounding boxes. Then, the approach involves - (1) masked visual language modeling, - (2) pseudo labeling: specifically, first performing per-batch pseudo-labeling and then performing uncertainty-aware (based on thresholds according to Shannon entropy) selection according to Equations 2-3, - (3) maximizing diversity of pseudo-labels in case the pseudo-labels get dominated by one or very few classes only. The tasks involve entity recognition, key-value extraction, and document visual question answering. The tasks are created by the authors using existing datasets: specifically, they split existing datasets to a source domain and a target domain. - For the entity-recognition adaptation task (“FUNSD-TTA”), an existing dataset is split into the source domain containing forms with more texts and the target domain containing forms that are only sparsely filled. - For the key-value extraction adaptation task (“SROIE-TTA”), the source domain contains standard-looking receipts (more description in the paper), and the target domain contains blurry or rotated or colored or other non-standard-looking receipts. - For document VQA adaptation (“DocVQA-TTA”), the dataset is split into different categories according to topic/domain, and then combined into source vs. target domains. Results are better than state-of-the-art domain adaptation approaches according to automatic metrics: the first two tasks use entity-level F1, and the third task uses average normalized Levenshtein. Strengths and Weaknesses: Strengths - Interesting topic. Domain adaptation in visual document understanding has real frequent use cases in the real world. - The tasks build on prior datasets, and the source vs. target domain split is clever. - Uncertainty-based selection mechanism (the second part of the approach) seems very crucial. - It’s interesting that the ablation which removes the third objective (maximizing the diversity of pseudo-labels) has much poorer results. - It’s quite surprising to me that the ablation which removes masked visual LM training is better than the ablation that only removes pseudo labeling. - Writing is clear. Concerns Question: No coefficient for Equation (5) when combining different objectives. Would the authors expect that different coefficients would make the results better/worse? Section 3.2, objective II: “We empirically observe that raw confidence values are overconfident despite being right or wrong.” Is there evidence for this statement? Apologies I’m missing the details. Algorithm 1: The equations don’t seem to correspond to the description. Should Equation 2 and Equation 3 be swapped? The tasks have synthetically and manually designed splits, and it’s unclear whether a method that performs well on the proposed three tasks would imply that the method performs well on the noisier real-world test-time domain shifts. But this is not a huge concern imo. Requested Changes: Addressing the above concerns. Overall I think the work is quite sound. I'm also curious: what are the other potential impactful use cases of the authors' approach (other than the three described tasks)? Broader Impact Concerns: N/A ================================================== Metareview: Recommendation: Accept as is Comment: The reviewers acknowledged that the approach, which is based on self-supervised learning (via masked visual-language modeling) on the source domain followed by pseudo-labeling on the target domain, is reasonable and well-supported by convincing empirical evidence. One reviewer expressed concern that both self-supervised learning and pseudo-labeling have been extensively studied in the literature. The authors clarified that while these methods are well-established in the literature, their usage in the context of test-time adaptation for VDU is novel. The reviewers generally found that the overall contribution of this paper, which also includes a new benchmark, outweighs this concern, and they recommended acceptance. This AE agrees with the reviewers' assessment and recommendation for acceptance. The novel application of self-supervised learning and pseudo-labeling in the context of test-time adaptation adds value to the existing literature, and the new benchmark addresses an important research problem. Therefore, based on the reviewers' positive evaluations and the AE's own evaluation, the paper is recommended for acceptance. ==================================================
# What Should A (Future) Deep Learning Theory Look Like? A Phenomenological Perspective Anonymous authors Paper under double-blind review September 9, 2022 ## Abstract To advance deep learning methodologies in the next decade, a theoretical framework for reasoning about modern neural networks is needed. While efforts are increasing toward demystifying why deep learning is so effective, a comprehensive picture remains lacking, suggesting that a better theory is possible. We argue that a future deep learning theory should inherit three characteristics: a *hierarchically* structured network architecture, parameters *iteratively* optimized using stochastic gradient-based methods, and information from the data that evolves *compressively*. As an instantiation, we integrate these characteristics into a graphical model called *neurashed*. This model effectively explains some common empirical patterns in deep learning. In particular, neurashed enables insights into implicit regularization, information bottleneck, and local elasticity. Finally, we discuss how neurashed can guide the development of deep learning theories. ## 1 Introduction Deep learning is recognized as a monumentally successful approach to many data-extensive applications in image recognition, natural language processing, and board game programs (Krizhevsky et al., 2017; LeCun et al., 2015; Silver et al., 2016). Despite extensive efforts (Jacot et al., 2018; Bartlett et al., 2017; Berner et al., 2021), however, our theoretical understanding of how this increasingly popular machinery works and why it is so effective remains incomplete. This is exemplified by the substantial vacuum between the highly sophisticated training paradigm of modern neural networks and the capabilities of existing theories. For instance, the optimal architectures for certain specific tasks in computer vision remain unclear (Tolstikhin et al., 2021). To better fulfill the potential of deep learning methodologies in increasingly diverse domains, heuristics and computation are unlikely to be adequate—a comprehensive theoretical foundation for deep learning is needed. Ideally, this theory would demystify these black-box models, visualize the essential elements, and enable principled model design and training. A useful theory would, at a minimum, reduce unnecessary computational burden and human costs in present-day deep-learning research, even if it could not make all complex training details transparent. Unfortunately, it is unclear how to develop a deep learning theory from first principles. Instead, in this paper we take a phenomenological approach that captures some important characteristics of deep learning. Roughly speaking, a phenomenological model provides an overall picture rather than focusing on details, and allows for useful intuition and guidelines so that a more complete theoretical foundation can be developed. To address what characteristics of deep learning should be considered in a phenomenological model, we recall the three key components in deep learning: architecture, algorithm, and data (Zdeborová, 2020). The most pronounced characteristic of modern network architectures is their *hierarchical* composition of simple functions. Indeed, overwhelming evidence shows that multiple-layer architectures are superior to their shallow counterparts (Eldan & Shamir, 2016), reflecting the fact that high-level features are hierarchically represented through low-level features (Hinton, 2021; Bagrov et al., 2020). The optimization workhorse for training neural networks is stochastic gradient descent or Adam (Kingma & Ba, 2015), which *iteratively* updates the network weights using noisy gradients evaluated from small batches of training samples. Overwhelming evidence shows that the solution trajectories of iterative optimization are crucial to generalization performance (Soudry et al., 2018). It is also known that the effectiveness of deep learning relies heavily on the structure of the data (Blum & Rivest, 1992; Goldt et al., 2020), which enables the *compression* of data information in the late stages of deep learning training (Tishby & Zaslavsky, 2015; Shwartz-Ziv & Tishby, 2017). ## 2 Neurashed We introduce a simple, interpretable, white-box model that simultaneously possesses the *hierarchical, iterative*, and *compressive* characteristics to guide the development of a future deep learning theory. This model, called *neurashed*, is represented as a graph with nodes partitioned into different levels (Figure 1). The number of levels is the same as the number of layers of the neural network that neurashed imitates. Instead of corresponding with a single neuron in the neural network, an l-level node in neurashed represents a feature that the neural network can learn in its l-layer. For example, the nodes in the first/bottom level denote lowest-level features, whereas the nodes in the last/top level correspond to the class membership in the classification problem. To describe the dependence of high-level features on low-level features, neurashed includes edges between a node and its dependent nodes in the preceding level. This reflects the hierarchical nature of features in neural networks. Figure 1: A neurashed model that imitates a four-layer neural network for a three-class classification ![1_image_0.png](1_image_0.png) problem. For instance, the feature represented by the leftmost node in the second level is formed by the features represented by the three leftmost nodes in the first level. Given any input sample, a node in neurashed is in one of two states: firing or not firing. The unique last-level node that fires for an input corresponds with the label of the input. Whether a node in the first level fires or not is determined by the input. For a middle-level node, its state is determined by the firing pattern of its dependent nodes in the preceding levels. For example, let a node represent cat and its dependent nodes be cat head and cat tail. We activate cat when either or both of the two dependent nodes are firing. Alternatively, let a node represent panda head and consider its dependent nodes dark circle, black ear, and white face. The panda head node fires only if all three dependent nodes are firing. We call the subgraph induced by the firing nodes the *feature pathway* of a given input. Samples from different classes have relatively distinctive feature pathways, commonly shared at lower levels but more distinct at higher levels. By contrast, feature pathways of same-class samples are identical or similar. An illustration is given in Figure 2. To enable prediction, all nodes F except for the last-level nodes are assigned a nonnegative value λF as a measure of each node's ability to sense the corresponding feature. A large value of λF means that when this node fires it can send out strong signals to connected nodes in the next level. Hence, λF is the amplification factor of F. Moreover, let ηfF denote the weight of a connected second-last-level node f and last-level node F. Given an input, we define the score of each node, which is sent to its connected nodes on the next level: For any first-level node F, let score SF = λF if F is firing and SF = 0 otherwise; for any firing middle-level node F, we recursively define $$S_{F}=\,.$$ X f→F Sf , $$\lambda_{F}$$ $\phi$ $\phi$ $\mathbf{a}$ ![2_image_0.png](2_image_0.png) Figure 2: Feature pathways of the neurashed model in Figure 1. Firing nodes are marked in red. Class 1 includes two types of samples with slightly different feature pathways, which is a reflection of heterogeneity in real-life data (Feldman, 2020). where the sum is over all dependent nodes f of F in the lower level. Likewise, let SF = 0 for any non-firing middle-level node F. For the last-level nodes F1*, . . . , F*K corresponding to the K classes, let $$Z_{j}=\sum_{f\to F_{j}}\eta_{f F_{j}}S_{f}\tag{1}$$ $$(1)$$ be the logit for the jth class, where the sum is over all second-last-level dependent nodes f of Fj . Finally, we predict the probability that this input is in the jth class as $$p_{j}(x)={\frac{\exp(Z_{j})}{\sum_{i=1}^{K}\exp(Z_{i})}}.$$ To mimic the iterative characteristic of neural network training, we must be able to update the amplification factors for neurashed during training. At initialization, because there is no predictive ability as such for neurashed, we set λF and ηfF to zero, other constants, or random numbers. In each backpropagation, a node is firing if it is in the *union* of the feature pathways of all training samples in the mini-batch for computing the gradient. We increase the amplification ability of any firing node. Specifically, if a node F is firing in the backpropagation, we update its amplification factor λF by letting $$\lambda_{F}\gets g^{+}(\lambda_{F}),$$ where g + is an increasing function satisfying g +(x) > x for all x ≥ 0. The simplest choices include g +(x) = ax for a > 1 and g +(x) = x + c for c > 0. The strengthening of firing feature pathways is consistent with a recent analysis of simple hierarchical models (Poggio et al., 2020; Allen-Zhu & Li, 2020). By contrast, for any node F that is not firing in the backpropagation, we decrease its amplification factor by setting $$\lambda_{F}\leftarrow$$ $\uparrow$). ## Λf ← G −(Λf ) for an increasing function g − satisfying 0 ≤ g −(x) ≤ x; for example, g −(x) = bx for some 0 < b ≤ 1. This recognizes regularization techniques such as weight decay, batch normalization (Ioffe & Szegedy, 2015), layer normalization (Ba et al., 2016), and dropout (Srivastava et al., 2014) in deep-learning training, which effectively impose certain constraints on the weight parameters (Fang et al., 2021). Update rules g +, g− generally vary with respect to nodes and iteration number. Likewise, we apply rule g + to ηfF when the connected second-last-level node f and last-level node F both fire; otherwise, g − is applied. The training dynamics above could improve neurashed's predictive ability. In particular, the update rules allow nodes appearing frequently in feature pathways to quickly grow their amplification factors. Consequently, for an input x belonging to the jth class, the amplification factors of most nodes in its feature become relatively large during training, and the true-class logit Zj also becomes much larger than the other logits Zi for i ̸= j. This shows that the probability of predicting the correct class pj (x) → 1 as the number of iterations tends to infinity. The modeling strategy of neurashed is similar to a water*shed*, where tributaries meet to form a larger stream (hence "neura*shed*"). This modeling strategy gives neurashed the innate characteristics of a hierarchical structure and iterative optimization. As a caveat, we do not regard the feature representation of neurashed as fixed. Although the graph is fixed, the evolving amplification factors represent features in a dynamic manner. Note that neurashed is different from capsule networks (Sabour et al., 2017) and GLOM (Hinton, 2021) in that our model is meant to shed light on the black box of deep learning, not serve as a working system. ## 3 Insights Into Puzzles Implicit regularization. Conventional wisdom from statistical learning theory suggests that a model may not perform well on test data if its parameters outnumber the training samples; to avoid overfitting, explicit regularization is needed to constrain the search space of the unknown parameters (Friedman et al., 2001). In contrast to other machine learning approaches, modern neural networks—where the number of learnable parameters is often orders of magnitude larger than that of the training samples—enjoy surprisingly good generalization even *without* explicit regularization (Zhang et al., 2021a). From an optimization viewpoint, this shows that simple stochastic gradient-based optimization for training neural networks implicitly induces a form of regularization biased toward local minima of low "complexity" (Soudry et al., 2018; Bartlett et al., 2020). However, it remains unclear how implicit regularization occurs from a geometric perspective (Nagarajan & Kolter, 2019; Razin & Cohen, 2020; Zhou, 2021). To gain geometric insights into implicit regularization using our conceptual model, recall that only firing features grow during neurashed training, whereas the remaining features become weaker during backpropagation. For simplicity, consider stochastic gradient descent with a mini-batch size of 1. Here, only *common* features shared by samples from different classes constantly fire in neurashed, whereas features peculiar to some samples or certain classes fire less frequently. As a consequence, these common features become stronger more quickly, whereas the other features grow less rapidly or even diminish. ![3_image_0.png](3_image_0.png) Figure 3: Part of neurashed that corresponds to a single class. The two top plots in the left panel show two feature pathways, and the top plot in the right panel denotes the firing pattern when both feature pathways are included in the batch (the last-level node is firing but is not marked in red for simplicity). The two bottom plots represent the learned neurashed models, where larger nodes indicate larger amplification factors. When gradient descent or large-batch stochastic gradient descent are used, many features fire in each update of neurashed, thereby increasing their amplification factors simultaneously. By contrast, a small-batch method constructs the feature pathways in a sparing way. Consequently, the feature pathways learned using small batches are *sparser*, suggesting a form of *compression*. This comparison is illustrated in Figure 3, which implies that different samples from the same class tend to exhibit vanishing variability in their highlevel features during later training, and is consistent with the recently observed phenomenon of neural collapse (Papyan et al., 2020). Intuitively, this connection is indicative of neurashed's compressive nature. Although neurashed's geometric characterization of implicit regularization is currently a hypothesis, much supporting evidence has been reported, empirically and theoretically. Empirical studies in Keskar et al. (2016); Smith et al. (2020) showed that neural networks trained by small-batch methods generalize better than when trained by large-batch methods. Moreover, Ilyas et al. (2019); Xiao et al. (2021) showed that neural networks tend to be more accurate on test data if these models leverage less information of the images. From a theoretical angle, HaoChen et al. (2020) related generalization performance to a solution's sparsity level when a simple nonlinear model is trained using stochastic gradient descent. Information bottleneck. In Tishby & Zaslavsky (2015); Shwartz-Ziv & Tishby (2017), the information bottleneck theory of deep learning was introduced, based on the observation that neural networks undergo an initial fitting phase followed by a compression phase. In the initial phase, neural networks seek to both memorize the input data and fit the labels, as manifested by the increase in mutual information between a hidden level and both the input and labels. In the second phase, the networks compress all irrelevant information from the input, as demonstrated by the decrease in mutual information between the hidden level and input. ![4_image_0.png](4_image_0.png) Figure 4: A neurashed model for a binary classification problem. All four firing patterns of Class 1 on the first level (from left to right): (1, 2, 7),(2, 3, 7),(4, 5, 7),(5, 6, 7). In the second level, the first and third nodes fire if one or more dependent nodes fire, and the second (dominant) node fires if two or more dependent nodes fire. The left panel displays a feature pathway of Class 1. Class 2 has four feature pathways that are symmetric to those of Class 1. The right panel shows the information bottleneck phenomenon for this neurashed model. As with Shwartz-Ziv & Tishby (2017), noise is added in calculating the mutual information (MI) between the first/second level and the input (8 types)/labels (2 types). More details are given in the appendix. Instead of explaining how this mysterious phenomenon emerges in deep learning, which is beyond our scope, we shed some light on information bottleneck by producing the same phenomenon using neurashed. As with implicit regularization, we observe that neurashed usually contains many redundant feature pathways when learning class labels. Initially, many nodes grow and thus encode more information regarding both the input and class labels. Subsequently, more frequently firing nodes become more dominant than less frequently firing ones. Because nodes compete to grow their amplification factors, dominant nodes tend to dwarf their weaker counterparts after a sufficient amount of training. Hence, neurashed starts to "forget" the information encoded by the weaker nodes, thereby sharing less mutual information with the input samples (see an illustration in Figure 4). The *compressive* characteristic of neurashed arises, loosely speaking, from the internal competition among nodes. This interpretation of the information bottleneck via neurashed is reminiscent of the human brain, which has many neuron synapses during childhood that are pruned to leave fewer firing connections in adulthood (Feinberg, 1982). Local elasticity. Last, we consider a recently observed phenomenon termed local elasticity (He & Su, 2020) in deep learning training, which asks how the update of neural networks via backpropagation at a base input changes the prediction at a test sample. Formally, for K-class classification, let z1(x, w), . . . , zK(*x, w*) be the logits prior to the softmax operation with input x and network weights w. Writing w + for the updated weights using the base input x, we define $$\operatorname{LE}(x,x^{\prime}):={\frac{\sqrt{\sum_{i=1}^{K}(z_{i}(x^{\prime},w^{+})-z_{i}(x^{\prime},w))^{2}}}{\sqrt{\sum_{i=1}^{K}(z_{i}(x,w^{+})-z_{i}(x,w))^{2}}}}$$ as a measure of the impact of base x on test x ′. A large value of this measure indicates that the base has a significant impact on the test input. Through extensive experiments, He & Su (2020) demonstrated that well-trained neural networks are locally elastic in the sense that the value of this measure depends on the semantic similarity between two samples x and x ′. If they are similar—say, images of a cat and tiger—the impact is significant, and if they are dissimilar—say, images of a cat and turtle—the impact is low. Experimental results are shown in Figure 5. For comparison, local elasticity does not appear in linear classifiers because of the leverage effect. More recently, Chen et al. (2020); Deng et al. (2021); Zhang et al. (2021b) showed that local elasticity implies good generalization ability. ![5_image_0.png](5_image_0.png) Figure 5: Histograms of LE(*x, x*′) evaluated on the pre-trained VGG-19 network (Simonyan & Zisserman, 2014). For example, in the left panel the base input x are images of brown bears. Each class contains 120 images sampled from ImageNet (Deng et al., 2009). Tiger and leopard are felines and similar. We now show that neurashed exhibits the phenomenon of local elasticity, which yields insights into how local elasticity emerges in deep learning. To see this, note that similar training samples share more of their feature pathways. For example, the two types of samples in Class 1 in Figure 2 are presumably very similar and indeed have about the same feature pathways; Class 1 and Class 2 are more similar to each other than Class 1 and Class 3 in terms of feature pathways. Metaphorically speaking, applying backpropagation at an image of a leopard, the feature pathway for leopard strengthens as the associated amplification factors increase. While this update also strengthens the feature pathway for tiger, it does not impact the brown bear feature pathway as much, which presumably overlaps less with the leopard feature pathway. This update in turn leads to a more significant change in the logits equation 1 of an image of a tiger than those of a brown bear. Returning to Figure 2 for an illustration of this interpretation, the impact of updating at a sample in Class 1a is most significant on Class 1b, less significant on Class 2, and unnoticeable on Class 3. ## 4 Outlook In addition to shedding new light on implicit regularization, information bottleneck, and local elasticity, neurashed is likely to facilitate insights into other common empirical patterns of deep learning. First, a byproduct of our interpretation of implicit regularization might evidence a subnetwork with comparable performance to the original, which could have implications on the lottery ticket hypothesis of neural networks (Frankle & Carbin, 2018). Second, while a significant fraction of classes in ImageNet (Deng et al., 2009) have fewer than 500 training samples, deep neural networks perform well on these classes in tests. Neurashed could offer a new perspective on these seemingly conflicting observations—many classes are basically the same (for example, ImageNet contains 120 dog-breed classes), so the effective sample size for learning the common features is much larger than the size of an individual class. Last, neurashed might help reveal the benefit of data augmentation techniques such as cropping. In the language of neurashed, cat head and cat tail each are sufficient to identify cat. If both concepts appear in the image, cropping reinforces the neurashed model by impelling it to learn these concepts separately. Nevertheless, these views are preliminary and require future consolidation. While closely resembling neural networks in many aspects, neurashed is not merely intended to better explain some phenomena in deep learning. Instead, our main goal is to offer insights into the development of a comprehensive theoretical foundation for deep learning in future research. In particular, neurashed's efficacy in interpreting many puzzles in deep learning could imply that neural networks and neurashed evolve similarly during training. We therefore believe that a comprehensive deep learning theory is unlikely without incorporating the hierarchical, *iterative*, and *compressive* characteristics. That said, useful insights can be derived from analyzing models without these characteristics in some specific settings (Jacot et al., 2018; Chizat et al., 2019; Wu et al., 2018; Mei et al., 2018; Chizat & Bach, 2018; Belkin et al., 2019; Lee et al., 2019; Xu et al., 2019; Oymak & Soltanolkotabi, 2020; Chan et al., 2021). Integrating the three characteristics in a principled manner might necessitate a novel mathematical framework for reasoning about the composition of nonlinear functions. Because it could take years before such mathematical tools become available, a practical approach for the present, given that such theoretical guidelines are urgently needed (E, 2021), is to better relate neurashed to neural networks and develop finer-grained models. For example, an important question is to determine the unit in neural networks that corresponds with a feature node in neurashed. Is it a filter in the case of convolutional neural networks? Another topic is the relationship between neuron activations in neural networks and feature pathways in neurashed. To generalize neurashed, edges could be fired instead of nodes. Another potential extension is to introduce stochasticity to rules g + and g − for updating amplification factors and rendering feature pathways random or adaptive to learned amplification factors. Owing to the flexibility of neurashed as a graphical model, such possible extensions are endless. ## References Zeyuan Allen-Zhu and Yuanzhi Li. Backward feature correction: How deep learning performs deep learning. arXiv preprint arXiv:2001.04413, 2020. Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. Andrey A Bagrov, Ilia A Iakovlev, Askar A Iliasov, Mikhail I Katsnelson, and Vladimir V Mazurenko. Multiscale structural complexity of natural patterns. *Proceedings of the National Academy of Sciences*, 117(48):30241–30251, 2020. Peter L Bartlett, Dylan J Foster, and Matus Telgarsky. Spectrally-normalized margin bounds for neural networks. In *Advances in Neural Information Processing Systems*, pp. 6241–6250, 2017. Peter L Bartlett, Philip M Long, Gábor Lugosi, and Alexander Tsigler. Benign overfitting in linear regression. Proceedings of the National Academy of Sciences, 117(48):30063–30070, 2020. Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machine-learning practice and the classical bias–variance trade-off. *Proceedings of the National Academy of Sciences*, 116(32):15849– 15854, 2019. Julius Berner, Philipp Grohs, Gitta Kutyniok, and Philipp Petersen. The modern mathematics of deep learning. *arXiv preprint arXiv:2105.04026*, 2021. Avrim L Blum and Ronald L Rivest. Training a 3-node neural network is NP-complete. *Neural Networks*, 5 (1):117–127, 1992. Kwan Ho Ryan Chan, Yaodong Yu, Chong You, Haozhi Qi, John Wright, and Yi Ma. ReduNet: A white-box deep network from the principle of maximizing rate reduction. *arXiv preprint arXiv:2105.10446*, 2021. Shuxiao Chen, Hangfeng He, and Weijie J Su. Label-aware neural tangent kernel: Toward better generalization and local elasticity. In *Advances in Neural Information Processing Systems*, volume 33, pp. 15847–15858, 2020. Lénaïc Chizat and Francis Bach. On the global convergence of gradient descent for over-parameterized models using optimal transport. In *Advances in Neural Information Processing Systems*, pp. 3040–3050, 2018. Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. In Advances in Neural Information Processing Systems, 2019. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In *2009 IEEE Conference on Computer Vision and Pattern Recognition*, pp. 248–255. IEEE Computer Society, 2009. Zhun Deng, Hangfeng He, and Weijie J Su. Toward better generalization bounds with locally elastic stability. In *International Conference on Machine Learning*, 2021. Weinan E. The dawning of a new era in applied mathematics. *Notices of the American Mathematical Society*, 68(4):565–571, 2021. Ronen Eldan and Ohad Shamir. The power of depth for feedforward neural networks. In *Conference on* Learning Theory, pp. 907–940. PMLR, 2016. Cong Fang, Hangfeng He, Qi Long, and Weijie J Su. Exploring deep neural networks via layer-peeled model: Minority collapse in imbalanced training. *Proceedings of the National Academy of Sciences*, 2021. Irwin Feinberg. Schizophrenia: caused by a fault in programmed synaptic elimination during adolescence? Journal of Psychiatric Research, 17(4):319–334, 1982. Vitaly Feldman. Does learning require memorization? a short tale about a long tail. In *Symposium on* Theory of Computing, pp. 954–959, 2020. Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In *International Conference on Learning Representations*, 2018. Jerome Friedman, Trevor Hastie, and Robert Tibshirani. *The elements of statistical learning*, volume 1. Springer Series in Statistics New York, 2001. Sebastian Goldt, Marc Mézard, Florent Krzakala, and Lenka Zdeborová. Modeling the influence of data structure on learning in neural networks: The hidden manifold model. *Physical Review X*, 10(4):041044, 2020. Jeff Z HaoChen, Colin Wei, Jason D Lee, and Tengyu Ma. Shape matters: Understanding the implicit bias of the noise covariance. *arXiv preprint arXiv:2006.08680*, 2020. Hangfeng He and Weijie J Su. The local elasticity of neural networks. In International Conference on Learning Representations, 2020. Geoffrey Hinton. How to represent part-whole hierarchies in a neural network. *arXiv preprint* arXiv:2102.12627, 2021. Andrew Ilyas, Shibani Santurkar, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. *Advances in Neural Information Processing Systems*, 32, 2019. Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In *International Conference on Machine Learning*, pp. 448–456. PMLR, 2015. Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: convergence and generalization in neural networks. In *Advances in Neural Information Processing Systems*, pp. 8580–8589, 2018. Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. *arXiv preprint* arXiv:1609.04836, 2016. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. *Communications of the ACM*, 60(6):84–90, 2017. Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. *Nature*, 521(7553):436–444, 2015. Jaehoon Lee, Lechao Xiao, Samuel S Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. arXiv preprint arXiv:1902.06720, 2019. Song Mei, Andrea Montanari, and Phan-Minh Nguyen. A mean field view of the landscape of two-layer neural networks. *Proceedings of the National Academy of Sciences*, 115(33):E7665–E7671, 2018. Vaishnavh Nagarajan and J. Zico Kolter. Uniform convergence may be unable to explain generalization in deep learning. In *Advances in Neural Information Processing Systems*, volume 32, 2019. Samet Oymak and Mahdi Soltanolkotabi. Towards moderate overparameterization: global convergence guarantees for training shallow neural networks. *IEEE Journal on Selected Areas in Information Theory*, 2020. Vardan Papyan, XY Han, and David L Donoho. Prevalence of neural collapse during the terminal phase of deep learning training. *Proceedings of the National Academy of Sciences*, 117(40):24652–24663, 2020. Tomaso Poggio, Andrzej Banburski, and Qianli Liao. Theoretical issues in deep networks. Proceedings of the National Academy of Sciences, 117(48):30039–30045, 2020. Noam Razin and Nadav Cohen. Implicit regularization in deep learning may not be explainable by norms. Advances in Neural Information Processing Systems, 33, 2020. Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. In *Advances in* Neural Information Processing Systems, volume 31, pp. 3859–3869, 2017. Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017. David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. *Nature*, 529(7587):484–489, 2016. Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. Samuel Smith, Erich Elsen, and Soham De. On the generalization benefit of noise in stochastic gradient descent. In *International Conference on Machine Learning*, pp. 9058–9067. PMLR, 2020. Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. *The Journal of Machine Learning Research*, 19(1):2822–2878, 2018. Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. *The Journal of Machine Learning Research*, 15 (1):1929–1958, 2014. Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In 2015 IEEE Information Theory Workshop (ITW), pp. 1–5. IEEE, 2015. Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, and Alexey Dosovitskiy. MlP-mixer: An all-MLP architecture for vision. *arXiv preprint arXiv:2105.01601*, 2021. Lei Wu, Chao Ma, and Weinan E. How SGD selects the global minima in over-parameterized learning: A dynamical stability perspective. In *Advances in Neural Information Processing Systems*, pp. 8289–8298, 2018. Kai Xiao, Logan Engstrom, Andrew Ilyas, and Aleksander Madry. Noise or signal: The role of image backgrounds in object recognition. In *International Conference on Learning Representations*, 2021. Zhi-Qin John Xu, Yaoyu Zhang, and Yanyang Xiao. Training behavior of deep neural network in frequency domain. In *International Conference on Neural Information Processing*, pp. 264–274. Springer, 2019. Lenka Zdeborová. Understanding deep learning is also a job for physicists. *Nature Physics*, 16(6):602–604, 2020. Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning (still) requires rethinking generalization. *Communications of the ACM*, 64(3):107–115, 2021a. Jiayao Zhang, Hua Wang, and Weijie J Su. Imitating deep learning dynamics via locally elastic stochastic differential equations. In *Advances in Neural Information Processing Systems*, volume 34, 2021b. Zhi-Hua Zhou. Why over-parameterization of deep neural networks does not overfit? *Science China Information Sciences*, 64(1):1–3, 2021. ## Appendix All eight feature pathways of the neurashed model in Figure 4. The left column and right column correspond to Class 1 and Class 2, respectively. In the experimental setup of the right panel of Figure 4, all amplification factors at initialization are set to independent uniform random variables on (0, 0.01). We use g −(λF ) = 1.022− 14 λF and g +(λF ) = 1.022 11 4 λF for all hidden nodes except for the 7th (from left to right) node, which uses g +(λF ) = 1.022 34 λF . In the early phase of training, the firing pattern on the second level improves at distinguishing the two types of samples in Class 1, depending on whether the 1st or 3rd node fires. This also applies to Class 2. Hence, the mutual information between the second level and the input tends to log2 4 = 2. By contrast, in the late stages, the amplification factors of the 1st and 3rd nodes become negligible compared with that of the 2nd node, leading to indistinguishability between the two types in Class 1. As a consequence, the mutual information tends to log2 2 = 1. The discussion on the first level is similar and thus is omitted. ![10_image_1.png](10_image_1.png) ![10_image_0.png](10_image_0.png)
Review 1: Summary: This paper proposes a new model for deep learning, termed the _neurashed_. This model shares some important features of neural networks, in particular their hierarchical structure, and can be trained via an iterative procedure that resembles stochastic gradient descent. The paper goes on to replicate three phenomena observed in deep learning in the neurashed model through thought experiments and empirical simulations: implicit regularization towards “simple” functions, compression of the learned representation over time, and _local elasticity_. Strengths and Weaknesses: **Strengths** - There is scientific value in replicating phenomena of interest that appear in deep neural networks in other models of learning in order to better understand the necessary conditions for these phenomena. - The paper provides a number of visualizations that clarify structure and behaviour of the neurashed model, which I thought were particularly nicely presented. - The neurashed model captures a number of properties of neural networks that intiuitively seem to be important distinguishing factors from other machine learning systems, while allowing other features — in particular the optimization procedure — to vary. This is an appealing setup as it could also allow for further study into the role of gradient descent algorithms and the loss landscapes of neural network architectures separately from other properties of NNs, e.g. their hierarchical structure. - Figure 4 presents a compelling illustration that the neurashed model can replicate a relatively sophisticated property of neural network training, providing supporting evidence for its scientific utility. - The paper is for the most part clearly written (modulo some of my comments about the presentation of the neurashed model that follow), and effectively communicates its objective and conclusion. - The paper is ambitious in providing a new model of learning which, while sharing some important features with deep neural networks, follows significantly different learning dynamics. As a field, I think it is important that we consider a more diverse set of possible models of learning than solely neural networks trained with SGD-like optimizers, and this paper presents a preliminary but nonetheless intriguing step towards this diversification. **Weaknesses**: - Some details of the neurashed model remain unclear to me, and should be addressed in the main text of the paper: - The text describing the updating procedure for the neurashed is quite long, and the clarity of the paper would be improved by including a short pseudocode algorithm summarizing how the updates are performed. - The notion of ‘feature’ expressed by the nodes is unclear, as is the rule for determining whether a node is firing or not. On p2 there are two examples provided: one in which the activation function is an OR (the cat head/tail) and one in which it appears to be an AND (the panda head). The equation on the bottom of page 2, however, seems to be a continuous value which sums the incoming feature activations. This isn’t consistent with the logical activation functions discussed in the preceding paragraphs. - The neurashed update procedure features a number of design choices whose motivation is not discussed. This procedure resembles Hebbian learning, but I didn’t see any discussion of how this model relates to older models of learning which also use non-gradient update rules. The paper would benefit significantly from a discussion of related work and of the motivation behind the learning rule. - The neurashed model is proposed with the objective of providing a simplifying set of assumptions through which theorists can study deep learning. This is an admirable goal, however it isn’t clear to me that, for an equal level of expressiveness, a neurashed would be any more tractable than a neural network. The examples provided in the paper consider sparse, narrow, and shallow architectures for which neural network behaviour would also be relatively tractable to analyze. However, scaling up this model to have similar expressive power as a large neural network would be computationally expensive, and I imagine would also make theoretical analysis difficult. A large part of the utility of a phenomenological model of deep learning lies in its simplicity, and so this strikes me as one of the major weaknesses of the neurashed. - An additional weakness of the neurashed model is that while it has been shown to replicate some phenomena of deep learning, it is not straightforward to deduce that these phenomena occur for the same reasons in the neurashed as they do in a deep neural network. The neurashed varies along a number of dimensions from a standard deep learning pipeline, and it’s possible that some of these sources of variation could serve as confounding factors. As a result, observing e.g. information compression curves in a neurashed does not necessarily immediately give us additional insight into the information bottleneck phenomenon in neural networks. - While the neurashed model presents a new framework to think about hierarchical learning algorithms, the paper does not provide empirical or theoretical evidence that this model is capable of learning on even synthetic tasks. Details on the practical implementation of this model are also missing. Figure 4 seems to point towards the neurashed changing in some meaningful way over the course of training, but the paper would benefit significantly from an evaluation of the model’s performance on these tasks as well. - The analysis of implicit regularization and local elasticity are relatively weak compared to that of the information bottleneck results. In the case fo implicit regularization, the mechanism by which the neurashed features are strengthened seems very different to what occurs in neural networks, and there is no empirical or theoretical analysis quantifying the degree of implicit regularization in the neurashed. The use of geometric in this context also doesn’t make sense to me, as in the setting of deep neural networks it generally refers to the structure of the loss landscape, which doesn’t have a straightforward analogue in a neurashed as it is not trained via gradient descent. Similarly, the replication of local elasticity is justified by an intuitive argument, but not quantified empirically. Requested Changes: **Writing and clarity.** A critical point that needs to be addressed before I can recommend acceptance is to clarify the precise formulation of the neurashed activation function and how it is trained. This is crucial for any paper which proposes a new learning algorithm, even if this algorithm is only intended as a phenomenological model of deep learning. - The clarity of the paper would be improved by including a short pseudocode algorithm summarizing how the updates are performed. - The relation to prior work on discrete learning rules, in particular Hebbian learning, should be discussed. - The rule for determining whether an intermediate node is turned on or off needs to be clarified. - Additional experiment details should be included in the supplementary materials. **Theory.** - The paper does not currently demonstrate that the neurashed is more amenable to theoretical analysis than the neural network. Providing an example where this is the case, in a manner more rigorous than the thought experiments in Section 3, would significantly strengthen the claim that the neurashed can provide insight into deep neural networks. - Some analysis of the dynamics of the model showing that the update rule is a contraction or that it is guaranteed to reduce the objective would increase my confidence that the neurashed is a useful model of learning. Intuitively it seems like this should be the case depending on finding a suitable “learning rate”, but I would like to see this shown more rigorously. - At minimum, I would need to see at least a few examples of learning problems where the neurashed is able to learn a function that minimizes its training loss in order to be convinced that the neurashed is a reasonable model for learning. **Experiments.** - Additional experiment details are needed to describe how Figure 4 is generated. - For both implicit regularization and local elasticity, the paper should demonstrate that these phenomena arise naturally from the learning dynamics of the neurashed to justify the claim that the neurashed model can provide insight into them. Broader Impact Concerns: I do not have any broader impact concerns. ================================================== Review 2: Summary: The main contribution of the paper is the Neurashed framework. As argued, Neurashed, encoded three important factors of deep learning: hierarchical, iterative, and compressive characteristics. There are many frontier phenomena in deep learning explained by the Neurashed framework (mainly in section 3). Strengths and Weaknesses: A beauty, at least from my point of view, is the simplicity of the Neurashed framework. Moreover, it's structure is also intuitive to understand. Basically, Neurashed explores representation relation and models mutual influences between representation nodes. Regarding weaknesses, I mainly have the following questions. 1. (Structural difference between Neurashed and a true neural networks). I am in fact curious about how a Neurashed can be constructed. In particular, how to determine nodes, how to choose the number of layers and the width. In the end, is it much different from a neural network it self? For example, we can evaluate the fire pattern of a well trained neural network. Does it correspond to any Neurashed construction? 2. (Future direction suggested by Neurashed) As introduced, Neurashed are proposed for future deep learning theory. From reading the paper, Neurashed is a good tool to explain (also not certain how to develop serious theory using Neurashed though) many interesting and controversial phenomena in practical deep learning. However, not much is discussed of Neurashed for future deep learning theory. Is it possible for Neurashed to suggest future deep learning directions? For example, how to train better? how to effectively choose network configurations, etc? Requested Changes: I would very much appreciate any discussions to the questions in the previous weakness section. Overall, the paper is clearly written with very minor typos. Broader Impact Concerns: The reviewer does not foresee any ethical concerns of the current manuscript. ================================================== Review 3: Summary: The paper introduces a simplified model of a neural network model with units sending and receiving real scalar values and iteratively updating linear parameters. Authors argue that it is useful for studying implicit regularization, local elasticity and information compression found in real neural networks. Overall, I find this paper very confusing and not particularly insightful for "a future theory of deep learning". Strengths and Weaknesses: # Strenghts: * The idea of studying phenomena arising in neural networks using a simpler model makes sense to me. # Weaknesses: ## Unclear connection between neural networks and neurasheds From the sentence "The number of levels is the same as the number of layers of the neural network that neurashed imitates." it follows that a neural network induces a corresponding neurashed. If that's true, then I would appreciate such a mapping to be explicitly discussed. Especially in the sense of what insightful properties of the originan neural network are preserved by the neurashed and why. ## Why this model and this learning algorithm? > In each backpropagation, a node is firing if it is in the union of the feature pathways of all training samples in the mini-batch for computing the gradient * It's unclear what happens during the "forward pass" of the model, when does a node fire (if it happens just on a single object, i.e. batch size is 1)? It's impossible to reason about the model because the very first two equation involve this concept. In other words, the presentation of the method is confusing. * Calling this algorithm "backpropagation" is very confusing becuase it has very little in common with computing gradients / derivatives or the authors should explain that. * Why use this learning algorithm? It seems to be unnecessarily tied to the number of objects in the batch (see the quoted text), I strongly believe the learning dynamics for different batch sizes and sampling strategies will differ singnificantly and in undesired way. ## Experiments are not presented clearly and difficult to reproduce I failed at understanding how once can reproduce the presented experiments if they wanted to. I don't understand how were the neurasheds constructed for these experiments. Requested Changes: 1. Present a very clear mathematical definition of a neurashaed. 2. Motivate the simpliciations, discuss relation of neurashed and neural networks. In which sense one speak for another? 3. Motivate the learning algorithm, discuss its properties in comparison to the standard backpropagation / gradient descent. 4. Make experiments fully reproducible. 5. Demonstrate that existing work is less efficient at studying the discussed phenomena than the presented work. Broader Impact Concerns: No concerns ================================================== Metareview: Recommendation: Reject Comment: [see the claims and evidence above for a summary] ==================================================
# Diffusion Model-Augmented Behavioral Cloning Anonymous authors Paper under double-blind review ## Abstract Imitation learning addresses the challenge of learning by observing an expert's demonstrations without access to reward signals from environments. Most existing imitation learning methods that do not require interacting with environments either model the expert distribution as the conditional probability p(a|s) (e.g., behavioral cloning, BC) or the joint probability p(*s, a*). Despite the simplicity of modeling the conditional probability with BC, it usually struggles with generalization. While modeling the joint probability can improve generalization performance, the inference procedure is often time-consuming, and the model can suffer from manifold overfitting. This work proposes an imitation learning framework that benefits from modeling both the conditional and joint probability of the expert distribution. Our proposed diffusion model-augmented behavioral cloning (DBC) employs a diffusion model trained to model expert behaviors and learns a policy to optimize both the BC loss (conditional) and our proposed diffusion model loss (joint). DBC outperforms baselines in various continuous control tasks in navigation, robot arm manipulation, dexterous manipulation, and locomotion. We design additional experiments to verify the limitations of modeling either the conditional probability or the joint probability of the expert distribution, as well as compare different generative models. Ablation studies justify the effectiveness of our design choices. ## 1 Introduction Recently, the success of deep reinforcement learning (DRL) (Mnih et al., 2015; Lillicrap et al., 2016; Arulkumaran et al., 2017) has inspired the research community to develop DRL frameworks to control robots, aiming to automate the process of designing sensing, planning, and control algorithms by letting the robot learn in an end-to-end fashion. Yet, acquiring complex skills through trial and error can still lead to undesired behaviors even with sophisticated reward design (Christiano et al., 2017; Leike et al., 2018; Lee et al., 2019). Moreover, the exploring process could damage expensive robotic platforms or even be dangerous to humans (Garcıa & Fernández, 2015; Levine et al., 2020). To overcome this issue, imitation learning (i.e., learning from demonstration) (Schaal, 1997; Osa et al., 2018) has received growing attention, whose aim is to learn a policy from expert demonstrations, which are often more accessible than appropriate reward functions for reinforcement learning. Among various imitation learning directions, adversarial imitation learning (Ho & Ermon, 2016; Zolna et al., 2021; Kostrikov et al., 2019) and inverse reinforcement learning (Ng & Russell, 2000; Abbeel & Ng, 2004) have achieved encouraging results in a variety of domains. Yet, these methods require interacting with environments, which can still be expensive or even dangerous. On the other hand, behavioral cloning (BC) (Pomerleau, 1989; Bain & Sammut, 1995) does not require interacting with environments. BC formulates imitation learning as a supervised learning problem - given an expert demonstration dataset, an agent policy takes states sampled from the dataset as input and learns to replicate the corresponding expert actions. One can view a BC policy as a discriminative model p(a|s) that models the *conditional probability* of actions a given a state s. Due to its simplicity and training stability, BC has been widely adopted for various applications. However, BC struggles at generalizing to states unobserved during training (Nguyen et al., 2023). To alleviate the generalization issue, we propose to augment BC by modeling the joint probability p(*s, a*) of expert state-action pairs with a generative model (e.g., diffusion models). This approach is motivated by Bishop & Nasrabadi (2006) and Fisch et al. (2013), who illustrate that modeling joint probability allows for better generalizing to data points unobserved during training. However, with a learned joint probability model p(*s, a*), retrieving a desired action a requires actions sampling and optimization (i.e., arg max a∈A p(*s, a*)), which can be extremely inefficient with a large action space. Moreover, modeling joint probabilities can suffer from manifold overfitting (Wu et al., 2021; Loaiza-Ganem et al., 2022) when observed high-dimensional data lies on a low-dimensional manifold (e.g., state-action pairs collected from a script expert policies). This work proposes an imitation learning framework that combines both the efficiency and stability of modeling the *conditional probability* and the generalization ability of modeling the *joint probability*. Specifically, we propose to model the expert state-action pairs using a state-of-the-art generative model, a diffusion model, which learns to estimate how likely a state-action pair is sampled from the expert dataset. Then, we train a policy to optimize both the BC objective and the learning signals the trained diffusion model produces. Therefore, our proposed framework not only can efficiently predict actions given states via capturing the conditional probability p(a|s) but also enjoys the generalization ability induced by modeling the *joint probability* p(*s, a*) and utilizing it to guide policy learning. We evaluate our proposed framework and baselines in various continuous control domains, including navigation, robot arm manipulation, and locomotion. The experimental results show that the proposed framework outperforms all the baselines or achieves competitive performance on all tasks. Extensive ablation studies compare our proposed method to its variants, justifying our design choices, such as different generative models, and investigating the effect of hyperparameters. ## 2 Related Work Imitation learning addresses the challenge of learning by observing expert demonstrations without access to reward signals from environments. It has various applications such as robotics (Schaal, 1997; Zhao et al., 2023), autonomous driving (Ly & Akhloufi, 2020), and game AI (Harmer et al., 2018). Behavioral Cloning (BC). BC (Pomerleau, 1989; Torabi et al., 2018) formulates imitating an expert as a supervised learning problem. Due to its simplicity and effectiveness, it has been widely adopted in various domains. Yet, it often struggles at generalizing to states unobserved from the expert demonstrations (Ross et al., 2011; Florence et al., 2022). Some approaches prevent the agent from navigating to states that deviate from the expert demonstrations by mitigating compounding error (Ross et al., 2011; Zhao et al., 2023). However, the problem of generalization still exists even when the compounding errors are alleviated. In this work, we improve the generalization ability of policies by augmenting BC with a diffusion model that learns to capture the joint probability of expert state-action pairs. Adversarial Imitation Learning (AIL). AIL methods aim to match the state-action distributions of an agent and an expert via adversarial training. Generative adversarial imitation learning (GAIL) (Ho & Ermon, 2016) and its extensions (Torabi et al., 2019; Kostrikov et al., 2019; Zolna et al., 2021; Jena et al., 2021) resemble the idea of generative adversarial networks (Goodfellow et al., 2014), which trains a generator policy to imitate expert behaviors and a discriminator to distinguish between the expert and the learner's state-action pair distributions. While modeling state-action distributions often leads to satisfactory performance, adversarial learning can be unstable and inefficient (Chen et al., 2020). Moreover, even though scholars like Jena et al. (2021) propose to improve the efficiency of GAIL with the BC loss, they still require online interaction with environments, which can be costly or even dangerous. In contrast, our work does not require interacting with environments. Inverse Reinforcement Learning (IRL). IRL methods (Ng & Russell, 2000; Abbeel & Ng, 2004; Fu et al., 2018; Lee et al., 2021) are designed to infer the reward function that underlies the expert demonstrations and then learn a policy using the inferred reward function. This allows for learning tasks whose reward functions are difficult to specify manually. However, due to its double-loop learning procedure, IRL methods are typically computationally expensive and time-consuming. Additionally, obtaining accurate estimates of the expert's reward function can be difficult, especially when the expert's behavior is non-deterministic or when the expert's demonstrations are sub-optimal. Diffusion Policies. Recently, Pearce et al. (2023); Chi et al. (2023); Reuss et al. (2023) propose to represent and learn an imitation learning policy using a conditional diffusion model, which produces a predicted action conditioning on a state and a sampled noise vector. These methods achieve encouraging results in modeling stochastic and multimodal behaviors from human experts or play data. In contrast, instead of representing a policy using a diffusion model, our work employs a diffusion model trained on expert demonstrations to guide a policy as a learning objective. ## 3 Preliminaries 3.1 Imitation Learning In contrast to reinforcement learning, whose goal is to learn a policy π based on rewards received while interacting with the environment, imitation learning methods aim to learn the policy from an expert demonstration dataset containing M trajectories, D = {τ1*, ..., τ*M}, where τi represents a sequence of ni state-action pairs {s i 1 , ai1 , ..., sini , aini }. ## 3.1.1 Modeling Conditional Probability P(A|S) To learn a policy π, behavioral cloning (BC) directly estimates the expert policy π E with maximum likelihood estimation (MLE). Given a state-action pair (*s, a*) sampled from the dataset D, BC optimizes max θ P (s,a)∈D log(πθ(a|s)), where θ denotes the parameters of the policy π. One can view a BC policy as a discriminative model p(a|s), capturing the *conditional probability* of an action a given a state s. On the other hand, Implicit BC (Florence et al., 2022; Ganapathi et al., 2022) propose to model the conditional probability with InfoNCE-style (Oord et al., 2018) optimization. Despite their success in various applications, BC-based methods tend to overfit and struggle at generalizing to states unseen during training (Ross et al., 2011; Codevilla et al., 2019; Wang et al., 2022). ## 3.1.2 Modeling Joint Probability P(S, A) Explicit generative models, such as energy-based models (Du & Mordatch, 2019; Song & Kingma, 2021), variational autoencoder (Kingma & Welling, 2014), and flow-based models (Rezende & Mohamed, 2015; Dinh et al., 2017), aim to model the joint probability p(*s, a*) of the expert dataset, and therefore yield improved generalization performance, as illustrated in Bishop & Nasrabadi (2006); Fisch et al. (2013). However, these methods can be extremely inefficient in retrieving actions with a large action space during inference since sampling and optimizing actions (i.e., arg maxa∈A p(*s, a*)) are required. Moreover, they are known to struggle with modeling observed high-dimensional data that lies on a low-dimensional manifold (i.e., manifold overfitting) (Wu et al., 2021; Loaiza-Ganem et al., 2022). As a result, these methods often perform poorly when learning from demonstrations produced by script policies or PID controllers, as discussed in Section 5.4. We aim to develop an imitation learning framework that enjoys the advantages of modeling the conditional probability p(a|s) and the joint probability p(*s, a*). Specifically, we propose to model the *joint probability* of expert state-action pairs using an explicit generative model ϕ, which learns to produce an estimate indicating how likely a state-action pair is sampled from the expert dataset. Then, we train a policy to model the conditional probability p(a|s) by optimizing the BC objective and the estimate produced by the learned generative model ϕ. Hence, our method can efficiently predict actions given states, generalize better to unseen states, and suffer less from manifold overfitting. ## 3.2 Diffusion Models As described in the previous sections, this work aims to combine the advantages of modeling the *conditional* probability p(a|s) and the joint probability p(*s, a*). Hence, we leverage diffusion models to model the joint probability of expert state-action pairs. The diffusion model is a recently developed class of generative models and has achieved state-of-the-art performance on various tasks (Sohl-Dickstein et al., 2015; Nichol & Dhariwal, 2021; Dhariwal & Nichol, 2021; Ko et al., 2023). In this work, we utilize Denoising Diffusion Probabilistic Models (DDPMs) (J Ho, 2020) to model expert stateaction pairs. Specifically, DDPM models gradually add noise to data samples (i.e., concatenated state-action pairs) until they become isotropic Gaussian (*forward* diffusion process), and then learn to denoise each step and restore the original data samples (reverse diffusion process), as illustrated in Figure 1. In other words, DDPM learns to recognize a data distribution by learning to denoise noisy sampled data. More discussion on the relationship between diffusion models and the data distribution can be found in Section I. ## 4 Approach ![3_image_0.png](3_image_0.png) Figure 1: **Denoising Diffusion Probabilistic** Model (DDPM). Latent variables x1*, ..., x*N are produced from the data point x0 via the forward diffusion process, i.e., gradually adding noises to the latent variables. The diffusion model ϕ learns to reverse the diffusion process by denoising the noisy data to reconstruct the original data point x0. Our goal is to design an imitation learning framework that enjoys both the advantages of modeling the conditional probability and the *joint probability* of expert behaviors. To this end, we first adopt behavioral cloning (BC) for modeling the *conditional probability* from expert state-action pairs, as described in Section 4.1. To capture the *joint probability* of expert state-action pairs, we employ a diffusion model that learns to produce an estimate indicating how likely a state-action pair is sampled from the expert state-action pair distribution, as presented in Section 4.2.1. Then, we propose to guide the policy learning by optimizing this estimate provided by a learned diffusion model, encouraging the policy to produce actions similar to expert actions, as discussed in Section 4.2.2. Finally, in Section 4.3, we introduce the framework that combines the BC loss and our proposed diffusion model loss, allowing for learning a policy that benefits from modeling both the *conditional probability* and the *joint probability* of expert behaviors. An overview of our proposed framework is illustrated in Figure 2, and the algorithm is detailed in Section 4.4. ## 4.1 Behavioral Cloning Loss The behavioral cloning (BC) model aims to imitate expert behaviors with supervision learning. BC learns to capture the conditional probability p(a|s) of expert state-action pairs. A BC policy π(a|s) learns by optimizing LBC = E(s,a)∼D,aˆ∼π(s)[d(a, aˆ)], (1) $${\mathcal{L}}_{\mathrm{BC}}=\mathbb{E}_{(s,a)\sim D,{\hat{a}}\sim\pi(s)}[d(a,{\hat{a}})],$$ ff ff where d(·, ·) denotes a distance measure between a pair of actions. For example, we can adopt the mean-square error (MSE) loss ||a − aˆ||2for most continuous control tasks. ## 4.2 Learning A Diffusion Model And Guiding Policy Learning Instead of directly learning the conditional probability p(a|s), this section discusses how to model the joint probability p(*s, a*) of expert behaviors with a diffusion model in Section 4.2.1 and presents how to leverage the learned diffusion model to guide policy learning in Section 4.2.2. ## 4.2.1 Learning A Diffusion Model We propose to model the joint probability of expert state-action pairs with a diffusion model ϕ. Specifically, we create a joint distribution by simply concatenating a state vector s and an action vector a from a state-action pair (*s, a*). To model such distribution by learning a denoising diffusion probabilistic model (DDPM) (J Ho, 2020), we inject noise ϵ(n) into sampled state-action pairs, where n indicates the number of steps of the Markov procedure, which can be viewed as a variable of the level of noise, and the total number of steps is $$(1)$$ ![4_image_0.png](4_image_0.png) (a) Learning a Diffusion Model (b) Learning a Policy with the Learned Diffusion Model ff ff Figure 2: **Diffusion Model-Augmented Behavioral Cloning.** Our proposed method DBC augments behavioral cloning (BC) by employing a diffusion model. (a) **Learning a Diffusion Model**: the diffusion model ϕ learns to model the distribution of concatenated state-action pairs sampled from the demonstration dataset D. It learns to reverse the diffusion process (i.e., denoise) by optimizing Ldiff in Eq. 2. (b) Learning a Policy with the Learned Diffusion Model: we propose a diffusion model objective LDM for policy learning and jointly optimize it with the BC objective LBC. Specifically, LDM is computed based on processing a sampled state-action pair (*s, a*) and a state-action pair (s, aˆ) with the action aˆ predicted by the policy π with Ldiff. notated as N. Then, we train the diffusion model ϕ to predict the injected noises by optimizing $$\mathcal{L}_{\text{diff}}(s,a,\phi)=\mathbb{E}_{n\sim N_{s}(s,a)\sim D}\left[\left|\left|\epsilon(s,a,n)-\epsilon(n)\right|\right|^{2}\right]=\mathbb{E}_{n\sim N_{s}(s,a)\sim D}\left[\left|\left|\phi(s,a,\epsilon(n))-\epsilon(n)\right|\right|^{2}\right],\tag{2}$$ where ϵˆ is the noise predicted by the diffusion model ϕ. Once optimized, the diffusion model can *recognize* the expert distribution by perfectly predicting the noise injected into state-action pairs sampled from the expert distribution. On the other hand, predicting the noise injected into state-action pairs sampled from any other distribution should yield a higher loss value. Therefore, we propose to view Ldiff(*s, a, ϕ*) as an estimate of how well the state-action pair (*s, a*) fits the expert distribution that ϕ learns from and serve this estimate as a learning signal for the policy learning. ## 4.2.2 Learning A Policy With Diffusion Model Loss A diffusion model ϕ trained on an expert dataset can produce an estimate Ldiff(*s, a, ϕ*) indicating how well a state-action pair (*s, a*) fits the expert distribution. We propose to leverage this signal to guide a policy π predicting actions aˆ to imitate the expert. Specifically, the policy π learns by optimizing $${\mathcal{L}}_{\mathrm{diff}}^{\mathrm{agent}}={\mathcal{L}}_{\mathrm{diff}}(s,{\hat{a}},\phi)={\mathbb{E}}_{s\sim D,{\hat{a}}\sim\pi(s)}\left[\left|\left|\ell(s,{\hat{a}},n)-\epsilon\right|\right|^{2}\right].\tag{1}$$ Intuitively, the policy π learns to predict actions aˆ that are indistinguishable from the expert actions a for the diffusion model conditioning on the same set of states. We hypothesize that learning a policy to optimize Eq. 3 can be unstable, especially for state-action pairs that are not well-modeled by the diffusion model, which yield a high value of Ldiff even with expert state-action pairs. Therefore, we propose to normalize the agent diffusion loss L agent diff with an expert diffusion loss L expert diff , which can be computed with expert state-action pairs (*s, a*) as follows: $${\mathcal{L}}_{\mathrm{diff}}^{\mathrm{expert}}={\mathcal{L}}_{\mathrm{diff}}(s,a,\phi)=\mathbb{E}_{(s,a)\sim D}\left[\left|\left|{\hat{\epsilon}}(s,a,n)-\epsilon\right|\right|^{2}\right].$$ h||ϵˆ(*s, a, n*) − ϵ||2i. (4) $$\left({\mathfrak{3}}\right)$$ $$|\rangle$$ We propose to optimize the diffusion model loss LDM for the policy based on calculating the difference between the above agent and expert diffusion losses: $${\mathcal{L}}_{\mathrm{DM}}=\mathbb{E}_{(s,a)\sim D,{\hat{a}}\sim\pi(s)}\left[m a x\left({\mathcal{L}}_{\mathrm{diff}}^{\mathrm{agent}}-{\mathcal{L}}_{\mathrm{diff}}^{\mathrm{expert}},0\right)\right].$$ i . (5) ## 4.3 Combining The Two Objectives Our goal is to learn a policy that benefits from both modeling the conditional probability and the joint probability of expert behaviors. To this end, we propose to augment a BC policy, which optimizes the BC loss LBC in Eq. 1, by combining LBC with the proposed diffusion model loss LDM in Eq. 5. By optimizing them together, we encourage the policy to predict actions that fit the expert joint probability captured by diffusion models. To learn from both the BC loss and the diffusion model loss, we train the policy to optimize $\left(\underset{0}{5}\right)$. $${\mathcal{L}}_{\mathrm{total}}={\mathcal{L}}_{\mathrm{BC}}+\lambda{\mathcal{L}}_{\mathrm{DM}},$$ $$\left(6\right)$$ Ltotal = LBC + λLDM, (6) ![5_image_0.png](5_image_0.png) where λ is a coefficient that determines the importance of the diffusion model loss relative to the BC loss. We notice that when the learned policy is optimal, i.e., π = π E, both objectives converge to 0 despite that LBC models the conditional probability while LDM models the joint probability. Therefore, we examine the roles of the above two objectives during the training procedure. As Figure 3 shown, we train three policies on Maze environment with LBC , LDM, and both objectives. The derived policies are referred to πBC , πDM, and πDBC , respectively. We observe that while optimizing one loss can also reduce the other loss to some extent (πBC and πDM), optimizing the combination leads to favorable convergence for both objectives (πDBC ). Therefore, considering both objectives, that is, considering both the conditional and the joint probability, is beneficial for policy learning and leads the learned policy π closer to the optimal one π E. The above observation is also supported by the quantitative results presented in both Table 1 and Table 3 in the subsequent section. Further discussions on combining these two losses can be found in Section A. (a) Training Progress of LBC (b) Training Progress of LDM Figure 3: Compatibility of LBC and LDM. We report the training progress of three policies πBC , πDM, and πDBC that are updated with LBC, LDM, and both objectives, respectively. Our proposed method can effectively optimize both LBC and LDM, demonstrating the compatibility of the two losses. ## 4.4 Algorithm Our proposed framework DBC is detailed in Algorithm 1. The algorithm consists of two parts. (1) **Learning** a diffusion model: The diffusion model ϕ learns to model the distribution of concatenated state-action pairs sampled from the demonstration dataset D. It learns to reverse the diffusion process (i.e., denoise) by optimizing Ldiff. (2) **Learning a policy with the learned diffusion model**: We propose a diffusion model objective LDM for policy learning and jointly optimize it with the BC objective LBC. Specifically, LDM is computed based on processing a sampled state-action pair (*s, a*) and a state-action pair (s, aˆ) with the action aˆ predicted by the policy π with Ldiff. Algorithm 1 Diffusion Model-Augmented Behavioral Cloning (DBC) Input: Expert's Demonstration Dataset D Output: Policy π. 1: // Learning a diffusion model ϕ 2: Randomly initialize a diffusion model ϕ 3: for each diffusion model iteration do 4: Sample (*s, a*) from D 5: Sample noise level n from {0*, ..., N*} 6: Update ϕ using Ldiff from Eq. 2 7: **end for** 8: // Learning a policy π with the learned diffusion model ϕ 9: Randomly initialize a policy π 10: for each policy iteration do 11: Sample (*s, a*) from D 12: Predict an action aˆ using π from s: aˆ ∼ π(s) 13: Compute the BC loss LBC using Eq. 1 14: Sample noise level n from {0*, ..., N*} 15: Compute the agent diffusion loss L agent diff with (s, aˆ) using Eq. 3 16: Compute the expert diffusion loss L expert diff with (*s, a*) using Eq. 4 17: Compute the diffusion model loss LDM using Eq. 5 18: Update π using the total loss Ltotal from Eq. 6 19: **end for** 20: **return** π ## 5 Experiments We design experiments in various continuous control domains, including navigation, robot arm manipulation, dexterous manipulation, and locomotion, to compare our proposed framework (DBC) to its variants and baselines. ## 5.1 Experimental Setup This section describes the environments, tasks, and expert demonstrations used for learning and evaluation. More details can be found in Section D. Navigation. To evaluate our method on a navigation task, we choose Maze, a maze environment proposed in Fu et al. (2020) (maze2d-medium-v2), as illustrated in Figure 4a. This task features a point-mass agent in a 2D maze learning to navigate from its start location to a goal location by iteratively predicting its x and y acceleration. The agent's beginning and final locations are chosen randomly. We collect 100 demonstrations with 18,525 transitions using a controller. Robot Arm Manipulation. We evaluate our method in FetchPick, a robot arm manipulation domain with a 7-DoF Fetch task, as illustrated in Figure 4b. FetchPick requires picking up an object from the table and lifting it to a target location. We use the demonstrations, consisting of 10k transitions (303 trajectories), provided by Lee et al. (2021) for these tasks. Dexterous Manipulation. In HandRotate, we further evaluate our method on a challenging environment proposed in Plappert et al. (2018), where a 24-DoF Shadow Dexterous Hand learns to in-hand rotate a block to a target orientation, as illustrated in Figure 4c. This environment has a state space (68D) and action space (20D), which is high dimensional compared to the commonly-used environments in IL. We collected 10k transitions (515 trajectories) from a SAC (Haarnoja et al., 2018) expert policy trained for 10M environment steps. Locomotion. For locomotion, we leverage the Cheetah and Walker (Brockman et al., 2016) environments. Both Cheetah and Walker require a bipedal agent (with different structures) to travel as fast as possible ![7_image_0.png](7_image_0.png) Figure 4: **Environments & Tasks. (a) Maze**: A point-mass agent (green) in a 2D maze learns to navigate from its start location to a goal location (red). **(b) FetchPick**: The robot arm manipulation tasks employ a 7-DoF Fetch robotics arm to pick up an object (yellow cube) from the table and move it to a target location (red). **(c) HandRotate**: This dexterous manipulation task requires a Shadow Dexterous Hand to in-hand rotate a block to a target orientation. **(d)-(e) Cheetah and Walker**: These locomotion tasks require learning agents to walk as fast as possible while maintaining their balance. **(f) AntReach**: This task combines locomotion and navigation, instructing an ant robot with four legs to reach a goal location while maintaining balance. while maintaining its balance, as illustrated in Figure 4d and Figure 4e, respectively. We use the demonstrations provided by Kostrikov (2018), which contains 5 trajectories with 5k state-action pairs for both the Cheetah and Walker environments. Locomotion + Navigation. We further explore our method on the challenging AntReach environment. In the environment, the quadruped ant aims to reach a randomly generated target located along the boundary of a semicircle centered around the ant, as illustrated in Figure 4f. AntReach environment combines the properties of locomotion and goal-directed navigation tasks, which require robot controlling and path planning to reach the goal. We use the demonstrations provided by Lee et al. (2021), which contains 500 trajectories with 25k state-action pairs in AntReach. ## 5.2 Baselines This work focuses on imitation learning problem *without* environment interactions. Therefore, approaches that require environmental interactions, such as GAIL-based methods, are not applicable. Instead, we extensively compared our proposed method to state-of-the-art imitation learning methods that do not require interaction with the environment, including Implicit BC (Florence et al., 2022) and Diffusion Policy (Chi et al., 2023; Reuss et al., 2023). - BC learns to imitate an expert by modeling the conditional probability p(a|s) of the expert behaviors via optimizing the BC loss LBC in Eq. 1. - **Implicit BC (IBC)** (Florence et al., 2022) models expert state-action pairs with an energy-based model. For inference, we implement the derivative-free optimization algorithm proposed in IBC, which samples actions iteratively and select the desired action according to the predicted energies. - **Diffusion policy** refers to the methods that learn a conditional diffusion model as a policy (Chi et al., 2023; Reuss et al., 2023). Specifically, we implement this baseline based on Pearce et al. (2023). We include this baseline to analyze the effectiveness of using diffusion models as a policy or as a learning objective (ours). ## 5.3 Experimental Results We report the experimental results in terms of success rate (Maze, FetchPick, HandRotate, and AntReach), and return (Cheetah and Walker) in Table 1. The details of model architecture can be found in Section E. Training and evaluation details can be found in Section F. Additional analysis and experimental results can be found in Section 5.5 and Section H. | Method | Maze | FetchPick | HandRotate | Cheetah | Walker | AntReach | |------------------|--------------|--------------|--------------|----------------|----------------|--------------| | BC | 92.1% ± 3.6% | 91.6% ± 5.8% | 57.5% ± 4.7% | 4873.3 ± 69.7 | 6954.4 ± 73.5 | 56.2% ± 4.9% | | Implicit BC | 78.3% ± 6.0% | 69.4% ± 7.3% | 13.8% ± 3.7% | 1563.6 ± 486.8 | 839.8 ± 104.2 | 23.7% ± 4.9% | | Diffusion Policy | 95.5% ± 1.9% | 83.9% ± 3.4% | 61.7% ± 4.1% | 4650.3 ± 59.9 | 6479.1 ± 238.6 | 61.8% ± 4.0% | | DBC (Ours) | 95.4% ± 1.7% | 97.5% ± 1.9% | 60.1% ± 4.4% | 4909.5 ± 73.0 | 7034.6 ± 33.7 | 70.1% ± 4.9% | Table 1: **Experimental Result.** We report the mean and the standard deviation of success rate (Maze, FetchPick, HandRotate, AntReach) and return (Cheetah, Walker), evaluated over three random seeds. Our proposed method (DBC) outperforms or performs competitively against the best baseline over all environments. Overall Task Performance. In navigation (Maze) and manipulation (FetchPick and HandRotate) tasks, our DBC performs competitively, i.e., within a standard deviation, against the Diffusion Policy and outperforms the other baselines. We hypothesize that these tasks require the agent to learn from demonstrations with various behaviors. Diffusion policy has shown promising performance for capturing multi-modality distribution, while our DBC can also generalize well with the guidance of the diffusion models, so both methods achieve satisfactory results. In locomotion tasks, i.e., Cheetah and Walker, our DBC outperforms Diffusion Policy and performs competitively against the simple BC baseline. We hypothesize that this is because locomotion tasks with sufficient expert demonstrations and little randomness do not require generalization during inference. The agent can simply follow the closed-loop progress of the expert demonstrations, resulting in both BC and DBC performing similarly to the expert demonstrations. On the other hand, the Diffusion Policy is designed for modeling multimodal behaviors and therefore, performs inferior results on single-mode locomotion tasks. For AntReach task, which combines locomotion and navigation, our method outperforms all the baselines. In summary, our proposed DBC is able to perform superior results across all tasks, which verifies the effectiveness of combining conditional and joint distribution modeling. Inference Efficiency. To evaluate the inference efficiency, we measure and report the number of evaluation episodes per second (↑) for Implicit BC (9.92), Diffusion Policy (1.38), and DBC (**30.79**) on an NVIDIA RTX 3080 Ti GPU in Maze. As a results of modeling the conditional probability p(a|s), DBC and BC can directly map states to actions during inference. In contrast, Implicit BC samples and optimizes actions, while Diffusion Policy iteratively denoises sampled noises, which are both time-consuming. This verifies the efficiency of modeling the conditional probability. Action Space Dimension. The Implicit BC baseline requires time-consuming action sampling and optimization during inference, and such a procedure may not scale well to high-dimensional action spaces. Our Implicit BC baseline with a derivative-free optimizer struggles in Cheetah, Walker, and HandRotate environments, whose action dimensions are 6, 6, and 20, respectively. This is consistent with Florence et al. (2022), which reports that the optimizer failed to solve tasks with an action dimension larger than 5. In contrast, our proposed DBC can handle high-dimensional action spaces. ## 5.4 Comparing Modeling Conditional Probability And Joint Probability This section aims to empirically identify the limitations of modeling *either* the conditional or the joint probability in an open maze environment implemented with Fu et al. (2020). Generalization. We aim to investigate if learning from the BC loss alone struggles at generalization (*conditional*) and examine if guiding the policy using the diffusion model loss yields improved generalization ability (*joint*). We collect trajectories of a PPO policy learning to navigate from (5, 3) to goals sampled around (1, 2) and (1, 4) (green) on a 5 × 5 map, as shown in Figure 5a. Given these expert trajectories, we learn a policy πBC to optimize Eq. 1 and another policy πDM to optimize Eq. 5. Then, we evaluate the two policies by sampling goals around (1, 1), (1, 3), and (1, 5) (red), which are unseen during training and require the ability to generalize. Visualized trajectories of the two policies in Figure 5a show that πBC (orange) fails ![9_image_0.png](9_image_0.png) Figure 5: **Comparing Modeling Conditional Probability and Joint Probability. (a) Generalization.** We collect expert trajectories from a PPO policy learning to navigate to goals sampled from the green regions. Then, we learn a policy πBC to optimize LBC, and another policy πDM to optimize LDM with a diffusion model trained on the expert distribution. We evaluate the two policies by sampling goals from the red regions, which requires the ability to generalize. πBC (orange) struggles at generalizing to unseen goals, whereas πDM (blue) can generalize (i.e., extrapolate) to some extent. **(b)-(c) Manifold overfitting.** We collect the green spiral trajectories from a script policy, whose actions are visualized as red crosses. We then train and evaluate πBC and πDM. The trajectories of πBC (orange) can closely follow the expert trajectories (green), while the trajectories of πDM (blue) deviates from expert's. This is because the diffusion model struggles at modeling such expert action distribution with a lower intrinsic dimension, which can be observed from incorrectly predicted actions (blue dots) produced by the diffusion model. to generalize to unseen goals, whereas πDM (blue) can generalize (i.e., extrapolate) to some extent. This verifies our motivation to augment BC with the diffusion model loss. Manifold overfitting. We aim to examine if modeling the joint probability is difficult when observed high-dimensional data lies on a low-dimensional manifold (i.e., manifold overfitting). We collect trajectories from a script policy that executes actions (0.5, 0), (0, 0.5), (−0.7, 0), and (0, −0.7) (red crosses in Figure 5b), each for 40 consecutive time steps, resulting the green spiral trajectories visualized in Figure 5c. Given these expert demonstrations, we learn a policy πBC to optimize Eq. 1, and another policy πDM to optimize Eq. 5 with a diffusion model trained on the expert distribution. Figure 5b shows that the diffusion model struggles at modeling such expert action distribution with a lower intrinsic dimension. As a result, Figure 5c show that the trajectories of πDM (blue) deviates from the expert trajectories (green) as the diffusion model cannot provide effective loss. On the other hand, the trajectories of πBC (orange) are able to closely follow the expert's and result in a superior success rate. This verifies our motivation to complement modeling the joint probability with modeling the conditional probability (i.e., BC). ## 5.5 Generalization Experiments In Fetchpick This section further investigates the generalization capabilities of the policies learned by our proposed framework and the baselines. To this end, we evaluate the policies by injecting different noise levels to both the initial state and goal location in FetchPick. Specifically, we parameterize the noise by scaling the 2D sampling regions for the block and goal locations in both environments. We expect all the methods to perform worse with higher noise levels, while the performance drop of the methods with better generalization ability is less significant. In this experiment, we set the coefficient λ of DBC to 0.1 in FetchPick. The results are presented in Table 2 for FetchPick. Overall Performance. Our proposed framework DBC consistently outperforms all the baselines with different noise levels, indicating the superiority of DBC when different levels of generalization are required. Table 2: **Generalization Experiments in FetchPick**. We report the performance of our proposed framework DBC and the baselines regarding the mean and the standard deviation of the success rate with different levels of noise injected into the initial state and goal locations in FetchPick, evaluated over three random seeds. | Method | Noise Level | | | | | |------------------|---------------|--------------|--------------|--------------|--------------| | | 1 | 1.25 | 1.5 | 1.75 | 2 | | BC | 92.4% ± 8.5% | 91.6% ± 5.8% | 85.5% ± 6.3% | 77.6% ± 7.1% | 67.4% ± 8.2% | | Implicit BC | 83.1% ± 3.1% | 69.4% ± 7.3% | 51.6% ± 4.2% | 36.5% ± 4.7% | 23.6% ± 3.0% | | Diffusion Policy | 90.0% ± 3.5% | 83.9% ± 3.4% | 72.3% ± 6.8% | 64.1% ± 7.1% | 58.2% ± 8.2% | | DBC (Ours) | 99.5% ± 0.5% | 97.5% ± 1.9% | 91.5% ± 3.3% | 83.3% ± 4.8% | 73.5% ± 6.8% | Performance Drop with Increased Noise Level. In FetchPick, DBC experiences a performance drop of 26.1% when the noise level increase from 1 to 2. However, BC and Implicit BC demonstrate a performance drop of 27.0% and 71.6%, respectively. Notably, Diffusion Policy initially performs poorly at a noise level of 1 but demonstrates its robustness with a performance drop of only 35.3% when the noise level increases to 2. This demonstrates that our proposed framework not only generalizes better but also exhibits greater robustness to noise compared to the baselines. ## 5.6 Comparing Different Generative Models Our proposed framework employs a diffusion model (DM) to model the joint probability of expert state-action pairs and utilizes it to guide policy learning. To justify our choice, we explore using other popular generative models to replace the diffusion model in Maze. We consider energy-based models (EBMs) (Du & Mordatch, 2019; Song & Kingma, 2021), variational autoencoder (VAEs) (Kingma & Welling, 2014), and generative adversarial networks (GANs) (Goodfellow et al., 2014). Each generative model learns to model expert state-action pairs. To guide policy learning, given a predicted state-action pair (s, aˆ) we use the estimated energy of an EBM, the reconstruction error of a VAE, and the discriminator output of a GAN to optimize a policy with or without the BC loss. Table 3 compares using different generative models to model the expert distribution and guide policy learning. All the generative model-guide policies can be improved by adding the BC loss, justifying our motivation to complement modeling the joint probability with modeling the conditional probability. With or without the BC loss, the diffusion model-guided policy achieves the best performance compared to other generative models. Specifically, DM outperforms the second-best baseline GAN by 24.8% improvement without BC and by 2.4% with BC, which verifies our choice of the generative model. Training details of learning the generative models and how to utilize them to guide policy learning can be found in Section F.4. We also report the results on FetchPick in Section G.1 ## 5.7 Ablation Study 5.7.1 Effect Of The Diffusion Model Loss Coefficient Λ We examine the impact of varying the coefficient of the diffusion model loss λ in Eq. 6 in FetchPick. The result presented in Figure 6 shows that λ = 0.5 yields the best performance of 97.5%. A higher or lower λ leads to worse performance. For instance, when λ is 0 (only BC), the success rate is 91.7%, and the performance drops to 51.46% when λ is 10. This result demonstrates that modeling the conditional probability (LBC) and the joint probability (LDM) can complement each other. ## 5.7.2 Effect Of The Normalization Term We aim to investigate whether normalizing the diffusion model loss LDM with the expert diffusion model loss L expert diff yields improved performance. We train a variant of DBC where only L agent diff in Eq. 3 instead of LDM in Eq. 5 is used to augment BC. For instance, the unnormalized variant performs worse than DBC in the Maze environment, where the average success rate is 94% and 95%, respectively. This justifies the Table 3: **Comparing Generative Models** ![11_image_0.png](11_image_0.png) in Maze. We compare using different generative models to model the expert distribution and guide policy learning in Maze. With or without the BC loss, the diffusion model-guided policy achieves the best performance compared to other generative models. | Method | without BC | with BC | |----------|---------------|--------------| | BC | N/A | 92.1% ± 3.6% | | EBM | 20.3% ± 11.8% | 92.5% ± 3.0% | | VAE | 53.1% ± 8.7% | 92.7% ± 2.7% | | GAN | 54.8% ± 4.4% | 93.0% ± 3.5% | | DM | 79.6% ± 9.6% | 95.4% ± 1.7% | BC N/A 92.1% ± 3.6% EBM 20.3% ± 11.8% 92.5% ± 3.0% VAE 53.1% ± 8.7% 92.7% ± 2.7% GAN 54.8% ± 4.4% 93.0% ± 3.5% DM **79.6**% ± 9.6% **95.4**% ± 1.7% Figure 6: Effect of Coefficient λ for LDM. We experiment with different values of λ in FetchPick, each evaluated over three random seeds. effectiveness of the proposed normalization term L expert diff in LDM. We find consistent results in all of the environments except AntReach, and comprehensive results can be found in Table 9 of Section G.2 ## 6 Discussion We propose an imitation learning framework that benefits from modeling both the conditional probability p(a|s) and the joint probability p(*s, a*) of the expert distribution. Our proposed diffusion model-augmented behavioral cloning (DBC) employs a diffusion model trained to model expert behaviors and learns a policy to optimize both the BC loss and our proposed diffusion model loss. Specifically, the BC loss captures the conditional probability p(a|s) from expert state-action pairs, which directly guides the policy to replicate the expert's action. On the other hand, the diffusion model loss models the joint distribution of expert state-action pairs p(*s, a*), which provides an evaluation of how well the predicted action aligned with the expert distribution. DBC outperforms baselines or achieves competitive performance in various continuous control tasks in navigation, robot arm manipulation, dexterous manipulation, and locomotion. We design additional experiments to verify the limitations of modeling either the conditional probability or the joint probability of the expert distribution as well as compare different generative models. Ablation studies investigate the effect of hyperparameters and justify the effectiveness of our design choices. In terms of the limitations, our proposed framework, in its current form, is only designed to learn from expert trajectories without interacting with environments and cannot learn from trajectories produced by the learner policy. Extending our method to incorporate agent data can potentially allow for improvement when interacting environments are possible, which is left for future work. ## 7 Broader Impacts This work proposes Diffusion Model-Augmented Behavioral Cloning, a novel imitation learning framework that aims to increase the ability of autonomous learning agents (e.g., robots, game AI agents) to acquire skills by imitating demonstrations provided by experts (e.g., humans). However, it is crucial to acknowledge that our proposed framework, by design, inherits any biases exhibited by the expert demonstrators. These biases can manifest as sub-optimal, unsafe, or even discriminatory behaviors. To address this concern, ongoing research endeavors to mitigate bias and promote fairness in machine learning hold promise in alleviating these issues. Moreover, research works that enhance learning agents' ability to imitate experts, such as this work, can pose a threat to job security. Nevertheless, in sum, we firmly believe that our proposed framework can offer tremendous advantages in terms of enhancing the quality of human life and automating laborious, arduous, or perilous tasks that pose risks to humans, which far outweigh the challenges and potential issues. ## References Pieter Abbeel and Andrew Y Ng. Apprenticeship learning via inverse reinforcement learning. In *International* Conference on Machine Learning, 2004. Kai Arulkumaran, Marc Peter Deisenroth, Miles Brundage, and Anil Anthony Bharath. Deep reinforcement learning: A brief survey. *IEEE Signal Processing Magazine*, 2017. Michael Bain and Claude Sammut. A framework for behavioural cloning. In *Machine Intelligence 15*, 1995. Christopher M Bishop and Nasser M Nasrabadi. *Pattern recognition and machine learning*. Springer, 2006. Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016. Minshuo Chen, Yizhou Wang, Tianyi Liu, Zhuoran Yang, Xingguo Li, Zhaoran Wang, and Tuo Zhao. On computation and generalization of generative adversarial imitation learning. In International Conference on Learning Representations, 2020. Cheng Chi, Siyuan Feng, Yilun Du, Zhenjia Xu, Eric Cousineau, Benjamin Burchfiel, and Shuran Song. Diffusion policy: Visuomotor policy learning via action diffusion. In *Robotics: Science and Systems*, 2023. Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. In *Advances in Neural Information Processing Systems*, 2017. Felipe Codevilla, Eder Santana, Antonio M López, and Adrien Gaidon. Exploring the limitations of behavior cloning for autonomous driving. In *International Conference on Computer Vision*, 2019. Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. In Neural Information Processing Systems, 2021. Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. In *International* Conference on Learning Representations, 2017. Yilun Du and Igor Mordatch. Implicit generation and modeling with energy based models. In *Neural* Information Processing Systems, 2019. Ruili Feng, Deli Zhao, and Zheng-Jun Zha. Understanding noise injection in gans. In international conference on machine learning, pp. 3284–3293. PMLR, 2021. Dominik Fisch, Edgar Kalkowski, and Bernhard Sick. Knowledge fusion for probabilistic generative classifiers with data mining applications. *IEEE Transactions on Knowledge and Data Engineering*, 2013. Pete Florence, Corey Lynch, Andy Zeng, Oscar A Ramirez, Ayzaan Wahid, Laura Downs, Adrian Wong, Johnny Lee, Igor Mordatch, and Jonathan Tompson. Implicit behavioral cloning. In Conference on Robot Learning, 2022. Justin Fu, Katie Luo, and Sergey Levine. Learning robust rewards with adverserial inverse reinforcement learning. In *International Conference on Learning Representations*, 2018. Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning. *arXiv preprint arXiv:2004.07219*, 2020. Aditya Ganapathi, Pete Florence, Jake Varley, Kaylee Burns, Ken Goldberg, and Andy Zeng. Implicit kinematic policies: Unifying joint and cartesian action spaces in end-to-end robot learning. In International Conference on Robotics and Automation, 2022. Javier Garcıa and Fernando Fernández. A comprehensive survey on safe reinforcement learning. *Journal of* Machine Learning Research, 2015. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In *Advances in Neural Information Processing* Systems, 2014. Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In Proceedings of International Conference on Machine Learning, 2018. Jack Harmer, Linus Gisslén, Jorge del Val, Henrik Holst, Joakim Bergdahl, Tom Olsson, Kristoffer Sjöö, and Magnus Nordin. Imitation learning with concurrent actions in 3d games. In IEEE Conference on Computational Intelligence and Games, 2018. Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In *Advances in Neural Information* Processing Systems, 2016. A Jain J Ho. Denoising diffusion probabilistic models. In *Advances in Neural Information Processing Systems*, 2020. Rohit Jena, Changliu Liu, and Katia Sycara. Augmenting gail with bc for sample efficient imitation learning. In *Conference on Robot Learning*, pp. 80–90. PMLR, 2021. Liyiming Ke, Sanjiban Choudhury, Matt Barnes, Wen Sun, Gilwoo Lee, and Siddhartha Srinivasa. Imitation learning as f-divergence minimization. In International Workshop on the Algorithmic Foundations of Robotics, 2020. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of International Conference on Learning Representations, 2015. Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In *International Conference on* Learning Representations, 2014. Po-Chen Ko, Jiayuan Mao, Yilun Du, Shao-Hua Sun, and Joshua B. Tenenbaum. Learning to act from actionless videos through dense correspondences. *arXiv preprint arXiv:2310.08576*, 2023. Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https://github.com/ ikostrikov/pytorch-a2c-ppo-acktr-gail, 2018. Ilya Kostrikov, Kumar Krishna Agrawal, Debidatta Dwibedi, Sergey Levine, and Jonathan Tompson. Discriminator-actor-critic: Addressing sample inefficiency and reward bias in adversarial imitation learning. In *International Conference on Learning Representations*, 2019. Youngwoon Lee, Shao-Hua Sun, Sriram Somasundaram, Edward S. Hu, and Joseph J. Lim. Composing complex skills by learning transition policies. In *Proceedings of International Conference on Learning* Representations, 2019. Youngwoon Lee, Andrew Szot, Shao-Hua Sun, and Joseph J. Lim. Generalizable imitation learning from observation via inferring goal proximity. In *Neural Information Processing Systems*, 2021. Jan Leike, David Krueger, Tom Everitt, Miljan Martic, Vishal Maini, and Shane Legg. Scalable agent alignment via reward modeling: a research direction. *arXiv preprint arXiv:1811.07871*, 2018. Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. *arXiv preprint arXiv:2005.01643*, 2020. Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. In *International Conference on* Learning Representations, 2016. Gabriel Loaiza-Ganem, Brendan Leigh Ross, Jesse C Cresswell, and Anthony L Caterini. Diagnosing and fixing manifold overfitting in deep generative models. *Transactions on Machine Learning Research*, 2022. Calvin Luo. Understanding diffusion models: A unified perspective. *arXiv preprint arXiv:2208.11970*, 2022. Abdoulaye O Ly and Moulay Akhloufi. Learning to drive by imitation: An overview of deep behavior cloning methods. *IEEE Transactions on Intelligent Vehicles*, 2020. Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. *Nature*, 2015. Andrew Y. Ng and Stuart J. Russell. Algorithms for inverse reinforcement learning. In International Conference on Machine Learning, 2000. Tung Nguyen, Qinqing Zheng, and Aditya Grover. Reliable conditioning of behavioral cloning for offline reinforcement learning. *arXiv preprint arXiv:2210.05158*, 2023. Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, 2021. Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. Takayuki Osa, Joni Pajarinen, Gerhard Neumann, J Andrew Bagnell, Pieter Abbeel, Jan Peters, et al. An algorithmic perspective on imitation learning. Foundations and Trends® *in Robotics*, 2018. Tim Pearce, Tabish Rashid, Anssi Kanervisto, David Bignell, Mingfei Sun, Raluca Georgescu, Sergio Valcarcel Macua, Shan Zheng Tan, Ida Momennejad, Katja Hofmann, and Sam Devlin. Imitating human behaviour with diffusion models. In *International Conference on Learning Representations*, 2023. Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, et al. Multi-goal reinforcement learning: Challenging robotics environments and request for research. *arXiv preprint arXiv:1802.09464*, 2018. Dean A Pomerleau. Alvinn: An autonomous land vehicle in a neural network. In Advances in Neural Information Processing Systems, 1989. Vadim Popov, Ivan Vovk, Vladimir Gogoryan, Tasnima Sadekova, Mikhail Kudinov, and Jiansheng Wei. Diffusion-based voice conversion with fast maximum likelihood sampling scheme. In *International Conference* on Learning Representations, 2022. Moritz Reuss, Maximilian Li, Xiaogang Jia, and Rudolf Lioutikov. Goal conditioned imitation learning using score-based diffusion policies. In *Robotics: Science and Systems*, 2023. Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In *International* Conference on Machine Learning, 2015. Stéphane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In *International Conference on Artificial Intelligence and Statistics*, 2011. Stefan Schaal. Learning from demonstration. In *Advances in Neural Information Processing Systems*, 1997. Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In *International Conference on Machine Learning*, 2015. Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In Neural Information Processing Systems, 2019. Yang Song and Diederik P Kingma. How to train your energy-based models. *arXiv preprint arXiv:2101.03288*, 2021. Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021. Faraz Torabi, Garrett Warnell, and Peter Stone. Behavioral cloning from observation. In *International Joint* Conference on Artificial Intelligence, 2018. Faraz Torabi, Garrett Warnell, and Peter Stone. Generative adversarial imitation from observation. In International Conference on Machine Learning, 2019. Lingguang Wang, Carlos Fernandez, and Christoph Stiller. High-level decision making for automated highway driving via behavior cloning. *IEEE Transactions on Intelligent Vehicles*, 2022. Qitian Wu, Rui Gao, and Hongyuan Zha. Bridging explicit and implicit deep generative models via neural stein estimators. In *Neural Information Processing Systems*, 2021. Jin Xu, Zishan Li, Bowen Du, Miaomiao Zhang, and Jing Liu. Reluplex made more practical: Leaky relu. In IEEE Symposium on Computers and Communications, 2020. Tony Z Zhao, Vikash Kumar, Sergey Levine, and Chelsea Finn. Learning fine-grained bimanual manipulation with low-cost hardware. In *Robotics: Science and Systems*, 2023. Konrad Zolna, Scott Reed, Alexander Novikov, Sergio Gomez Colmenarejo, David Budden, Serkan Cabi, Misha Denil, Nando de Freitas, and Ziyu Wang. Task-relevant adversarial imitation learning. In *Conference* on Robot Learning, 2021.
# Simple Drop-In Lora Conditioning On Attention Layers Will Improve Your Diffusion Model Anonymous authors Paper under double-blind review ![0_image_0.png](0_image_0.png) Figure 1: The standard U-Net architecture for diffusion models conditions convolutional layers in residual blocks with scale-and-shift but does not condition attention blocks. Simply adding **LoRA** conditioning on attention layers improves the image generation quality. ## Abstract Current state-of-the-art diffusion models employ U-Net architectures containing convolutional and (qkv) self-attention layers. The U-Net processes images while being conditioned on the time embedding input for each sampling step and the class or caption embedding input corresponding to the desired conditional generation. Such conditioning involves scale-and-shift operations to the convolutional layers but does not directly affect the attention layers. While these standard architectural choices are certainly effective, not conditioning the attention layers feels arbitrary and potentially suboptimal. In this work, we show that simply adding LoRA conditioning to the attention layers without changing or tuning the other parts of the U-Net architecture improves the image generation quality. For example, a drop-in addition of LoRA conditioning to EDM diffusion model yields FID scores of 1.91/1.75 for unconditional and class-conditional CIFAR-10 generation, improving upon the baseline of 1.97/1.79. ## 1 Introduction In recent years, diffusion models have led to phenomenal advancements in image generation. Many cuttingedge diffusion models leverage U-Net architectures as their backbone, consisting of convolutional and (qkv) self-attention layers Dhariwal & Nichol (2021); Kim et al. (2023); Saharia et al. (2022); Rombach et al. (2022); Podell et al. (2024). In these models, the U-Net architecture-based score network is conditioned on the time, and/or, class, text embedding Ho & Salimans (2021) using scale-and-shift operations applied to the convolutional layers in the so-called residual blocks. Notably, however, the attention layers are not directly affected by the conditioning, and the rationale behind not extending conditioning to attention layers remains unclear. This gap suggests a need for in-depth studies searching for effective conditioning methods for attention layers and assessing their impact on performance. Meanwhile, low-rank adaptation (LoRA) has become the standard approach for parameter-efficient fine-tuning of large language models (LLM) Hu et al. (2022). With LoRA, one trains low-rank updates that are added to frozen pre-trained dense weights in the attention layers of LLMs. The consistent effectiveness of LoRA for | Dataset | Model | Type | NFE | # basis | rank | FID↓ | # Params | |----------------------|-----------|-----------|----------|-----------|-----------|----------|------------| | baseline | 4000 | - | - | 3.69 | 52546438 | | | | IDDPM | only LoRA | 4001 | 11 | 4 | 3.64 | 47591440 | | | with LoRA | 4001 | 11 | 4 | 3.37 | 54880528 | | | | CIFAR-10 (uncond.) | baseline | 35 | - | - | 1.97 | 55733891 | | | EDM (vp) | only LoRA | 35 | 18 | 4 | 1.99 | 53411675 | | | with LoRA | 35 | 18 | 4 | 1.96/1.91 | 57745499 | | | | baseline | 4000 | - | - | 3.38 | 52551558 | | | | IDDPM | only LoRA | 4001 | (11, 10) | 4 | 2.91 | 48513040 | | | with LoRA | 4001 | (11, 10) | 4 | 3.12 | 55807248 | | | | CIFAR-10 (cond.) | baseline | 35 | - | - | 1.79 | 55735299 | | | EDM (vp) | only LoRA | 35 | 18 | 4 | 1.82 | 53413083 | | | with LoRA | 35 | 18 | 4 | 1.75 | 57746907 | | | | baseline | 4000 | - | - | 19.2 | 121063942 | | | | ImageNet64 (uncond.) | IDDPM | only LoRA | 4001 | 11 | 4 | 18.2 | 113602960 | | with LoRA | 4001 | 11 | 4 | 18.1 | 139278224 | | | | baseline | 79 | - | - | 2.39 | 61805571 | | | | FFHQ64 (uncond.) | EDM (vp) | only LoRA | 79 | 20 | 4 | 2.46 | 58935795 | | with LoRA | 79 | 20 | 4 | 2.37/2.31 | 63941631 | | | Table 1: Image generation results. We compare three different conditionings for each setting: **(baseline)** conditioning only convolutional layers in residual blocks with scale-and-shift; **(only LoRA)** conditioning only attention layers using LoRA conditioning and not conditioning convolutional layers; **(with LoRA)** conditioning both convolutional layers and attention layers with scale-and-shift and LoRA conditioning, respectively. For unconditional CIFAR-10 and FFHQ64 sampling using EDM with LoRA, we also report the FID score obtained by initializing the base model with pre-trained weights. LLMs suggests that LoRA may be generally compatible with attention layers used in different architectures and for different tasks Chen et al. (2022); Pan et al. (2022); Lin et al. (2023); Gong et al. (2024). In this work, we introduce a novel method for effectively conditioning the attention layers in the U-Net architectures of diffusion models by jointly training multiple LoRA adapters along with the base model. We call these LoRA adapters TimeLoRA and ClassLoRA for discrete-time settings, and Unified Compositional LoRA (UC-LoRA) for continuous signal-to-ratio (SNR) settings. Simply adding these LoRA adapters in a drop-in fashion *without modifying or tuning the original model* brings consistent enhancement in FID scores across several popular models applied to CIFAR-10, FFHQ 64x64, and ImageNet datasets. In particular, adding LoRA-conditioning to the EDM model Karras et al. (2022) yields improved FID scores of 1.75, 1.91, 2.31 for class-conditional CIFAR-10, unconditional CIFAR-10, and FFHQ 64x64 datasets, respectively, outperforming the baseline scores of 1.79, 1.97, 2.39. Moreover, we find that LoRA conditioning by itself is powerful enough to perform effectively. Our experiments show that only conditioning the attention layers using LoRA adapters (without the conditioning convolutional layers with scale-and-shift) achieves comparable FID scores compared to the baseline scale-and-shift conditioning (without LoRA). Contribution. Our experiments show that using LoRA to condition time and class information on attention layers is effective across various models and datasets, including nano diffusion Lelarge et al. (2024), IDDPM Nichol & Dhariwal (2021), and EDM Karras et al. (2022) architectures using the MNIST Deng (2012), CIFAR-10 Krizhevsky et al. (2009), and FFHQ Karras et al. (2019) datasets. Our main contributions are as follows. (i) We show that simple drop-in LoRA conditioning on the attention layers improves the image generation quality, as measured by lower FID scores, while incurring minimal (∼10%) added memory and compute costs. (ii) We identify the problem of whether to and how to condition attention layers in diffusion models and provide the positive answer that attention layers should be conditioned and LoRA is an effective approach that outperforms the prior approaches of no conditioning or conditioning with adaLN Peebles & Xie (2023). ![2_image_0.png](2_image_0.png) Figure 2: Conditioning of U-Net Block: **(left)** scale-and-shift conditioning on the convolutional block **(middle)** LoRA conditioning on the attention block **(right)** top: TimeLoRA and ClassLoRA for the discrete-time setting, *bottom*: unified composition LoRA for the continuous-SNR setting. Our results advocate for incorporating LoRA conditioning into the larger state-of-the-art U-Net-based diffusion models and the newer experimental architectures. ## 2 Prior Work And Preliminaries 2.1 Diffusion Models Diffusion models Sohl-Dickstein et al. (2015); Song & Ermon (2019); Ho et al. (2020); Song et al. (2021b) generate images by iteratively removing noise from a noisy image. This denoising process is defined by the reverse process of the forward diffusion process: given data x0 ∼ q0, progressively inject noise to x0 by $$q(x_{t}\,|\,x_{t-1})={\mathcal{N}}\left({\sqrt{1-\beta_{t}}}x_{t-1},\beta_{t}\mathbf{I}\right)$$ for $t=1,\ldots,T$ and $0<\beta$ for t = 1*, . . . , T* and 0 < βt < 1. If βt is sufficiently small, we can approximate the reverse process as $\mathcal{N}\left(\mu_{\ell}\right)$ $$\operatorname{\mathsf{T}})$$ q(xt−1 | xt) ≈ N (µt(xt), βtI) where $$\mu_{t}(x_{t})=\frac{1}{\sqrt{1-\beta_{t}}}(x_{t}+\beta_{t}\nabla\log p_{t}(x_{t})).$$ A diffusion model is trained to approximate the *score function* ∇ log pt(xt) with a *score network* sθ, which is often modeled with a U-Net architecture Ronneberger et al. (2015); Song & Ermon (2019). With sθ ≈ ∇ log pt(xt), the diffusion model approximates the reverse process as $$p_{\theta}(x_{t-1}|x_{t})=\mathcal{N}\left(\frac{1}{\sqrt{1-\beta_{t}}}(x_{t}+\beta_{t}s_{\theta}(x_{t},t)),\beta_{t}\mathbf{I}\right)$$ $$\approx q(x_{t-1}\mid x_{t}).$$ To sample from a trained diffusion model, one starts with Gaussian noise xT ∼ N (0,(1 − α¯T )I), where α¯t =Qts=1(1−βs), and progressively denoise the image by sampling from pθ(xt−1|xt) with t = T, T −1*, . . . ,* 2, 1 sequentially to obtain a clean image x0. The above discrete-time description of diffusion models has a continuous-time counterpart based on the theory of stochastic differential equation (SDE) for the forward-corruption process and reversing it based on Anderson's reverse-time SDE Anderson (1982) or a reverse-time ordinary differential equation (ODE) with equivalent marginal probabilities Song et al. (2021a). Higher-order integrators have been used to reduce the discretization errors in solving the differential equations Karras et al. (2022). Architecture for diffusion models. The initial work of Song & Ermon (2019) first utilized the CNN-based U-Net architecture Ronneberger et al. (2015) as the architecture for the score network. Several improvements have been made by later works Ho et al. (2020); Nichol & Dhariwal (2021); Dhariwal & Nichol (2021); Hoogeboom et al. (2023) incorporating multi-head self-attention Vaswani et al. (2017), group normalization Wu & He (2018), and adaptive layer normalization (adaLN) Perez et al. (2018). Recently, several alternative architectures have been proposed. Jabri et al. (2023) proposed Recurrent Interface Network (RIN), which decouples the core computation and the dimension of the data for more scalable image generation. Peebles & Xie (2023); Bao et al. (2023); Gao et al. (2023); Hatamizadeh et al. (2023) investigated the effectiveness of transformer-based architectures Dosovitskiy et al. (2021) for diffusion models. Yan et al. (2023) utilized state space models Gu et al. (2022) in DiffuSSM to present an attention-free diffusion model architecture. In this work, we propose a conditioning method for attention layers and test it on several CNN-based U-Net architectures. Note that our proposed method is applicable to all diffusion models utilizing attention layers. ## 2.2 Low-Rank Adaptation Using trainable adapters for specific tasks has been an effective approach for fine-tuning models in the realm of natural language processing (NLP) Houlsby et al. (2019); Pfeiffer et al. (2020). Low-rank adpatation (LoRA, Hu et al. (2022)) is a parameter-efficient fine-tuning method that updates a low-rank adapter: to fine-tune a pre-trained dense weight matrix W ∈ R dout×din , LoRA parameterizes the fine-tuning update ∆W with a low-rank factorization $W+\Delta W=W+BA$, where B ∈ R dout×r, A ∈ R r×din , and r ≪ min{din, dout}. LoRA and diffusion. Although initially proposed for fine-tuning LLMs, LoRA is generally applicable to a wide range of other deep-learning modalities. Recent works used LoRA with diffusion models for various tasks including image generation Ryu (2023); Gu et al. (2023); Go et al. (2023), image editing Shi et al. (2023), continual learning Smith et al. (2023), and distillation Golnari (2023); Wang et al. (2023b). While all these works demonstrate the flexibility and efficacy of the LoRA architecture used for fine-tuning diffusion models, to the best of our knowledge, our work is the first attempt to use LoRA as part of the core U-Net for diffusion models for full training, not fine-tuning. ## 2.3 Conditioning The Score Network For diffusion models to work properly, it is crucial that the score network sθ is conditioned on appropriate side information. In the base formulation, the score function ∇xpt(x), which the score network sθ learns, depends on the time t, so this t-dependence must be incorporated into the model via *time conditioning*. When class-labeled training data is available, class-conditional sampling requires *class conditioning* of the score network Ho & Salimans (2021). To take advantage of data augmentation and thereby avoid overfitting, EDM Karras et al. (2022) utilizes *augmentation conditioning* Jun et al. (2020), where the model is conditioned on the data augmentation information such as the degree of image rotation or blurring. Similarly, SDXL Podell et al. (2024) uses *micro-conditioning*, where the network is conditioned on image resolution or cropping information. Finally, text-to-image diffusion models Saharia et al. (2022); Ramesh et al. (2022); Rombach et al. (2022); Podell et al. (2024) use *text conditioning*, which conditions the score network with caption embeddings so that the model generates images aligned with the text description. Conditioning attention layers. Prior diffusion models using CNN-based U-Net architectures condition only convolutional layers in the residual blocks by applying scale-and-shift or adaLN (see **(left)** of Figure 2). In particular, attention blocks are not directly conditioned in such models. This includes the stateof-the-art diffusion models such as Imagen Saharia et al. (2022), DALL·E 2 Ramesh et al. (2022), Stable Diffusion Rombach et al. (2022), and SDXL Podell et al. (2024). To clarify, Latent Diffusion Model Rombach et al. (2022) based models use cross-attention method for class and text conditioning, but they still utilize scale-and-shift for time conditioning. There is a line of research proposing transformer-based architectures (without convolutions) for diffusion models, and these work do propose methods for conditioning attention layers. For instance, DiT Peebles & Xie (2023) conditioned attention layers using adaLN and DiffiT Hatamizadeh et al. (2023) introduced time-dependent multi-head self-attention (TMSA), which can be viewed as scale-and-shift conditioning applied to attention layers. Although such transformer-based architectures have shown to be effective, whether conditioning the attention layers with adaLN or scale-and-shift is optimal was not investigated. In Section 5.5 of this work, we compare our proposed LoRA conditioning on attention layers with the prior adaLN conditioning on attention layers, and show that LoRA is the more effective mechanism for conditioning attention layers. Diffusion models as multi-task learners. Multi-task learning Caruana (1997) is a framework where a single model is trained on multiple related tasks simultaneously, leveraging shared representations between the tasks. If one views the denoising tasks for different timesteps (or SNR) of diffusion models as related but different tasks, the training of diffusion models can be interpreted as an instance of the multi-task learning. Following the use of trainable lightweight adapters for Mixture-of-Expert (MoE) Jacobs et al. (1991); Ma et al. (2018), several works have utilized LoRA as the expert adapter for the multi-task learning Caccia et al. (2023); Wang et al. (2023a; 2024); Zadouri et al. (2024). Similarly, MORRIS Audibert et al. (2023) and LoRAHub Huang et al. (2023) proposed using the weighted sum of multiple LoRA adapters to effectively tackle general tasks. In this work, we took inspiration from theses works by using a composition of LoRA adapters to condition diffusion models. ## 3 Discrete-Time Lora Conditioning Diffusion models such as DDPM Ho et al. (2020) and IDDPM Nichol & Dhariwal (2021) have a predetermined number of discrete timesteps t = 1, 2*, . . . , T* used for both training and sampling. We refer to this setting as the *discrete-time* setting. We first propose a method to condition the attention layers with LoRA in the discrete-time setting. In particular, we implement LoRA conditioning on IDDPM by conditioning the score network with (discrete) time and (discrete) class information. ## 3.1 Timelora TimeLoRA conditions the score network for the discrete time steps t = 1*, . . . , T*. In prior architectures, time information is typically injected into only the residual blocks containing convolutional layers. TimeLoRA instead conditions the attention blocks. See **(right)** of Figure 2. Non-compositional LoRA. Non-compositional LoRA instantiates T independent rank-r LoRA weights A1, A2, . . . , AT , B1, B2*, . . . , B*T . The dense layer at time t becomes Wt = W + ∆W(t) = W + BtAt for t = 1*, . . . , T*. To clarify, the trainable parameters for each linear layer are W, A1, A2*, . . . , A*T , and B1, B2*, . . . , B*T . In particular, W is trained concurrently with A1, A2*, . . . , A*T , and B1, B2*, . . . , B*T . However, this approach has two drawbacks. First, since T is typically large (up to 4000), instantiating T independent LoRAs can occupy significant memory. Second, since each LoRA (At, Bt) is trained independently, it disregards the fact that LoRAs of nearby time steps should likely be correlated/similar. It would be preferable for the architecture to incorporate the inductive bias that the behavior at nearby timesteps are similar. Compositional LoRA. Compositional LoRA composes m LoRA bases, A1*, . . . , A*m and B1*, . . . , B*m, where m ≪ T. Each LoRA basis (Ai, Bi) corresponds to time ti for 1 ≤ t1 < · · · < tm ≤ T. The dense layer at time t becomes $$W_{t}=W+\Delta W(t)=W+\sum_{i=1}^{m}\left(\omega_{t}\right)_{i}B_{i}A_{i},$$ where ωt = ((ωt)1 , . . . ,(ωt)m) is the time-dependent trainable weights composing the LoRA bases. To clarify, the trainable parameters for each linear layer are W, A1, A1, . . . , Am, B1, B1*, . . . , B*m, and ωt. Since the score network is a continuous function of t, we expect ωt ≈ ωt ′ if t ≈ t ′. Therefore, to exploit the task similarity between nearby timesteps, we initialize (ωt)i with a linear interpolation scheme: for tj ≤ *t < t*j+1, $$(\omega_{t})_{i}={\left\{\begin{array}{l l}{{\frac{t_{j+1}-t}{t_{j+1}-t_{j}}}}&{i=j}\\ {{\frac{t-t_{j}}{t_{j+1}-t_{j}}}}&{i=j+1}\\ {0}&{{\mathrm{otherwise.}}}\end{array}\right.}$$ In short, at initialization, ∆W(t) uses a linear combination of the two closest LoRA bases. During training, ωt can learn to utilize more than two LoRA bases, i.e., ωt can learn to have more than two non-zeros through training. Specifically, (ω1*, . . . , ω*T ) ∈ R m×Tis represented as an m × T trainable table implemented as nn.Embedding in Pytorch. ## 3.2 Classlora Consider a conditional diffusion model with C classes. *ClassLoRA* conditions the attention layers in the score network with the class label. Again, this contrasts with the typical approach of injecting class information only into the residual blocks containing convolutional layers. See **(right)** of Figure 2. Since C is small for CIFAR-10 (C = 10) and the correlations between different classes are likely not strong, we only use the non-compositional ClassLoRA: $$W_{c}=W+\Delta W(c)=W+B_{c}^{\prime}A_{c}^{\prime}$$ for c = 1*, . . . , C*. In other words, each LoRA (A′c , B′c ) handles a single class c. When C is large, such as in the case of ImageNet1k, one may consider using a compositional version of ClassLoRA (See Appendix B). ## 4 Continuous-Snr Lora Conditioning Motivated by (Kingma et al., 2021), some recent models such as EDM Karras et al. (2022) consider parameterizing the score function as a function of noise or signal-to-noise ratio (SNR) level instead of time. In particular, EDM Karras et al. (2022) considers the probability flow ODE $$X_{t}=-\sigma(t)\sigma(t)s_{\theta}(x;\sigma(t))\ d t,$$ where sθ(x; σ) is the score network conditioned on the SNR level σ. We refer to this setting as the *continuousSNR* setting. The main distinction between Sections 3 and 4 is in the discrete vs. continuous parameterization, since continuous-time and continuous-SNR parameterizations of score functions are equivalent. We choose to consider continuous-SNR (instead of continuous-time) parameterizations for the sake of consistency with the EDM model Karras et al. (2022). Two additional issues arise in the present setup compared to the setting of Section 3. First, by considering a continuum of SNR levels, there is no intuitive way to assign a single basis LoRA to a specific noise level. Second, to accommodate additional conditioning elements such as augmentations or even captions, allocating independent LoRA for each conditioning element could lead to memory inefficiency. ## 4.1 Unified Compositional Lora (Uc-Lora) Consider the general setting where the diffusion model is conditioned with N attributes cond1*, . . . ,* condN , which can be a mixture of continuous and discrete information. In our EDM experiments, we condition the score network with N = 3 attributes: SNR level (time), class, and augmentation information. Unified compositional LoRA (UC-LoRA) composes m LoRA bases A1*, . . . , A*m and B1*, . . . , B*m to simultaneously condition the information of cond1*, . . .* condN into the attention layer. The compositional weight ω = (ω1*, . . . , ω*m) of the UC-LoRA is obtained by passing cond1*, . . .* condN through an MLP. Prior diffusion models typically process cond1*, . . . ,* condN with an MLP to obtain a condition embedding v, which is then shared by all residual blocks for conditioning. For the j-th residual block, v is further processed by an MLP to get scale and shift parameters γj and βj : $$v=9$$ $\frac{1}{2}$ 4. $\left[1,\,\cdot\,\cdot\,\cdot\,,\,\mathbf{c}\right]$ $\mathbb{N}$). $(\gamma_i,\beta)$ $\overline{\phantom{\rule{0.000pt}{0ex}}}$ v = SharedMLP(cond1*, . . . ,* condN ) (γj , βj ) = MLPj (v). The (γj , βj ) is then used for the scale-and-shift conditioning of the j-th residual block in the prior architectures. In our UC-LoRA, we similarly use the shared embedding v and an individual MLP for the j-th attention block to obtain the composition weight ωj (v): v = SharedMLP(cond1, *· · ·* , condN ) ωj (v) = MLPj (v). Then, the j-th dense layer of the attention block becomes W(cond1*, . . . ,* condN ) = W + ∆W(cond1*, . . . ,* condN ) $$=W+\sum_{i=1}^{m}\omega_{j,i}(v)B_{i}A_{i}.$$ To clarify, the trainable parameters for the j-th dense layer are W, A1, A2, . . . , Am, B1, B2*, . . . , B*m, and the weights in MLPj . Shared across the entire architecture, the weights in SharedMLP are also trainable parameters. ## 5 Experiments In this section, we present our experimental findings. Section 5.1 describes the experimental setup. Section 5.2 first presents a toy, proof-of-concept experiment to validate the proposed LoRA conditioning. Section 5.3 evaluates the effectiveness of LoRA conditioning on attention layers with a quantitative comparison between diffusion models with (baseline) conventional scale-and-shift conditioning on convolutional layers; (only LoRA) LoRA conditioning on attention layers without conditioning convolutional layers; and (with LoRA) conditioning both convolutional layers and attention layers with scale-and-shift and LoRA conditioning, respectively. Section 5.4 investigates the effect of tuning the LoRA rank and the number of LoRA bases. Section 5.5 compares our proposed LoRA conditioning with the adaLN conditioning on attention layers. Section 5.6 explores the robustness of ClassLoRA conditioning compared to conventional scale-and-shift conditioning in extrapolating conditioning information. ## 5.1 Experimental Setup Diffusion models. We implement LoRA conditioning on three different diffusion models: nano diffusion Lelarge et al. (2024), IDDPM Nichol & Dhariwal (2021), and EDM-vp Karras et al. (2022). With nano diffusion, we conduct a proof-of-concept experiment. With IDDPM, we test TimeLoRA and ClassLoRA for the discrete-time setting, and with EDM, we test UC-LoRA for the continuous-SNR setting. Datasets. For nano diffusion, we use MNIST. For IDDPM, we use CIFAR-10 for both unconditional and class-conditional sampling, and ImageNet64, a downsampled version of the ImageNet1k, for unconditional sampling. For EDM-vp, we also use CIFAR-10 for both unconditional and class-conditional sampling and FFHQ64 for unconditional sampling. Configurations. We follow the training and architecture configurations proposed by the baseline works and only tune the LoRA adapters. For IDDPM, we train the model for 500K iterations for CIFAR-10 with batch size of 128 and learning rate of 1 × 10−4, and 1.5M iterations for ImageNet64 with batch size of 128 and learning rate of 1 × 10−4. For EDM, we train the model with batch size of 512 and learning rate of 1 × 10−3for CIFAR-10, and with batch size of 256 and learning rate of 2 × 10−4for FFHQ64. For sampling, in IDDPM, we use 4000 and 4001 timesteps for the baseline and LoRA conditioning respectively, and in EDM, we use the proposed Heun's method and sample images with 18 timesteps (35 NFE) for CIFAR-10 and 40 timesteps (79 NFE) for FFHQ64. Here, NFE is the number of forward evaluation of the score network and it differs from the number of timesteps by a factor of 2 because Heun's method is a 2-stage Runge–Kutta method. Appendix A provides further details of the experiment configurations. Note that the baseline works heavily optimized the hyperparameters such as learning rate, dropout probability, and augmentations. Although we do not modify any configurations of the baseline and simply add LoRA conditioning in a drop-in fashion, we expect further improvements from further optimizing the configuration for the entire architecture and training procedure. LoRA. We use the standard LoRA initialization as in the original LoRA paper Hu et al. (2022): for the LoRA matrices (A, B) with rank r, A is initialized as Aij ∼ N (0, 1/r) and B as the zero matrix. Following Ryu (2023), we set the rank of each basis LoRA to 4. For TimeLoRA and ClassLoRA, we use 11 and 10 LoRA bases, and for UC-LoRA we use 18 and 20 LoRA bases for CIFAR-10 and FFHQ. Due to our constrained computational budget, we were not able to conduct a full investigation on the optimal LoRA rank or the number LoRA bases. However, we experiment with the effect of rank and number of LoRA bases to limited extent and report the result in Section 5.4. ## 5.2 Proof-Of-Concept Experiments We conduct toy experiments with nano diffusion for both discrete-time and continuous-SNR settings. Nano diffusion is a small diffusion model with a CNN-based U-Net architecture with no skip connections with about 500, 000 trainable parameters. We train nano diffusion on unconditional MNIST generation with 3 different conditioning methods: conventional scale-and-shift, TimeLoRA, and UC-LoRA. As shown in Figure 3, conditioning with TimeLoRA or UC-LoRA yields competitive result compared to the conventional scale-and-shift conditioning. Initialization of ωi(t) **for TimeLoRA.** As shown in Figure 3 the choice of initialization of ωi(t) for TimeLoRA impacts performance. With randomly initialized ωi(t), nano diffusion did not converge after 100 epochs, whereas with ωi(t) initialized with the linear interpolation scheme, it did converge. Moreover, Figure 4 shows that even in UC-LoRA, ω(t) shows higher similarity between nearby timesteps than between distant timesteps after training. This is consistent with our expectation that ωi(t) ≈ ωi(t ′) if t ≈ t ′. ## 5.3 Main Quantitative Results Simply adding LoRA conditioning yields improvements. To evaluate the effectiveness of the drop-in addition of LoRA conditioning to the attention layers, we implement TimeLoRA and ClassLoRA to IDDPM and UC-LoRA to EDM, both with the conventional scale-and-shift conditioning on the convolutional layers unchanged. We train IDDPM with CIFAR-10, ImageNet64 and EDM with CIFAR-10, FFHQ64. As reported in Table 1, the addition of LoRA conditioning to the attention layers consistently improves the image ![8_image_0.png](8_image_0.png) Figure 3: MNIST samples generated by nano diffusion trained with **(1st row)** conventional scale-and-shift conditioning; **(2nd row)** TimeLoRA with linear interpolation initialization; **(3rd row)** UC-LoRA; and **(4th** row) TimeLoRA with random initialization. ![8_image_1.png](8_image_1.png) Figure 4: Cosine similarity between ω(t1) and ω(t2) for UC-LoRA applied to nano diffusion **(left)** at initialization and **(right)** after training. At initialization, the cosine similarity between ω(t1) and ω(t2) has no discernible pattern. After training, however, the cosine similarity between ω(t1) and ω(t2) for t1 ≈ t2 is close to 1, implying their high similarity. generation quality as measured by FID scores Heusel et al. (2017) across different diffusion models and datasets with only (∼10%) addition of the parameter counts. Note these improvements are achieved without tuning any hyperparameters of the base model components. Initializing the base model with pre-trained weights. We further test UC-LoRA on pre-trained EDM base models for unconditional CIFAR-10 and FFHQ64 generations. As reported in Table 1, using pre-trained weights showed additional gain on FID score with fewer number of interations (∼ 50%). To clarify, although we initialize the base model with pre-trained weights, we fully train both base model and LoRA modules rather than finetuning. LoRA can even replace scale-and-shift. We further evaluate the effectiveness of LoRA conditioning by replacing the scale-and-shift conditioning for the convolutional layers in residual blocks with LoRA conditioning for the attention blocks. The results of Table 1 suggest that solely using LoRA conditioning on attention layers achieves competitive FID scores while being more efficient in memory compared to the baseline score network trained with scale-and-shift conditioning on convolutional layers. For IDDPM, using LoRA in place of the conventional scale-and-shift conditioning consistently produces better results. Significant improvement is observed especially for class-conditional generation of CIFAR-10. For EDM, replacing the scale-and-shift conditioning did not yield an improvement, but nevertheless performed comparably. We note that in all cases, LoRA conditioning is more parameter-efficient (∼10%) than the conventional scale-and-shift conditioning. ## 5.4 Effect Of Lora Rank And Number Of Lora Bases We investigate the effect of tuning the LoRA rank and the number of LoRA bases on the EDM model for unconditional CIFAR-10 generation and report the results in Table 2. Our findings indicate that using more LoRA bases consistently improves the quality of image generations. On the other hand, increasing LoRA rank does not guarantee better performance. These findings suggest an avenue of further optimizing and improving our main quantitative results of Section 5.3 and Table 1, which we have not yet been able to pursue due to our constrained computational budget. | # basis | rank | FID | # Params | | |-----------------|--------|-------|------------|----------| | 9 | 4 | 1.99 | 57185519 | | | Varying # basis | 18 | 4 | 1.96 | 57745499 | | 36 | 4 | 1.95 | 58865459 | | | 18 | 2 | 1.93 | 57192539 | | | Varying rank | 18 | 4 | 1.96 | 57745499 | | 18 | 8 | 1.96 | 58851419 | | Table 2: Effect of the number of LoRA bases and the LoRA rank on unconditional CIFAR-10 sampling of EDM with LoRA ## 5.5 Comparison With Adaln | Type | uncond. | cond. | |--------------------|-----------|---------| | adaLN conditioning | 2.16 | 2.0 | | LoRA conditioning | 1.99 | 1.82 | We compare the effectiveness of our proposed LoRA conditioning with adaLN conditioning applied to attention layers. Specifically, we conduct an experiment on EDM with scale-and-shift conditioning on convolutional layers removed and with (i) adaLN conditioning attention layers or (ii) LoRA conditioning attention layers. We compare the sample quality of unconditional and class-conditional CIFAR-10 generation and report the results in Table 3. We find that LoRA conditioning significantly outperforms adaLN conditioning for both unconditional and conditional CIFAR-10 generation. This indicates that our proposed LoRA conditioning is the more effective mechanism for conditioning attention layers in the U-Net architectures for diffusion models. Table 3: Comparison of adaLN conditioning and LoRA conditioning on attention layers on EDM (without conditioning convolutional layers). We consider both unconditional and conditional CIFAR-10 generation. ## 5.6 Extrapolating Conditioning Information We conduct an experiment comparing two class-conditional EDM models each conditioned by scale-and-shift and ClassLoRA, for the CIFAR-10 dataset. During training, both models receive size-10 one-hot vectors (ci)j = δij representing the class information. First, we input the linear interpolation αci + (1−α)cj (0 ≤ α ≤ 1) of two class inputs ci and cj (corresponding to 'airplane' and 'horse', respectively) to observe the continuous transition between classes. As shown in the top of Figure 5, both the scale-and-shift EDM and ClassLoRA EDM models effectively interpolate semantic information across different classes. However, when a scaled input βciis received, with β ranging from -1 to 1, scale-and-shift EDM generates unrecognizable images when β < 0, while ClassLoRA EDM generates plausible images throughout the whole range, as shown in the bottom of Figure 5. This toy experiment shows that LoRA-based conditioning may be more robust to extrapolating conditioning information beyond the range encountered during training. Appendix D provides further details. ![10_image_0.png](10_image_0.png) Figure 5: Results of **(Top)** interpolation of class labels in class-conditional EDM with (row1) ClassLoRA; (row2) scale-and-shift; **(bottom)** extrapolation of class labels in class-conditional EDM with (row1) ClassLoRA; (row2) scale-and-shift ## 6 Conclusion In this work, we show that simply adding Low-Rank Adaptation (LoRA) conditioning to the attention layers in the U-Net architectures improves the performance of the diffusion models. Our work shows that we should condition the attention layers in diffusion models and provides a prescription for effectively doing so. Some prior works have conditioned attention layers in diffusion models with adaLN or scale-and-shift operations, but we find that LoRA conditioning is much more effective as discussed in Section 5.5. Implementing LoRA conditioning on different and larger diffusion model architectures is a natural and interesting direction of future work. Since almost all state-of-the-art (SOTA) or near-SOTA diffusion models utilize attention layers, LoRA conditioning is broadly and immediately applicable to all such architectures. In particular, incorporating LoRA conditioning into large-scale diffusion models such as Imagen Saharia et al. (2022), DALL·E 2 Ramesh et al. (2022), Stable Diffusion Rombach et al. (2022), and SDXL Podell et al. (2024), or transformer-based diffusion models such as U-ViT Bao et al. (2023), DiT Peebles & Xie (2023), and DiffiT Hatamizadeh et al. (2023) are interesting directions. Finally, using LoRA for the text conditioning of text-to-image diffusion models is another direction with much potential impact. ## References Brian D.O. Anderson. Reverse-time diffusion equation models. *Stochastic Processes and their Applications*, 1982. Alexandre Audibert, Massih R Amini, Konstantin Usevich, and Marianne Clausel. Low-rank updates of pre-trained weights for multi-task learning. ACL, 2023. Fan Bao, Shen Nie, Kaiwen Xue, Yue Cao, Chongxuan Li, Hang Su, and Jun Zhu. All are worth words: A ViT backbone for diffusion models. *CVPR*, 2023. Lucas Caccia, Edoardo Ponti, Zhan Su, Matheus Pereira, Nicolas Le Roux, and Alessandro Sordoni. Multi-head adapter routing for cross-task generalization. *NeurIPS*, 2023. Rich Caruana. Multitask learning. *Machine Learning*, 1997. Shoufa Chen, Chongjian GE, Zhan Tong, Jiangliu Wang, Yibing Song, Jue Wang, and Ping Luo. Adaptformer: Adapting vision transformers for scalable visual recognition. *NeurIPS*, 2022. Li Deng. The mnist database of handwritten digit images for machine learning research. *IEEE Signal* Processing Magazine, 2012. Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. *NeurIPS*, 2021. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. *ICLR*, 2021. Shanghua Gao, Pan Zhou, Ming-Ming Cheng, and Shuicheng Yan. Masked diffusion transformer is a strong image synthesizer. *ICCV*, 2023. Hyojun Go, Yunsung Lee, Jin-Young Kim, Seunghyun Lee, Myeongho Jeong, Hyun Seung Lee, and Seungtaek Choi. Towards practical plug-and-play diffusion models. *CVPR*, 2023. Pareesa Ameneh Golnari. LoRA-Enhanced distillation on guided diffusion models. arXiv preprint arXiv:2312.06899, 2023. Yuan Gong, Hongyin Luo, Alexander H Liu, Leonid Karlinsky, and James Glass. Listen, think, and understand. ICLR, 2024. Albert Gu, Karan Goel, and Christopher Re. Efficiently modeling long sequences with structured state spaces. ICLR, 2022. Yuchao Gu, Xintao Wang, Jay Zhangjie Wu, Yujun Shi, Yunpeng Chen, Zihan Fan, Wuyou Xiao, Rui Zhao, Shuning Chang, Weijia Wu, Yixiao Ge, Ying Shan, and Mike Zheng Shou. Mix-of-show: Decentralized low-rank adaptation for multi-concept customization of diffusion models. *NeurIPS*, 2023. Ali Hatamizadeh, Jiaming Song, Guilin Liu, Jan Kautz, and Arash Vahdat. DiffiT: Diffusion vision transformers for image generation. *arXiv preprint arXiv:2312.02139*, 2023. Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local nash equilibrium. *NeurIPS*, 2017. Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. *NeurIPS Workshop on Deep Generative* Models and Downstream Applications, 2021. Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. *NeurIPS*, 2020. Emiel Hoogeboom, Jonathan Heek, and Tim Salimans. Simple diffusion: End-to-end diffusion for high resolution images. *ICML*, 2023. Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for NLP. *ICML*, 2019. Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. *ICLR*, 2022. Chengsong Huang, Qian Liu, Bill Yuchen Lin, Tianyu Pang, Chao Du, and Min Lin. LoraHub: Efficient cross-task generalization via dynamic LoRA composition. *arXiv preprint arXiv:2307.13269*, 2023. Allan Jabri, David J Fleet, and Ting Chen. Scalable adaptive computation for iterative generation. *ICML*, 2023. Robert A. Jacobs, Michael I. Jordan, Steven J. Nowlan, and Geoffrey E. Hinton. Adaptive mixtures of local experts. *Neural Computation*, 1991. Heewoo Jun, Rewon Child, Mark Chen, John Schulman, Aditya Ramesh, Alec Radford, and Ilya Sutskever. Distribution augmentation for generative modeling. *ICML*, 2020. Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. *CVPR*, 2019. Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. *NeurIPS*, 2022. Dongjun Kim, Yeongmin Kim, Se Jung Kwon, Wanmo Kang, and Il-Chul Moon. Refining generative process with discriminator guidance in score-based diffusion models. *ICML*, 2023. Diederik Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. *NeurIPS*, 2021. Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. Mingi Kwon, Jaeseok Jeong, and Youngjung Uh. Diffusion models already have a semantic latent space. ICLR, 2023. Marc Lelarge, Andrei Bursuc, and Jill-Jênn Vie. Dataflowr. https://dataflowr.github.io/website/, 2024. Yan-Bo Lin, Yi-Lin Sung, Jie Lei, Mohit Bansal, and Gedas Bertasius. Vision transformers are parameterefficient audio-visual learners. *CVPR*, 2023. Jiaqi Ma, Zhe Zhao, Xinyang Yi, Jilin Chen, Lichan Hong, and Ed H. Chi. Modeling task relationships in multi-task learning with multi-gate mixture-of-experts. *ACM SIGKDD*, 2018. Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. *ICML*, 2021. Junting Pan, Ziyi Lin, Xiatian Zhu, Jing Shao, and Hongsheng Li. St-adapter: Parameter-efficient image-tovideo transfer learning. *NeurIPS*, 2022. William Peebles and Saining Xie. Scalable diffusion models with transformers. *ICCV*, 2023. Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron C. Courville. FiLM: Visual reasoning with a general conditioning layer. *AAAI*, 2018. Jonas Pfeiffer, Andreas Rücklé, Clifton Poth, Aishwarya Kamath, Ivan Vulić, Sebastian Ruder, Kyunghyun Cho, and Iryna Gurevych. AdapterHub: A framework for adapting transformers. *EMNLP*, 2020. Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas Müller, Joe Penna, and Robin Rombach. Sdxl: Improving latent diffusion models for high-resolution image synthesis. *ICLR*, 2024. Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. *arXiv preprint arXiv:2204.06125*, 2022. Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. *CVPR*, 2022. Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. *MICCAI*, 2015. Simo Ryu. Low-rank adaptation for fast text-to-image diffusion fine-tuning. https://github.com/cloneofsimo/lora, 2023. Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Rapha Gontijo Lopes, Tim Salimans, Jonathan Ho, David J Fleet, and Mohammad Norouzi. Photorealistic text-to-image diffusion models with deep language understanding. *NeurIPS*, 2022. Yujun Shi, Chuhui Xue, Jiachun Pan, Wenqing Zhang, Vincent YF Tan, and Song Bai. DragDiffusion: Harnessing diffusion models for interactive point-based image editing. *arXiv preprint arXiv:2306.14435*, 2023. James Seale Smith, Yen-Chang Hsu, Lingyu Zhang, Ting Hua, Zsolt Kira, Yilin Shen, and Hongxia Jin. Continual diffusion: Continual customization of text-to-image diffusion with c-lora. arXiv preprint arXiv:2304.06027, 2023. Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. *ICML*, 2015. Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. *ICLR*, 2021a. Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. NeurIPS, 2019. Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. *ICLR*, 2021b. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. *NeurIPS*, 2017. Haowen Wang, Tao Sun, Cong Fan, and Jinjie Gu. Customizable combination of parameter-efficient modules for multi-task learning. *ICLR*, 2024. Yiming Wang, Yu Lin, Xiaodong Zeng, and Guannan Zhang. Multilora: Democratizing lora for better multi-task learning. *arXiv preprint arxXiv:2311.11501*, 2023a. Zhengyi Wang, Cheng Lu, Yikai Wang, Fan Bao, Chongxuan Li, Hang Su, and Jun Zhu. ProlificDreamer: High-fidelity and diverse text-to-3D generation with variational score distillation. *NeurIPS*, 2023b. Yuxin Wu and Kaiming He. Group normalization. *ECCV*, 2018. Jing Nathan Yan, Jiatao Gu, and Alexander M Rush. Diffusion models without attention. *arXiv preprint* arXiv:2311.18257, 2023. Ted Zadouri, Ahmet Üstün, Arash Ahmadian, Beyza Ermiş, Acyr Locatelli, and Sara Hooker. Pushing mixture of experts to the limit: Extremely parameter efficient moe for instruction tuning. *ICLR*, 2024. ## A Experimental Details Here, we provide the detailed experiment settings. Note that apart from the conditioning method, we mostly follow base codes and configurations provided by Dataflowr, IDDPM repository, and EDM repository for nano diffusion, IDDPM and EDM respectively. ## A.1 Nano Diffusion We mostly followed the base code provided by Dataflowr with 3 exceptions. First, the sinusoidal embedding ![14_image_0.png](14_image_0.png) implemented in the original code was not correctly implemented. Although it did not have visible impact on TimeLoRA and UC-LoRA, it significantly deteriorated the sample quality of the scale-and-shift conditioning (see Figure 6). Second, during training process, the input image is normalized with mean = 0.5 and std = 0.5. However, it is not considered in the visualization process. Lastly, we extended the number of training epochs from 50 to 100 for better convergence. Figure 6: MNIST image generated with incorrect sinusoidal embedding and scale-and-shift conditioning, (top) after 100 epochs of training, **(bottom)** after 400 epochs of training. ## A.2 Iddpm Here we provide the training setting used in IDDPM experiments based on the IDDPM repository. ## A.2.1 Cifar-10 For CIFAR-10 training, we construct U-Net with model channel of 128 channels, and 3 residual blocks per each U-Net blocks. We use Adam optimizer with learning rate of 1 × 10−4, momentum of (β1, β2) = (0.9, 0.999), no weight decay, and dropout rate of 0.3. We train the model with Lhybrid proposed in the original paper for 500k iterations with batch size of 128. The noise is scheduled with the cosine scheduler and the timestep is sampled with uniform sampler at training. For sampling, we use checkpoints saved every 50k iterations with exponential moving average of rate 0.9999, and sample image for 4000 steps and 4001 steps for the baseline and LoRA conditioning, respectively. ## Training Flags Used For Unconditional Cifar-10 Training. MODEL_FLAGS="--image_size 32 --num_channels 128 --num_res_blocks 3 --learn_sigma True --dropout 0.3" DIFFUSION_FLAGS="--diffusion_steps 4000 --noise_schedule cosine" TRAIN_FLAGS="--lr 1e-4 --batch_size 128" ## Training Flags Used For Class-Conditional Cifar-10 Training. MODEL_FLAGS="--image_size 32 --num_channels 128 --num_res_blocks 3 --learn_sigma True --dropout 0.3 --class_cond True" DIFFUSION_FLAGS="--diffusion_steps 4000 --noise_schedule cosine" TRAIN_FLAGS="--lr 1e-4 --batch_size 128" ## A.2.2 Imagenet64 For ImageNet64 training, we use the same U-Net construction used in CIFAR-10 experiment. The model channel is set as 128 channels, and each U-Net block contains 3 residual blocks. We use Adam optimizer with learning rate of 1 × 10−4, momentum of (β1, β2) = (0.9, 0.999), no weight decay and no dropout. We train the model with Lhybrid proposed in the original paper for 1.5M iterations with batch size of 128. The noise is scheduled with the cosine scheduler and the timestep is sampled with uniform sampler at training. For sampling, we use checkpoints saved every 500k iterations with exponential moving average of rate 0.9999, and sample images for 4000 steps and 4001 steps for the baseline and LoRA conditioning, respectively. Training flags used for ImageNet64 training. MODEL_FLAGS="--image_size 64 --num_channels 128 --num_res_blocks 3 --learn_sigma True" DIFFUSION_FLAGS="--diffusion_steps 4000 --noise_schedule cosine" TRAIN_FLAGS="--lr 1e-4 --batch_size 128" ## A.3 Edm Here we provide the training setting used in EDM experiments based on the EDM repository. ## A.3.1 Cifar-10 For CIFAR-10 training, we use the DDPM++ Song et al. (2021b) with channel per resolution as 2, 2, 2. We use Adam optmizer with learning rate of 1 × 10−3, momentum of (β1, β2) = (0.9, 0.999), no weight decay and dropout rate of 0.13. We train the model with EDM preconditioning and EDM loss proposed in the paper for 200M training images (counting repetition) with batch size of 512 and augmentation probability of 0.13. For sampling, we used checkpoints saved every 50 iterations with exponential moving average of 0.99929, and sample image using Heun's method for 18 steps (35 NFE). Training flags used for unconditional CIFAR-10 training. --cond=0 --arch=ddpmpp Training flags used for class-conditional CIFAR-10 training. --cond=1 --arch=ddpmpp ## A.3.2 Ffhq64 For FFHQ training, we use the DDPM++ Song et al. (2021b) with channel per resolution as 1, 2, 2, 2. We use Adam optmizer with learning rate of 2 × 10−4, momentum of (β1, β2) = (0.9, 0.999), no weight decay and dropout rate of 0.05. We train the model with EDM preconditioning and EDM loss proposed in the paper for 200M training images (counting repetition) with batch size of 256 and augmentation probability of 0.15. For sampling, we used checkpoints saved every 50 iterations with exponential moving average of about 0.99965, and sample image using Heun's method for 40 steps (79 NFE). ## Training Flags Used For Ffhq Training. --cond=0 --arch=ddpmpp --batch=256 --cres=1,2,2,2 --lr=2e-4 --dropout=0.05 --augment=0.15 ## A.4 Lora Basis For Timelora As IDDPM uniformly samples the timestep during training, we follow the similar procedure for selecting the timestep ti assigned for the LoRA basis (Ai, Bi) in TimeLoRA. To be specific, we set t1 = 1, tm = T, and equally distribute tiin between: $$t_{i}=1+(i-1)\cdot{\frac{T-1}{m}}$$ m. Note here, for simplicity we assumed that m divides T − 1, and choose T = 4001 instead of T = 4000 used in the baseline work. ## A.5 Mlp For Composition Weights Of Uc-Lora For the composition weights of UC-LoRA, we used 3-layer MLP with group normalization and SiLU activation. Specifically, each LoRA module contains a MLP consisting of two linear layers with by group normalization and SiLU activation followed by a output linear layer. MLP takes the shared condition embedding v ∈ R demb as the input and outputs the composition weight ω(v) ∈ R m, where demb is the embedding dimension (512 for EDM) and m is the number of LoRA bases. This is implemented in Pytorch as ``` self.comp_weights = nn.Sequential( Linear(in_features=embed_dim, out_features=128), GroupNorm(num_channels=N1, eps=1e-6), torch.nn.SiLU(), Linear(in_features=N1, out_features=N2), GroupNorm(num_channels N2, eps=1e-6), torch.nn.SiLU(), Linear(in_features=N2, out_features=num_basis), ) ``` In our experiment, we set (N1, N2) = (50, 50) for nano diffusion and (N1, N2) = (128, 64) for EDM. Note the choice of depth, and the width of the MLP is somewhat arbitrary and can be further optimzied. ## B Compositional Classlora To verify the effectiveness of a compositional version of ClassLoRA, we conducted a proof-of-concept experiment with EDM on CIFAR-10. We finetuned a pretrained unconditional EDM for class-conditional CIFAR-10 sampling using a *single* LoRA basis and randomly initialized compositional weights. Note in the non-compositional ClassLoRA, we used 10 LoRA bases, one for each class. As a result, with the addition of only 61560 parameter counts, we were able to convert (fine-tune) an unconditional EDM to a conditional EDM and improve the FID score from 1.97 to 1.81. ## C Cosine Similarity Between Ωt**S In Nano Diffusion** We present cosine similarity between ωt and ω500 for all LoRA bases in UC-LoRA for nano diffusion in Figure 7. As observed in Section 5.2 and Figure 4, cosine similarity is consistently high for t close to 500, proving that there is a task similarity between nearby timesteps for all layers of the network. However, the patterns varied depending on the depth of the layer within the network. This could be an interesting point for future research to further understand the learning dynamics of the diffusion models. ![17_image_0.png](17_image_0.png) Figure 7: Cosine similarity between ωt and ω500 for UC-LoRA applied to nano diffusion. ## D Extrapolating Conditioning Information With Class Lora We present a more detailed analysis along with comprehensive results of the experiments introduced in Section 5.6. The class-conditional EDM model used for comparison was trained with the default training configurations explained in Appendix A.3. For ClassLoRA-conditioned EDM, we used the unconditional EDM as the base model and applied ClassLoRA introduced in Section 3.2 for the discrete-time setting. We did not use UC-LoRA for this ablation study, with the intent of focusing on the effect of LoRA conditioning on class information. We provide interpolated and extrapolated images as introduced in 5.6 for various classes in Figure 8 and Figure 9, corroborating the consistent difference between the two class conditioning schemes across classes. We also experiment with strengthening the class input, where we use scaled class information input βci with β > 1. Fig. 10 shows that LoRA conditioning shows more robustness in this range as well. Considering the formulation of ClassLoRA, interpolating or scaling the class input is equivalent to interpolating or scaling the class LoRA adapters, resulting in a formulation similar to Compositional LoRA or UC-LoRA: $$W_{t}=W+\Delta W(c)=W+\sum_{i=1}^{C}\omega_{i}B_{c}^{\prime}A_{c}^{\prime},$$ where ωi corresponds to the interpolation or scaling of the class inputs. From this perspective, the ω weights could be interpreted as a natural 'latent vector' capturing the semantic information of the image, in a similar sense that was highlighted in Kwon et al. (2023). While our current focus was exclusively on class information, we hypothesize that this method could be extended to train style or even text conditioning, especially considering the effectiveness of LoRA for fine-tuning. ![18_image_0.png](18_image_0.png) Figure 8: Results of interpolation of class labels for various classes ![19_image_0.png](19_image_0.png) Figure 9: Results of extrapolation of class labels for various classes ![20_image_0.png](20_image_0.png) Figure 10: Results of class labels scaled from 1 to 5 for various classes ## E Image Generation Samples E.1 Iddpm E.1.1 Unconditional CIFAR-10 ![21_image_0.png](21_image_0.png) Figure 11: Unconditional CIFAR-10 samples generated by IDDPM with LoRA ![21_image_1.png](21_image_1.png) ## E.1.2 Class-Conditional Cifar-10 Figure 12: Class conditional CIFAR-10 samples generated by IDDPM with LoRA ![22_image_0.png](22_image_0.png) Figure 12: Class conditional CIFAR-10 samples generated by IDDPM with LoRA ![23_image_0.png](23_image_0.png) Figure 12: Class conditional CIFAR-10 samples generated by IDDPM with LoRA ## E.1.3 Imagenet64 ![24_image_0.png](24_image_0.png) ## E.2 Edm E.2.1 Unconditional CIFAR-10 ![25_image_0.png](25_image_0.png) Figure 14: Unconditional CIFAR-10 samples generated by EDM with LoRA ## E.2.2 Class-Conditional Cifar-10 ![25_image_1.png](25_image_1.png) Figure 15: Class conditional CIFAR-10 samples generated by EDM (vp) with LoRA ![26_image_0.png](26_image_0.png) Figure 15: Class conditional CIFAR-10 samples generated by EDM (vp) with LoRA ![27_image_0.png](27_image_0.png) Figure 15: Class conditional CIFAR-10 samples generated by EDM (vp) with LoRA ## E.2.3 Ffhq ![28_image_0.png](28_image_0.png)
Review 1: Summary: This work examines the problem of including scalar/vector conditional information such as timestep and class label in the attention layers of UNet-based diffusion models. The majority of current methods include this type of conditional information only in the residual layer of the UNet, which seems suboptimal. The paper proposes to use LoRA to adapt the input QKV and output projection layers of UNet attention modules, with the motivation that this provides a lightweight and constrained adjustment to the operation basic attention layer. The major contribution of the work is designing two types of LoRA layers: one for discrete ordered timesteps or classes, and the other for continuous timesteps and continuous conditions. Experiments are conducted showing that including the proposed modules provides improvement in generative quality metrics. Strengths and Weaknesses: Strengths: * The aim of the paper is straightforward and clear. Including timestep information in the attention layers of diffusion-based UNets seems to be a missing component of the current paradigm and it is useful to explore ways to do so. * The proposed LoRA method is efficient and aligns nicely with existing diffusion techniques. The handling of LoRA module design makes intuitive sense and seems natural. * The experiments are conducted in a clear and reproducible way. There is solid evidence that consistent (although modest) refinement can be achieved by including the proposed modules.    Weaknesses: * The introduction of two different LoRAs techniques for two different cases seems somewhat unnecessary. Discrete timesteps can be treated as continuous inputs, and classes can be represented as vectors in one-hot or binary encoding, etc. which can also be treated as continuous inputs. I would be interested in seeing evidence whether UC-LoRA can match Time and Class LoRA in the cases where Time and Class LoRA were used. If so, it might be more straightforward to adopt a single approach. This is not a major concern, but it is worth exploring. * I am not sure how interpolation between classes would be performed for Class LoRA in the case of a large number of classes. The interpolation method for timesteps seems to depend on an ordering of the timesteps, which doesn't hold for classes. I would be interested in hearing how handling a large number of classes could be done. Requested Changes: I have no major requested changes. It would be interesting to see whether UC-LoRA can serve as a single solution for all the cases considered, but this is not essential. Broader Impact Concerns: Broader impacts were not discussed, but that does not influence my view of the paper. ================================================== Review 2: Summary: This paper suggests that LoRA blocks should be integrated within a U-net block as a part of a conditioning process. The authors show that architectural change leads to a small improved performance w.r.t the FID metric, at the cost of some additional parameters. Strengths and Weaknesses: The fact that this is a drop-in improvement makes is a strong point, since otherwise, with architectural improvement, it can be difficult to tell if there is a meaningful improvement if there is significant hyper-parameter tuning involved. Requested Changes: I think the paper is overall well written and the figures are nice. I was not particularly knowledgeable about this topic, but the paper did a good enough job of helping me understand the topic. I would say there could be some more information in the introduction about the theoretical motivation behind the paper. Broader Impact Concerns: None to note. ================================================== Review 3: Summary: This work proposes to apply drop-in lora (low rank layer) to the attention layers of the attention layers of a U-net improves the performance of the image generation tasks Strengths and Weaknesses: Strength: Using LoRA in this problem is novel and leads to promising result Weakness: Lack of theory, and the motivation is not too strong. For the present manuscript, the motivation is just (paraphrased) "we should condition the attention layers because we also conditioned other." This is not a strong motivation for conditioning the attention layers, nor a strong motivation to condition the attention in the specific way the authors proposed Requested Changes: I believe having a more convincing and not-so-arbitrary motivation would be much better Broader Impact Concerns: NA ==================================================
# Dcp: Learning Accelerator Dataflow For Neural Network Via Propagation Anonymous authors Paper under double-blind review ## Abstract Deep neural network (DNN) hardware (HW) accelerators have achieved great success in improving DNNs' performance and efficiency. One key reason is dataflow in executing a DNN layer, including on-chip data partitioning, computation parallelism, and scheduling policy, which have large impacts on latency and energy consumption. Unlike prior works that required considerable efforts from HW engineers to design suitable dataflows for different DNNs, this work proposes an efficient data-centric approach, named Dataflow Code Propagation (DCP), to automatically find the optimal dataflow for DNN layers in seconds without human effort. It has several attractive benefits that prior arts do not have. (i) We translate the HW dataflow configuration into a code representation in a unified dataflow coding space, which can be optimized by back-propagating gradients given a DNN layer or network. (ii) DCP learns a neural predictor to efficiently update the dataflow codes towards the desired gradient directions to minimize various optimization objectives (e.g., latency and energy). (iii) It can be easily generalized to unseen HW configurations in a zero-shot or few-shot learning manner. For example, without using additional training data, DCP surpasses the GAMMA (Kao & Krishna, 2020) method that performs a full search using thousands of samples. Extensive experiments on several representative models such as MobileNet, ResNet, and ViT show that DCP outperforms its counterparts in various settings. ## 1 Introduction Deep neural networks (DNNs) have achieved remarkable breakthroughs in many areas, such as vision and language (He et al., 2021), autonomous driving (Al-Qizwini et al., 2017), and biology science (Jumper et al., 2021). However, the exponentially-increased model size often increases the latency and energy consumption of DNN applications, leading to a flourishing area of designing HW-efficient DNN models (Tan et al., 2019; Ma et al., 2018; Iandola et al., 2017) and DNN HW accelerators (Chen et al., 2017; 2019; nvd, 2018; Du et al., 2015). Compared with general-purpose HW processors, DNN accelerators can achieve higher efficiency and lower energy when executing a DNN. This is done by designing a more appropriate micro-architecture and optimizing the DNN's HW mapping strategy, called dataflow, including the order to perform the DNN layer computations and how these computations are mapped across the HW resources (e.g., processing elements and memory). Designing dataflow for optimal on-chip performance and efficiency is a fundamental and challenging task. The dataflow of existing DNN accelerators is typically over-specialized with under-explored dataflow designs (Chen et al., 2017; nvd, 2018; Du et al., 2015; Jouppi et al., 2017; Parashar et al., 2017; Akhlaghi et al., 2018), hindering the generalization and efficiency of DNN executions. For example, NVDLA (nvd, 2018) exploits parallelism across the input and output channels, while Eyeriss (Chen et al., 2017) exploits parallelism across the filter and input activation rows. We observe that NVDLA is suitable for DNN layers with many channels, while Eyeriss prefers the DNN layers with large filters and feature maps. A quantitative comparison is shown in Fig. 1(a), which compares the energy-delay-product (EDP) of three hand-craft dataflows, i.e., NVDLA, Eyeriss, and ShiDianNao accelerators when processing three different DNN models, including ResNet101 (He et al., 2016), Vision Transformer (Dosovitskiy et al., 2020), and MobileNet-V2 (Sandler et al., 2018). We see that different hand-craft dataflows have their own advantage on certain types of DNN ![1_image_0.png](1_image_0.png) Figure 1: **Dataflow Comparisons and Explanations.** (a) We compare the Energy-delay-product (EDP, lower is better) between NVDLA, Eyeriss, ShiDianNao, and our DCP. We see that DCP can achieve the best efficiency for all three visual models. (b) visualizes and compares the dataflow of ours and Eyeriss using the first layer of ResNet101. The layer dimensions have been tiled based on the partitioning size of dataflow. The red color labels the tiles to perform parallel computation, and the orange arrow implies the computation order, where K, C, R, S, Y, X, Y ′, X′represent output/input channels, filter row/column, input row/column and output row/column respectively. Our learned dataflow costs only 18.9% read/writes compared to Eyeriss by (i) using a smaller kernel tiled size (4 × 4 versus 1 × 1 in Eyeriss) and smaller tiled output channels (8 versus 4 in Eyeriss) but a larger one for input (3 × 3 versus 7 × 7 in Eyeriss) and (ii) different computation order of dimensions. layers. Customizing dataflows for different DNNs is more flexible and efficient than a fixed one for all DNNs. Although reconfigurable accelerators (Chen et al., 2019; Kwon et al., 2018) have extra circuits to enable a configurable dataflow, which can be tuned at compile time to leverage the HW resources fully, the manually-designed dataflows still dominate in existing accelerators. To alleviate manual efforts in designing dataflows, recent works (Yazdanbakhsh et al., 2021; Kao & Krishna, 2020; Kao et al., 2020; Wang et al., 2021) have studied autonomous algorithms for dataflow design using some conventional search techniques such as exhaustive search (Wang et al., 2021; Parashar et al., 2019) and reinforcement learning (Kao et al., 2020). However, it is hard for these methods to deal with a vast dataflow design space, e.g., O(1036) for one DNN layer, as discussed in Sec. 4.1. To cope with this challenge, a straightforward strategy (Yazdanbakhsh et al., 2021; Kao et al., 2020; Wang et al., 2021) is to scale down the design space, leading to sub-optimal design. This paper answers a question naturally raised from the above issues: can we efficiently generate optimal dataflows for different DNN layers and networks? To efficiently search an optimal dataflow in a vast design space, we propose Dataflow Code Propagation (DCP), an autonomous pipeline to search dataflow for many DNN applications. Unlike prior work, DCP uses an encoding scheme to translate the dataflow and DNN layer configuration into a unified coding representation and build a vast coding space of dataflow design. By leveraging this encoding scheme, we build a benchmark with the input of unified codes and the output of corresponding evaluation metrics (e.g., latency, energy, etc.). We then learn a neural predictor to project the unified code into the corresponding evaluation metrics. By optimizing the evaluation metrics, we backpropagate the gradient of the neural predictor and update the unified code directly along the gradients of various optimization objectives, such as more negligible latency and energy. Compared with prior dataflow designing techniques (Kao & Krishna, 2020; Parashar et al., 2019; Yang et al., 2020b), our proposed DCP has several appealing properties. Firstly, DCP is data-efficient in the sense that it can search the optimal dataflow for various DNNs in seconds once the neural predictor is trained. But previous works need to search dataflow for each DNN with a time-consuming simulation process. Secondly, it can optimize dataflow optimization at the whole model level by accumulating gradients of all layers. Fig. 1(b) visualizes the searched dataflow by DCP, which outperforms many manually-designed dataflows such as Eyeriss (Chen et al., 2017). Lastly, DCP is easily extended to the multi-objective dataflow optimization, yielding the dataflow configuration that can trade off multiple HW metrics better. We make three main **contributions**. (i) We propose an encoding scheme by translating the DNN layer configurations and accompanying dataflows into a coding representation by presenting a unified coding space and a comprehensive dataflow benchmark. (ii) We back-propagate the gradient of the neural predictor to efficiently update dataflow codes in the vast design space to achieve the desired optimization goals. To our knowledge, this is the first work that leverages differentiable back-propagation in dataflow optimization. (iii) Extensive experiments show the generalization of DCP by customizing dataflow for many optimization objectives (e.g., latency/energy of single/multiple layers) in various DNNs in both seen and unseen HW configurations. ## 2 Related Work DNN Accelerators. The development of DNNs has led to the flourishing of specialized DNN accelerators in recent years. According to the flexibility of DNN accelerators' dataflow, DNN accelerators can be categorized into two categories which are fixed dataflow accelerators (Chen et al., 2017; nvd, 2018; Du et al., 2015) and reconfigurable accelerators (Chen et al., 2019; Kwon et al., 2018). Application-specific accelerators (Kawamoto et al., 2020a; Yamada et al., 2019; Kawamoto et al., 2020b) design a dataflow fixed and optimized for one or several DNN applications. Reconfigurable accelerators have extra circuits to enable a configurable dataflow, which can be tuned at compile time. Therefore, an exemplary dataflow can not only guide the architecture design for the DNN accelerators with a dataflow baked into the silicon but also let the DNN applications can fully leverage the HW resources of the DNN accelerators with a configurable dataflow. The optimization of dataflow is central in designing both fixed dataflow accelerators and reconfigurable accelerators. And in this work, we aim to optimize the dataflow design for various DNN models, which is central to both fixed dataflow accelerators and reconfigurable accelerators. Design Space Exploration of DNN Accelerator. In the design of a DNN accelerator, several components should be considered. These components also form the design space of the DNN accelerator, which are dataflow, HW resources, specific circuit design, and so on. For designing efficient specialized DNN accelerators for target applications, many works (Yazdanbakhsh et al., 2021; Kao et al., 2020; Wang et al., 2021) have been proposed to explore the design space of DNN accelerators. For instance, Apollo (Yazdanbakhsh et al., 2021) is a framework for optimizing the DNN accelerator based on the features extracted with Integrated Circuit (IC) design knowledge. Our work can also broadly be categorized into the design space exploration algorithm of the DNN accelerator, as dataflow is an essential component in the DNN accelerator's design space. Performance Simulator of DNN Accelerator. Using Electronic Design Automation (EDA) tools to evaluate the performance of the DNN accelerator requires the corresponding circuit design, and the simulation process is also time-consuming. Therefore, to efficiently explore the design space of the DNN accelerator, several performance simulators (Kwon et al., 2019; Parashar et al., 2019; Yang et al., 2020b; Wang et al., 2021) have been proposed to provide accurate performance simulation for possible dataflows and accompanying HW resource configurations. According to the expression of data reuse, most simulators are compute-centric, which uses the loop-nest representation to infer data reuse. In this paper, we choose MAESTRO (Kwon et al., 2019), a data-centric simulator that uses spatial and temporal maps to express data reuse. Co-design of Network and DNN Accelerator. Except for the growing work exploring the design space of network architecture or DNN accelerators, co-design the DNNs and their accelerator have attracted increasing research interests in recent years. Some of them merge the design space of the network and DNN accelerator and search the optimal network-accelerator pair jointly with the method of evolutionary algorithm (Fasfous ![3_image_0.png](3_image_0.png) Figure 2: **Example of DNN Accelerator.** An abstract DNN accelerator architecture that contains a hierarchical memory system and PE arrays. This abstract DNN accelerator architecture is also used in many DNN accelerators (Chen et al., 2017; Jouppi et al., 2017; Parashar et al., 2017; Akhlaghi et al., 2018). et al., 2022; Lin et al., 2021) or gradient-based methods (Fasfous et al., 2021; Choi et al., 2021; Li et al., 2020). While some methods (Zhou et al., 2022; Abdelfattah et al., 2020) tackle this co-design problem with the manner of reinforcement learning. However, these works target different HW platforms, including academic accelerators (Yang et al., 2020a), performance simulators (Lin et al., 2021; Choi et al., 2021), and commercial accelerators (Zhou et al., 2022). The differences in target hardware platforms also introduce difficulties in the performance comparison as all the result posted in related papers needs to be performed from scratch for different hardware platforms. Another aporia is the modeling method of the hardware accelerator is also different in many prior works, which makes it hard to compare with the work targeting other hardware platforms. And different from those works in co-designing DNN models and HW configurations, our DCP focuses on optimizing dataflow design for various DNN models. By building the connection between HW metrics and dataflow using a neural predictor, DCP can achieve better HW performance than NAAS (Lin et al., 2021). ## 3 Preliminary DNN Accelerators. DNN accelerators have HW architectures specifically designed to run the DNN applications efficiently. To better understand the architecture of DNN accelerators, an abstract DNN accelerator architecture used in many state-of-the-art accelerators is shown in Fig. 2. As illustrated in Fig. 2, most DNN accelerators comprise several arrays of Processing Elements (PEs) to exploit the parallelization and data reuse opportunities in DNN applications. Typically, a PE will have a specific arithmetic logical unit (ALU) to perform the multiply-accumulate operations (MACs) and a local register file to store the input and output of the ALU. Within the PE array, there will have a local scratchpad memory ("L1 Buffer") to assign the data to PEs. Sometimes, there will be another local scratchpad memory ("L0 Buffer") between L1 Buffer and PEs if the accelerator wants to do more fine-grained control with PEs. In addition to the L1 Buffer, most DNN accelerators also have a global scratchpad memory ("L2 buffer") shared among PE arrays to stage data to feed PEs for reducing the number of energy-expensive and time-consuming accesses of dynamic random access memory (DRAM). Dataflow. Dataflow is the data communication pattern within a DNN accelerator between the compute and memory elements. Dataflow affects the data reuse pattern and parallelism strategy of the accelerator. As it has been shown that the energy cost of moving data exceeds the cost of computation (Horowitz, 2014), understanding and optimizing dataflow is a critical component of DNN accelerator design, as it directly determines how data is transferred between different levels of buffers in the memory hierarchy. Specifically, ![4_image_0.png](4_image_0.png) Figure 3: Coding representations of dataflow and DNN layer. DNN layer code is a seven-dimensional code that describes the DNN layer in the dimensions of K, C, Y, X, R, S, T. We use a dataflow optimized for MobileNet-v2 as an example. The dataflow code describes the three memory levels of the accelerator. The L1 dataflow code is an example, the first line is the index of seven dimensions, and the second line is their accompanying numbers. These seven dimensions contain six dimensions in the DNN layer code except T in computation order and a parallel dimension selected from them to perform parallel computation. The accompanying number of the parallel dimension specifies the number of PEs allocated in one cluster of L1 memory. In contrast, the partitioning size is the accompanying number of the rest six dimensions. we describe dataflow in three aspects: parallelism, computation order, and partitioning size (see more details in Appendix Sec.A). · Parallelism. Parallelism is about allocating the computation workload into the multiple HW processing units and letting these processing units can perform the computation simultaneously. For DNN accelerators, the processing units are PEs, and they usually achieve parallelism via unrolling the loop nest of convolutional layers spatially. · Computation Order. Computation order is the temporal order of the dimensions to be performed in the multiple-dimensional computation task. Different computation orders can exploit different data movement patterns and reuse opportunities. · Partitioning Size. As there are many parameters to the DNN application and the buffer size of DNN accelerators is limited, accelerators with a multi-level memory hierarchy will partition these parameters and allocate them into buffers. In this process, partitioning size will determine the data size of each tensor (input/output/weight) that needs to be present within the accelerator's buffer. Although different types of DNN prefer different dataflow designs, as indicated in Fig. 1, existing accelerators either utilize manually-designed dataflows Chen et al. (2017); nvd (2018); Du et al. (2015) or search dataflow using conventional optimization algorithms Wang et al. (2021); Yang et al. (2020b); Parashar et al. (2019), leading to serious human efforts and sub-optimal performance. To tackle this problem, we propose a data-centric method to find the optimal dataflow for DNN layers in seconds without human effort. ## Our Approach 4 In this section, we propose Dataflow Code Propagation (DCP) to efficiently search the optimal dataflow for DNN accelerators in a differentiable manner. Towards this goal, we first benchmark the dataflow parameters and DNN layer configurations in Sec.4.1. Then, a predictor is trained to predict HW metrics given the dataflow and DNN layer parameters in Sec.4.2. Lastly, we search the optimal dataflow for DNN layers by back-propagating the gradients under various objectives such as minimizing latency consumption in Sec. 4.3. An overview of DCP is shown in Fig. 4. In addition, leveraging its general pipeline, DCP can easily handle ![5_image_0.png](5_image_0.png) Figure 4: **An overview of our Dataflow Code Propagation (DCP).** DCP first builds a benchmark of dataflow and DNN layer and then trains a predictor to predict various HW metrics. Finally, we back-propagate the gradients of the fixed neural predictor to efficiently update the dataflow code towards the optimization objective (lower predicted metrics), conditioned on the layer code. unseen hardware constraints and be applied to other hardware models, which is illustrated in Sec.5.5 and Appendix. B respectively. In addition, DCP can easily handle unseen hardware constraints. Note that the benchmark of dataflow and DNN layer is built under the default HW setting of the Eyeriss chip (i.e. 168 PEs and 108KB on-chip memory). In Sec. 5.5, we show that the neural predictor trained on such a benchmark can be easily transferred to other benchmarks built under unseen HW settings with few-shot/zero-shot learning pipelines. Moreover, we would like to highlight that the overall pipeline of DCP (i.e. build benchmark –>train predictor - >search dataflow) is general enough to be applied to other hardware models, which is demonstrated by the Space-Time-Transformation matrix used in Tensorlib in Appendix B. ## 4.1 Benchmarking Dataflow And Dnn Layer We propose an encoding scheme to build the benchmark of the dataflow and the DNN Layer where the HW metrics for each pair of dataflow and the DNN Layer are evaluated by HW simulation. Encoding Scheme. We encode the dataflow and accompanying DNN layer configurations into coding representations to perform the dataflow optimization efficiently. A detailed example of our coding representation is shown in Fig. 3. In our encoding scheme, the configuration of a DNN layer is represented by seven dimensions, which are input row/column (*Y /X*), filter row/column (R/S), output/input channels (K/C), and an extra dimension (T) to describe the layer type of DNN layers. The row/column of output can be deduced by the input row/column and filter row/column. Overall, we encode a DNN layer into a seven-dimensional code in the order of *K, C, Y, X, R, S, T* , denoted by x ∈ R m where m = 7. For the coding representation of dataflow, we encode it into a (3, 7, 2) dimensional code, denoted by y ∈ R n where n = 42. Considering the architecture of the DNN accelerator introduced in Sec. 3, this '3' refers to the three memory levels of an accelerator. For each memory level, there will be a (7, 2) dimensional code to describe the dataflow of one cluster in the corresponding memory level. As demonstrated in Fig. 2, a DNN accelerator may have one L2 cluster and several L1/L0 clusters, which contain a memory buffer and corresponding sub-clusters. The '7' in the (7, 2) dimensional code of each memory level addressed the seven dimensions. Notably, the first dimension indicates a parallel dimension selected from *K, C, Y, X, R, S* to be unrolled and perform parallel computation. The rest six dimensions are obtained by reordering the dimensions of *K, C, Y, X, R, S* with computation order. Then, the two-dimensional code '2' of each dimension contains a ![6_image_0.png](6_image_0.png) Figure 5: Regression performance of the neural predictor for the HW metrics of latency, energy, and power, respectively. The color bar represents the density of data points calculated by Gaussian kernel density estimation (KDE). The darker the color is, the more concentrated the data points distribute. number to index the corresponding dimension and an accompanying number. The accompanying number of the parallel dimension specifies how many PEs will be allocated to perform parallel computation. In contrast, the accompanying number of the rest six dimensions determines their partitioning size. The size of memory buffers in each sub-clusters is calculated by partitioning size, as the buffers store input, output, and weight tensors. In contrast, the size of these tensors is the linear combination of partitioning sizes. Hardware Metrics. To build the benchmark, we evaluate the HW metrics for each pair of code representations of the dataflow and the DNN Layer. However, the above encoding scheme involves a vast search space, making it hard to enumerate all DNN layer dimensions and their corresponding dataflows. For example, the first layer in ResNet101 (K = 64, C = 3, Y = 224, X = 224, R = 7, S = 7) can form a dataflow search space with the complexity of O(1036) = (64 × 3 × 2242 × 72 × 6! × 6)3. In practice, we randomly sample 2K DNN layers based on all classification models in the torchvision (tor, 2022) library (version 0.12, including ViT). For each DNN layer, we sample 2K dataflows randomly. We find that such a scale of the dataset is enough to train a good predictor. Then, we evaluate the performance for all sampled dataflows and accompanying DNN layers with a performance simulator (Kwon et al., 2019) to form a dataset with the input of our unified coding representation and the output of performance metrics (latency, energy, etc.). An extensive experiment based on cycle-accurate simulation is shown in Appendix.B. Collection Data with HW Constraints. In the design of realistic DNN accelerators, several constraints should be considered, like the number of PEs contained in the accelerator and the memory size of each buffer. The dataflow encoding scheme introduced above can also address the design constraints of realistic DNN accelerators. The simple one is that the accompanying number of parallels can constrain the number of processing elements in the accelerator and corresponding sub-clusters. We address these constraints of accelerator design by only sampling data satisfying the limitation of these constraints. In specific, we follow the same hardware constraints as it is presented in Eyeriss (Chen et al., 2017) chip, which consists of i) The number of PE cannot surpass 168. ii) The on-chip memory capacity cannot exceed 108 KB. iii) The number of PE of a sub-cluster cannot exceed its parent cluster. iv) The memory capacity of a sub-cluster cannot exceed its parent cluster. ## 4.2 Training Predictor Unlike previous dataflow designing approaches that require a time-consuming HW simulation process for each model, DCP aims to train a predictor using the benchmark introduced in Sec.4.1 to optimize dataflow for all models, as shown in Fig.4. Predictor Architecture. The neural predictor F is instantiated by an encoder θe and several prediction heads {θi} for HW metrics where θiindicates the head i-th metric. HW metrics use different prediction heads but share a common encoder can not only encourage the predictor to predict the HW metrics well but also reduce computations and parameters. The encoder is a shallow attention network with a 4-layer self-attention layer (Subakan et al., 2021) of hidden size 64. The activation function is Swish (Ramachandran | MobileNet-V2 (Sandler et al., 2018) | | ResNet101 (He et al., 2016) | ViT (Dosovitskiy et al., 2020) | | | | | | | | |---------------------------------------|----------|-------------------------------|----------------------------------|-------------------|-----------|---------------|----------|----------|----------|-------| | Method | | | | | Time cost | | | | | | | EDP | Latency | Energy | EDP | Latency | Energy | EDP | Latency | Energy | | | | (cycles * nJ) | (cycles) | (nJ) | (cycles * nJ) | (cycles) | (nJ) | (cycles * nJ) | (cycles) | (nJ) | | | | PSO (Marini & Walczak, 2015) | 2.14e+10 | 1.72e+07 | 2.20e+05 | 5.05e+11 | 4.79e+07 | 5.90e+05 | 1.72e+13 | 1.58e+08 | 8.52e+05 | 4945s | | Portfolio (McMillan et al., 2011) | 1.75e+10 | 1.64e+07 | 2.16e+05 | 1.78e+11 | 1.51e+07 | 5.45e+05 | 2.75e+12 | 5.50e+06 | 6.38e+05 | 6010s | | OnePlusOne (Igel et al., 2006) | 4.44e+10 | 2.14e+07 | 2.37e+05 | 4.11e+12 | 1.41e+08 | 6.86e+05 | 2.56e+15 | 3.08e+08 | 8.86e+05 | 4756s | | CMA (Hansen et al., 2009) | 7.83e+11 | 2.91e+07 | 2.64e+05 | 2.77e+19 | 9.22e+18 | 9.04e+05 | 3.14e+12 | 1.79e+07 | 1.24e+06 | 7529s | | DE (Vodopija et al., 2018) | 1.78e+10 | 1.64e+07 | 2.11e+05 | 9.14e+10 | 1.51e+07 | 5.20e+05 | 3.09e+11 | 4.79e+05 | 6.84e+05 | 4882s | | TBPSA (Poláková et al., 2017) | 1.90e+10 | 1.68e+07 | 2.17e+05 | 2.90e+11 | 2.49e+07 | 5.47e+05 | 4.01e+11 | 8.18e+06 | 6.35e+05 | 4781s | | pureGA (Goldberg, 1989) | 3.91e+10 | 2.44e+07 | 2.20e+05 | 1.64e+12 | 1.17e+08 | 6.13e+05 | 4.08e+12 | 4.64e+06 | 7.91e+05 | 6662s | | Random (Bergstra & Bengio, 2012) | 5.12e+10 | 2.08e+07 | 2.19e+05 | 1.70e+12 | 1.16e+08 | 5.94e+05 | 5.16e+11 | 3.59e+06 | 8.30e+05 | 4403s | | GAMMA (Kao & Krishna, 2020) | 2.11e+09 | 7.63e+05 | 1.14e+05 | 2.31e+11 | 1.19e+07 | 6.62e+05 | 9.67e+09 | 2.95e+05 | 8.56e+05 | 5253s | | DCP (Ours) | 8.88e+06 | 9.66e+04 3.51e+03 7.18e+07 | 4.64e+05 1.01e+04 5.70e+07 | 1.31e+05 1.72e+04 | 3606s | | | | | | Table 1: Performance of optimized dataflow for different optimization methods on several DNN models. Each method is performed multiple times with different optimization objectives. et al., 2017), and a dropout (Srivastava et al., 2014) of 0.1 is also applied to mitigate the over-fitting of each layer. Note that a linear projection layer is used to project the input to the feature with the size of 512. It is then reshaped to the size of 8 × 64 where '8' is the token length and '64' is the hidden size. Moreover, each prediction head is instantiated by a single attention layer with an output size of 1. In total, this projector has 0.4M parameters and 1M FLOPs. Hence, the training cost of the predictor is almost negligible. Training Details. The loss function for training the predictor is generated by three HW metrics (i.e., latency, energy, and power), as shown in Fig.4, considering that both running time and energy consumption are critical for efficient dataflow design. Let G denote the loss function. The training loss L is given by design. Let $\mathcal{G}$ denote the loss function. The training is $$\mathcal{L}=\sum_{i=1}^{M}\mathcal{G}(P_{i},R_{i})\,\text{and}\,P_{i}=\mathcal{F}(\theta_{e},\theta_{i};[x,y])$$ $$\quad(1)$$ G(Pi, Ri) and Pi = F(θe, θi; [*x, y*]) (1) where M is the number of HW metrics and M = 3 in our case. Pi and Ri are log-scaled predicted and ground-truth values of the i-th metric. x and y are the code representations of the DNN layer and accelerator dataflow respectively. In implementation, G is log-cosh function as written by G(*P, R*) = log(cosh(P − R)). The predictor is trained on the benchmark in Sec. 4.1 where 80% and 20% data are used as training and validation sets. In addition, we use Adam optimizer (Kingma & Ba, 2015) with parameter β = (0.9, 0.999) and ϵ = 1e − 3. The predictor is trained for 50 epochs with initial learning 1e − 2 and weight decay 1e − 7. The regression performance of our neural predictor is shown in Fig. 5. It can be seen that the predictor can predict various metrics given dataflow and the DNN layer. ## 4.3 Dataflow Code Optimization After training the neural predictor, the dataflow optimization becomes ultra-fast by back-propagating along the direction of target metrics' gradients. As shown in Fig.4, the predictor will forward an initial dataflow code to obtain predicted performance metrics Pi. To minimize (maximize) a metric, we set the target value of the metric as R′i = Pi − 1 (R′i = Pi + 1). Then the weight of the predictor will be fixed to perform the back-propagation with respect to the code of dataflow, returning an optimized dataflow after a certain number of iterations. We investigate optimizing dataflow from layer-level, model-level, and multi-objective perspectives. Layer-level Dataflow Propagation. The layer-level dataflow propagation aims to search optimal dataflow for each layer in a given deep model. Let {xl} L l=1 be the code representations of all layers in the model where L is the number of layers. The layer-level dataflow optimization is derived by gradient descent. For all l ∈ [L], or **a**-vector quantum optimization is derived by gradient descent: For an $\tau\in[\Sigma]$, $$y_{t}^{t+1}=y_{t}^{t}-\eta\frac{\partial G(\mathcal{F}(\theta_{c}^{\text{fix}},\theta_{t}^{\text{fix}};[x_{t},y]),R_{t}^{\prime})}{\partial y}|_{y_{t}^{t}}\tag{2}$$ where t = 0, 1 · · · , T − 1 is the iteration index, η is the stepsize, θ fix e and θ fix irepresent fixed encoder and prediction head of i-th metric, respectively. Note that Eqn.(2) cannot guarantee that the searched dataflow satisfies the HW constraints, such as the integer requirement of memory. Hence, two modifications are adopted. Firstly, we round the searched dataflow every Tint iteration to obtain dataflow parameters with the | MobileNet-V2 (Sandler et al., 2018) | | ResNet101 (He et al., 2016) | | ViT (Dosovitskiy et al., 2020) | | | | | | |----------------------------------------------------------------------------|----------|-------------------------------|---------------|----------------------------------|----------|-------------------|----------|----------|----------| | Method | EDP | Latency | Energy | EDP | Latency | Energy | EDP | Latency | Energy | | (cycles * nJ) | (cycles) | (nJ) | (cycles * nJ) | (cycles) | (nJ) | (cycles * nJ) | (cycles) | (nJ) | | | NVDLA (nvd, 2018) | 5.51e+11 | 1.46e+07 | 1.15e+06 | 5.60e+13 | 1.84e+08 | 2.94e+07 | 1.66e+16 | 4.31e+09 | 4.51e+07 | | Eyeriss (Chen et al., 2017) | 1.34e+12 | 2.33e+07 | 1.71e+06 | 2.28e+14 | 3.92e+08 | 3.93e+07 | 1.96e+15 | 2.53e+08 | 5.37e+07 | | ShiDianNao (Du et al., 2015) | 2.99e+11 | 5.26e+06 | 1.85e+06 | 8.00e+13 | 1.20e+08 | 4.48e+07 | 2.40e+15 | 1.73e+08 | 5.71e+07 | | NAAS (Lin et al., 2021) | 1.09e+10 | 9.23e+05 | 3.85e+05 | 5.56e+10 | 2.67e+07 | 1.39e+06 | - | - | - | | DCP (Ours) | 6.64e+08 | 7.12e+05 1.19e+04 | 5.96e+09 | 9.96e+06 5.12e+04 | 6.33e+09 | 2.12e+06 6.55e+04 | | | | | '-' denotes the corresponding data are not mentioned in the relevant paper | | | | | | | | | | Table 2: Dataflow performance of DCP, NAAS, and a suite of DNN accelerators with fixed dataflow. DCP's dataflow is searched by model dataflow propagation, and it is fixed for every DNN model. | | Single Objective | | | | Multiple Objective | | | |-------------------------------------------------|--------------------|----------|----------|------------------|----------------------|--------------|----------| | Target | Latency | Energy | EDP | Latency + Energy | Latency + EDP | Energy + EDP | | | Latency (cycles) | 9.66e+04 | 3.91e+05 | 9.83e+04 | 1.04e+05 | 1.10e+05 | 2.21e+05 | | | MobileNet-V2 (Sandler et al., 2018) Energy (nJ) | 5.49e+03 | 3.51e+03 | 4.69e+03 | 4.85e+03 | 4.75e+03 | 3.88e+03 | | | EDP (cycles * nJ) 1.02e+07 | | 2.77e+07 | 8.88e+06 | 1.05e+07 | 1.11e+07 | 1.92e+07 | | | Latency (cycles) | 4.64e+05 | 2.20e+06 | 5.01e+05 | 5.29e+05 | 5.28e+05 | 1.31e+06 | | | ResNet101 (He et al., 2016) | Energy (nJ) | 1.76e+04 | 1.01e+04 | 1.41e+04 | 1.45e+04 | 1.41e+04 | 1.08e+04 | | EDP (cycles * nJ) | 7.88e+7 | 3.00e+08 | 7.18e+07 | 8.26e+07 | 8.16e+07 | 1.94e+08 | | | Latency (cycles) | 1.31e+05 | 8.76e+05 | 1.39e+05 | 1.76e+05 | 1.73e+05 | 1.88e+05 | | | ViT (Dosovitskiy et al., 2020) | Energy (nJ) | 2.80e+04 | 1.72e+04 | 1.88e+04 | 2.07e+04 | 2.18e+04 | 1.99e+04 | | EDP (cycles * nJ) 7.28e+07 | | 3.39e+08 | 5.70e+07 | 8.24e+07 | 8.67e+07 | 8.59e+07 | | Table 3: DCP's performance of dataflow optimized for single and multiple objectives. Multi-objective optimization includes the pairwise combination of all objectives in single-objective optimization. integer. Secondly, a min-max clip strategy is used for the dataflow code of every sub-cluster to ensure that its parameters do not exceed the value of its parent cluster and also limit the overall HW resource within the constraints of Eyeriss (Chen et al., 2017) Chip. Model-level Dataflow Propagation. Although the layer-level dataflow propagation is optimal, it can only be implemented when dataflow is configurable in an HW accelerator. To alleviate this limitation, we also perform the model-level dataflow propagation by accumulating the propagation gradient of all layers within the target DNN model: $$y^{t+1}=y^{t}-\eta\sum_{l=1}^{L}\frac{\partial\mathcal{G}(\mathcal{F}(\theta_{e}^{\mathrm{fix}},\theta_{i}^{\mathrm{fix}};[x_{l},y]),R_{i}^{\prime})}{\partial y}|_{y^{t}}.$$ $\eqref{eq:walpha}$ ∂y |yt . (3) The summation means that the layer with a larger number would affect the dataflow update more than the smaller ones. By Eqn.(3), DCP can search for the best dataflow that is optimized for all layers within a DNN model simultaneously. Multiple Objective Propagation. In HW design, we often need to trade-off between latency and energy consumption. To this end, we also use multiple objective propagations to search dataflow, which can be expressed by: $$y_{l}^{t+1}=y_{l}^{t}-\eta\sum_{i=1}^{M}\lambda_{i}\frac{\partial{\mathcal G}({\mathcal F}(\theta_{e}^{\mathrm{fix}},\theta_{i}^{\mathrm{fix}};[x_{l},y]),R_{i}^{\prime})}{\partial y}|_{y_{l}^{t}}.$$ (4) $$\begin{array}{l}\small\text{(4)}\end{array}$$ . where PM i=1 λi = 1 uses the weighted average of the gradients of target metrics to perform the back-propagation. Since DCP is fast enough, we can obtain optimal {λi}M i=1 by grid search. The summation of gradients in Eqn.(4) helps find dataflow configurations that can trade off multiple HW metrics better. As DCP is a search method based on the neural predictor, we can leverage the power of GPU to perform the grid search of lambda. And the total time cost of the grid search for one multi-objective combination is around 75 seconds. ## 5 Experiments In this section, we first present our experiment settings in Sec.5.1. Then, we evaluate our proposed DCP technique in dataflow customization from the perspective of per-layer optimization in Sec.5.2, per-model optimization in Sec.5.3 and multi-objectives optimization in Sec.5.4. Lastly, optimizations for unseen HW settings are also performed to show the generalization of DCP in Sec.5.5. Besides the aforementioned experiment, an investigation of the optimization for a realistic HW platform and an ablation study for the design decision of DCP are shown in Appendix.B and Appendix.5.6 respectively. ## 5.1 Experiment Settings We consider three representative DNN models with different topology architectures and complexity, i.e. MobileNet-V2 (Sandler et al., 2018), ResNet101 (He et al., 2016), and Vision Transformer (ViT) (Dosovitskiy et al., 2020). We evaluate the following optimization methods as the baseline. (i) Random Search: The random search samples the design points randomly and keeps the best solutions. (ii) Genetic Algorithms (GA): In this baseline, we consider a general GA (Goldberg, 1989) and GAMMA (Kao & Krishna, 2020), a specifically designed GA for optimizing the dataflow. (iii) Nevergrad: The rest of our baseline methods are implemented in an optimization algorithm platform Nevergrad (Rapin & Teytaud, 2018), including Particle Swarm Optimization (PSO) (Marini & Walczak, 2015), Passive Portfolio (McMillan et al., 2011), (1 + 1) Evolution Strategy (OnePlusOne) (Igel et al., 2006), Covariance Matrix Adaptation-ES (CMA) (Hansen et al., 2009), Differential Evolution (DE) (Vodopija et al., 2018), and Test-based Population-Size Adaptation (TBPSA) (Poláková et al., 2017). ## 5.2 Per-Layer Dataflow Optimization We first perform the per-layer dataflow optimization to evaluate DCP's performance in searching for the optimal dataflow for each DNN layer within a model and guide the dataflow design of reconfigurable accelerators. In per-layer optimization, DCP and the baseline methods search the optimized dataflow for every layer within a DNN model. All optimization methods in our evaluation are performed multiple times with different objectives (EDP, latency, and energy), and the detailed performance is summarized in Table 1. Comparison of HW Metrics. In Table 1, we chose EDP as the target objective because it is a wellestablished metric in the literature like NAAS (Lin et al., 2021), and we aimed to ensure that our results could be compared to those of other state-of-the-art approaches. We set 10K samples as the searching constraint of baseline methods, as we observed that the baseline methods could converge on most DNN Layers after evaluating 10K samples. However, for every selected model, some methods are hard to find any good solutions within 10K trials. This observation also reflects the data efficiency of DCP as our neural predictor is trained on a dataset with 2K samples for each DNN layer and does not need to evaluate any more samples in back-propagation. For the optimization performance, DCP outperforms all the baseline methods with several orders of magnitude in various HW metrics of MobileNet-V2, ResNet101, and ViT. Comparison of Time Cost. We further compare the time cost of DCP and other baseline methods in searching the optimal dataflow for all evaluation metrics of all three selected DNN models. As baseline methods perform dataflow searching and evaluate it with the cost model simultaneously, the time cost of DCP is inclusive of three parts, which are dataset collection, training predictor, and dataflow search. Although GPU can accelerate DCP by leveraging the differentiable property of back-propagation, we perform the dataflow search of DCP and other baseline methods on CPU (i5-12500H) for a fair comparison. From Table 1, we see that our DCP is more efficient than other baseline search algorithms. Note that DCP separates the dataflow searching from the data collection, and the searching can be ultra-fast once the neural predictor is trained. Hence, the advantage in the time cost of DCP can be enlarged when more models and HW metrics are evaluated. ## 5.3 Per-Model Dataflow Optimization Compared with reconfigurable accelerators that can utilize a better dataflow for each DNN layer, DNN accelerators designed with a fixed dataflow still dominate in existing accelerators which makes it essential to optimize dataflow for the whole DNN model. And unlike prior arts, DCP can search the optimal dataflow for both DNN layers and an entire DNN model. In model dataflow optimization, we search for the optimal dataflow of three well-known DNN models based on three different metrics (e.g., EDP, latency, and energy). We further compare the performance of DCP searched dataflow with the dataflow of three well-known stateof-the-art DNN accelerators, which are NVDLA (nvd, 2018), Eyeriss (Chen et al., 2017), ShiDianNao (Du et al., 2015) and the dataflow searched by NAAS (Lin et al., 2021). NAAS is a co-design algorithm that targets the same HW platform as ours, and it also performs an experiment that only searches the dataflow in its paper. As is shown in Table 2, DCP outperforms the DNN accelerators' best performance in all evaluation metrics. Analysis of Searched Dataflow Design. An example of the model dataflow searched for MobileNet-v2 is shown in Fig. 3. The searched design improves the performance of running MobileNet-V2 by leveraging its computation and storage characteristics. Mobilenet-v2 widely uses depthwise layers, and it is more efficient to explore parallelism in dimensions of input/output channels Li et al. (2022). In specific, the searched design comprises one L2 cluster and seven L1 clusters optimized for parallelization in the output channel dimension. Each L1 cluster consists of 24 PEs that perform computation parallelized over the input channel dimension and prior to performing temporal computation over the output channel dimension. Additionally, the searched dataflow also features a data buffering strategy that prioritizes buffering data in the row/column of activations dimension. This design can leverage the characteristics of depthwise convolution and weight distribution in MobileNet-V2 to minimize memory access. By contrast, NVDLA's computation in weight-stationary dataflow prioritizes parallelization primarily in the input/output channel dimension. However, it is crucial to note that the superior dimension in NVDLA's data buffering strategy is the row/column of the filter weight. This can result in the under-utilization of on-chip memory and inefficient computation in depthwise convolution-dominated operations, such as MobileNet-v2. ## 5.4 Optimizing Dataflow For Multiple Objectives. Unlike the other baseline methods, DCP can optimize the dataflow for both single and multiple objectives as introduced in Sec 4.3. In the following experiments, we optimize three metrics in both single objective and multiple objectives optimization with the pairwise combination of the three metrics. The selected three objective HW metrics are latency, energy, and EDP, and the detailed experimental data are summarized in Table 3. As it is shown in Table 3. Although optimizing dataflow for multiple objectives cannot achieve the best performance in corresponding metrics compared with single objective optimization, it can achieve comparable performance in multiple metrics simultaneously. For example, compared with optimizing dataflow only for energy, optimizing dataflow for both energy and EDP can significantly improve the performance of latency and EDP while still having a comparable energy consumption. ## 5.5 Optimizing Dataflow For Unseen Hw Settings. In this experiment, we execute DCP in zero-shot or few-shot unseen HW settings to evaluate the generalization of DCP. Initially, the neural predictor is trained with a dataset that randomly sampled 2K dataflows for each DNN layer under the HW setting of Eyeriss chip (Chen et al., 2017), which is 168 PEs and 108KB on-chip memory. In zero-shot settings, we execute DCP with this original neural predictor. Then in the few-shot settings, we fine-tune the neural predictor with a dataset that randomly sampled 200 dataflows for DNN layers within the previous dataset under the corresponding unseen HW settings. The selected unseen HW settings share the same on-chip memory as the Eyeriss chip but with different PEs. As demonstrated in Fig. 6, DCP in the zero-shot setting outperforms GAMMA (best baseline method performed in Sec 5.2) in MobileNet-V2, ResNet101, and ViT, while GAMMA needs to evaluate 10K samples from scratch for each DNN layer. Then for the few-shot setting, DCP can search the better dataflow after fine-tuning the neural predictor. ![11_image_0.png](11_image_0.png) Figure 6: Performance (EDP) on three DNN models of the dataflow searched on different HW settings. Three approaches are compared in this figure. "DCP zero-shot" denotes the dataflow searched with the neural predictor only trained on the 168 PEs, and "DCP few-shot" denotes the dataflow searched with the neural predictor tuned with 0.1× samples of corresponding PEs. "GAMMA" denotes the dataflow searched by the specifically designed GA algorithm, GAMMA (Kao & Krishna, 2020). Table 4: Performance of optimized dataflow on MobileNet-v2 for the prediction model trained with different predictor architecture and the numbers of dataflow sampled in each layer. | Methods | Predictor Architecture | Data Size | | | | | | |-----------|--------------------------|-------------|----------|----------|----------|----------|----------| | | NCP | DCP | 500 | 1000 | 2000 | 3000 | 4000 | | EDP | 2.33e+09 | 8.88e+06 | 4.84e+09 | 1.97e+09 | 8.88e+06 | 8.65e+06 | 6.44e+06 | ## 5.6 Ablation Study In this section, we further conduct some ablation experiments for the impact of two design decisions of DCP, which is inclusive of i) the dataflow sampled in each layer, and ii) the architecture of the neural predictor. The detailed experiment results are depicted in Table 4. And our experimental analysis is performed on MobileNet-v2, utilizing the Energy-Delay Product (EDP) as the objective metric. In Table 4, we first ablate the choice of the neural predictor's network architecture. We make comparisons with the predictor architecture in NCP (Ding et al., 2021). The predictor in NCP employs Multilayer Perceptron (MLP) modules, whereas our predictor is primarily constructed using attention modules which have advantages in modeling relationships between input entries. We see that the attention-based predictor in DCP achieves better performance than the MLP-based predictor. Then, we conduct evaluations of the impact of the dataflow sampled at each layer. It can be seen that sampling 2000 dataflow codes for each layer are enough to produce good HW performance. ## 6 Conclusion In this paper, we present a differentiable back-propagation approach, DCP, to automatically search the optimal dataflow for DNN accelerators. Dataflow is crucial for designing a DNN accelerator, but identifying the best dataflow is challenging due to its massive design space. Therefore, we propose an encoding scheme to project the dataflow and DNN layer configurations into a unified coding representation and build a comprehensive benchmark. DCP can optimize dataflow for single/multiple layers and various optimization objectives. Our results show that DCP outperforms the existing dataflow optimization methods in both optimization performance and time cost. DCP also outperforms prior arts in zero-shot or few-shot manners without time-consuming simulations, while prior arts need to re-run the simulations from scratch for every search. ## References Nvdla deep learning accelerator. [online] Available: http://nvdla.org/primer.html, 2018. Intel habana gaudi accelerator. [online] Available: https://habana.ai/products/gaudi/, 2020. Torchvision. https://github.com/pytorch/vision/tree/v0.12.0-rc1, 2022. Mohamed S. Abdelfattah, Lukasz Dudziak, Thomas Chau, Royson Lee, Hyeji Kim, and Nicholas D. Lane. Best of both worlds: Automl codesign of a cnn and its hardware accelerator. In *2020 57th ACM/IEEE* Design Automation Conference (DAC), pp. 1–6, 2020. Vahideh Akhlaghi, Amir Yazdanbakhsh, Kambiz Samadi, Rajesh K. Gupta, and Hadi Esmaeilzadeh. Snapea: Predictive early activation for reducing computation in deep convolutional neural networks. In 2018 ACM/IEEE 45th Annual International Symposium on Computer Architecture (ISCA), pp. 662–673, 2018. Mohammed Al-Qizwini, Iman Barjasteh, Hothaifa Al-Qassab, and Hayder Radha. Deep learning algorithm for autonomous driving using googlenet. In *2017 IEEE Intelligent Vehicles Symposium (IV)*, pp. 89–96, 2017. James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. *J. Mach. Learn. Res.*, 13(1):281–305, feb 2012. Yu-Hsin Chen, Tushar Krishna, Joel S. Emer, and Vivienne Sze. Eyeriss: An energy-efficient reconfigurable accelerator for deep convolutional neural networks. *IEEE Journal of Solid-State Circuits*, 52(1):127–138, 2017. Yu-Hsin Chen, Tien-Ju Yang, Joel Emer, and Vivienne Sze. Eyeriss v2: A flexible accelerator for emerging deep neural networks on mobile devices. *IEEE Journal on Emerging and Selected Topics in Circuits and* Systems, 9(2):292–308, 2019. Kanghyun Choi, Deokki Hong, Hojae Yoon, Joonsang Yu, Youngsok Kim, and Jinho Lee. Dance: Differentiable accelerator/network co-exploration. In *2021 58th ACM/IEEE Design Automation Conference (DAC)*, pp. 337–342, 2021. Mingyu Ding, Yuqi Huo, Haoyu Lu, Linjie Yang, Zhe Wang, Zhiwu Lu, Jingdong Wang, and Ping Luo. Learning versatile neural architectures by propagating network codes. *arXiv preprint arXiv:2103.13253*, 2021. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale, 2020. Zidong Du, Robert Fasthuber, Tianshi Chen, Paolo Ienne, Ling Li, Tao Luo, Xiaobing Feng, Yunji Chen, and Olivier Temam. Shidiannao: Shifting vision processing closer to the sensor. In *2015 ACM/IEEE 42nd* Annual International Symposium on Computer Architecture (ISCA), pp. 92–104, 2015. Nael Fasfous, Manoj Rohit Vemparala, Alexander Frickenstein, Emanuele Valpreda, Driton Salihu, Julian Höfer, Anmol Singh, Naveen-Shankar Nagaraja, Hans-Joerg Voegel, Nguyen Anh Vu Doan, Maurizio Martina, Juergen Becker, and Walter Stechele. Auto-nba: Efficient and effective search over the joint space of networks, bitwidths, and accelerators. In 2021 38th International Conference on Machine Learning (ICML), pp. 238–243, 2021. Nael Fasfous, Manoj Rohit Vemparala, Alexander Frickenstein, Emanuele Valpreda, Driton Salihu, Julian Höfer, Anmol Singh, Naveen-Shankar Nagaraja, Hans-Joerg Voegel, Nguyen Anh Vu Doan, Maurizio Martina, Juergen Becker, and Walter Stechele. Anaconga: Analytical hw-cnn co-design using nested genetic algorithms. In *2022 Design, Automation & Test in Europe Conference & Exhibition (DATE)*, pp. 238–243, 2022. David E. Goldberg. *Genetic Algorithms in Search, Optimization and Machine Learning*. Addison-Wesley Longman Publishing Co., Inc., USA, 1st edition, 1989. Nikolaus Hansen, AndrÉ S. P. Niederberger, Lino Guzzella, and Petros Koumoutsakos. A method for handling uncertainty in evolutionary optimization with an application to feedback control of combustion. IEEE Transactions on Evolutionary Computation, 13(1):180–197, 2009. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016. Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, and Ross Girshick. Masked autoencoders are scalable vision learners. *arXiv preprint arXiv:2111.06377*, 2021. Mark Horowitz. 1.1 computing's energy problem (and what we can do about it). In 2014 IEEE International Solid-State Circuits Conference Digest of Technical Papers (ISSCC), pp. 10–14, 2014. Forrest N Iandola, Song Han, Matthew W Moskewicz, Khalid Ashraf, William J Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and <0.5mb model size. In *2017 International* Conference on Learning Representations (ICLR), 2017. Christian Igel, Thorsten Suttorp, and Nikolaus Hansen. A computational efficient covariance matrix update and a (1+1)-cma for evolution strategies. In Proceedings of the 8th Annual Conference on Genetic and Evolutionary Computation, GECCO '06, pp. 453–460, New York, NY, USA, 2006. Association for Computing Machinery. Liancheng Jia, Zizhang Luo, Liqiang Lu, and Yun Liang. Tensorlib: A spatial accelerator generation framework for tensor algebra. In *2021 58th ACM/IEEE Design Automation Conference (DAC)*, pp. 865–870, 2021. Norman P. Jouppi, Cliff Young, Nishant Patil, David Patterson, Gaurav Agrawal, Raminder Bajwa, Sarah Bates, Suresh Bhatia, Nan Boden, Al Borchers, Rick Boyle, Pierre-luc Cantin, Clifford Chao, Chris Clark, Jeremy Coriell, Mike Daley, Matt Dau, Jeffrey Dean, Ben Gelb, Tara Vazir Ghaemmaghami, Rajendra Gottipati, William Gulland, Robert Hagmann, C. Richard Ho, Doug Hogberg, John Hu, Robert Hundt, Dan Hurt, Julian Ibarz, Aaron Jaffey, Alek Jaworski, Alexander Kaplan, Harshit Khaitan, Daniel Killebrew, Andy Koch, Naveen Kumar, Steve Lacy, James Laudon, James Law, Diemthu Le, Chris Leary, Zhuyuan Liu, Kyle Lucke, Alan Lundin, Gordon MacKean, Adriana Maggiore, Maire Mahony, Kieran Miller, Rahul Nagarajan, Ravi Narayanaswami, Ray Ni, Kathy Nix, Thomas Norrie, Mark Omernick, Narayana Penukonda, Andy Phelps, Jonathan Ross, Matt Ross, Amir Salek, Emad Samadiani, Chris Severn, Gregory Sizikov, Matthew Snelham, Jed Souter, Dan Steinberg, Andy Swing, Mercedes Tan, Gregory Thorson, Bo Tian, Horia Toma, Erick Tuttle, Vijay Vasudevan, Richard Walter, Walter Wang, Eric Wilcox, and Doe Hyun Yoon. In-datacenter performance analysis of a tensor processing unit. In 2017 ACM/IEEE 44th Annual International Symposium on Computer Architecture (ISCA), pp. 1–12, 2017. John Jumper, Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf Ronneberger, Kathryn Tunyasuvunakool, Russ Bates, Augustin Žídek, Anna Potapenko, Alex Bridgland, Clemens Meyer, Simon A A Kohl, Andrew J Ballard, Andrew Cowie, Bernardino Romera-Paredes, Stanislav Nikolov, Rishub Jain, Jonas Adler, Trevor Back, Stig Petersen, David Reiman, Ellen Clancy, Michal Zielinski, Martin Steinegger, Michalina Pacholska, Tamas Berghammer, Sebastian Bodenstein, David Silver, Oriol Vinyals, Andrew W Senior, Koray Kavukcuoglu, Pushmeet Kohli, and Demis Hassabis. Highly accurate protein structure prediction with AlphaFold. *Nature*, 596(7873):583–589, 2021. Sheng-Chun Kao and Tushar Krishna. Gamma: Automating the hw mapping of dnn models on accelerators via genetic algorithm. In *Proceedings of the 39th International Conference on Computer-Aided Design*, ICCAD '20, New York, NY, USA, 2020. Association for Computing Machinery. Sheng-Chun Kao, Geonhwa Jeong, and Tushar Krishna. Confuciux: Autonomous hardware resource assignment for dnn accelerators using reinforcement learning. In *2020 53rd Annual IEEE/ACM International Symposium* on Microarchitecture (MICRO), pp. 622–636, 2020. Reiya Kawamoto, Masakazu Taichi, Masaya Kabuto, Daisuke Watanabe, Shintaro Izumi, Masahiko Yoshimoto, and Hiroshi Kawaguchi. A 1.15-tops 6.57-tops/w dnn processor for multi-scale object detection. In 2020 2nd IEEE International Conference on Artificial Intelligence Circuits and Systems (AICAS), pp. 203–207, 2020a. Reiya Kawamoto, Masakazu Taichi, Masaya Kabuto, Daisuke Watanabe, Shintaro Izumi, Masahiko Yoshimoto, Hiroshi Kawaguchi, Go Matsukawa, Toshio Goto, and Motoshi Kojima. A 1.15-tops 6.57-tops/w neural network processor for multi-scale object detection with reduced convolutional operations. IEEE Journal of Selected Topics in Signal Processing, 14(4):634–645, 2020b. Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. *CoRR*, abs/1412.6980, 2015. Hyoukjun Kwon, Ananda Samajdar, and Tushar Krishna. Maeri: Enabling flexible dataflow mapping over dnn accelerators via reconfigurable interconnects. *SIGPLAN Not.*, 53(2):461–475, mar 2018. Hyoukjun Kwon, Prasanth Chatarasi, Michael Pellauer, Angshuman Parashar, Vivek Sarkar, and Tushar Krishna. Understanding reuse, performance, and hardware cost of dnn dataflow: A data-centric approach. In *Proceedings of the 52nd Annual IEEE/ACM International Symposium on Microarchitecture*, MICRO '52, pp. 754–768, New York, NY, USA, 2019. Association for Computing Machinery. Guoqing Li, Jingwei Zhang, Meng Zhang, Ruixia Wu, Xinye Cao, and Wenzhao Liu. Efficient depthwise separable convolution accelerator for classification and uav object detection. *Neurocomputing*, 490:1–16, 2022. Yuhong Li, Cong Hao, Xiaofan Zhang, Xinheng Liu, Yao Chen, Jinjun Xiong, Wen-mei Hwu, and Deming Chen. Edd: Efficient differentiable dnn architecture and implementation co-search for embedded ai solutions. In *2020 57th ACM/IEEE Design Automation Conference (DAC)*, pp. 1–6, 2020. Yujun Lin, Mengtian Yang, and Song Han. Naas: Neural accelerator architecture search. In 2021 58th ACM/IEEE Design Automation Conference (DAC), pp. 1051–1056, 2021. Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss (eds.), Computer Vision - ECCV 2018, pp. 122–138, Cham, 2018. Springer International Publishing. Federico Marini and Beata Walczak. Particle swarm optimization (pso). a tutorial. *Chemometrics and* Intelligent Laboratory Systems, 149:153–165, 2015. Collin McMillan, Mark Grechanik, Denys Poshyvanyk, Qing Xie, and Chen Fu. Portfolio: Finding relevant functions and their usage. In *Proceedings of the 33rd International Conference on Software Engineering*, ICSE '11, pp. 111–120, New York, NY, USA, 2011. Association for Computing Machinery. Angshuman Parashar, Minsoo Rhu, Anurag Mukkara, Antonio Puglielli, Rangharajan Venkatesan, Brucek Khailany, Joel Emer, Stephen W. Keckler, and William J. Dally. Scnn: An accelerator for compressed-sparse convolutional neural networks. In 2017 ACM/IEEE 44th Annual International Symposium on Computer Architecture (ISCA), pp. 27–40, 2017. Angshuman Parashar, Priyanka Raina, Yakun Sophia Shao, Yu-Hsin Chen, Victor A. Ying, Anurag Mukkara, Rangharajan Venkatesan, Brucek Khailany, Stephen W. Keckler, and Joel Emer. Timeloop: A systematic approach to dnn accelerator evaluation. In *2019 IEEE International Symposium on Performance Analysis* of Systems and Software (ISPASS), pp. 304–315, 2019. Radka Poláková, Josef Tvrdík, and Petr Bujok. Adaptation of population size according to current population diversity in differential evolution. In *2017 IEEE Symposium Series on Computational Intelligence (SSCI)*, pp. 1–8, 2017. Prajit Ramachandran, Barret Zoph, and Quoc Le. Swish: a self-gated activation function. 10 2017. J. Rapin and O. Teytaud. Nevergrad - a gradient-free optimization platform. https://GitHub.com/ FacebookResearch/Nevergrad, 2018. Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4510–4520, 2018. Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. *Journal of Machine Learning Research*, 15(56): 1929–1958, 2014. Cem Subakan, Mirco Ravanelli, Samuele Cornell, Mirko Bronzi, and Jianyuan Zhong. Attention is all you need in speech separation. In ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 21–25, 2021. Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V. Le. Mnasnet: Platform-aware neural architecture search for mobile. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2815–2823, 2019. Aljoša Vodopija, Tea Tušar, and Bogdan Filipič. Comparing black-box differential evolution and classic differential evolution. In *Proceedings of the Genetic and Evolutionary Computation Conference Companion*, GECCO '18, pp. 1537–1544, New York, NY, USA, 2018. Association for Computing Machinery. Jie Wang, Licheng Guo, and Jason Cong. Autosa: A polyhedral compiler for high-performance systolic arrays on fpga. In *The 2021 ACM/SIGDA International Symposium on Field-Programmable Gate Arrays*, FPGA '21, pp. 93–104, New York, NY, USA, 2021. Association for Computing Machinery. Yutaka Yamada, Toru Sano, Yasuki Tanabe, Yutaro Ishigaki, Soichiro Hosoda, Fumihiko Hyuga, Akira Moriya, Ryuji Hada, Atsushi Masuda, Masato Uchiyama, Tomohiro Koizumi, Takanori Tamai, Nobuhiro Sato, Jun Tanabe, Katsuyuki Kimura, Ryusuke Murakami, and Takashi Yoshikawa. 7.2 a 20.5tops and 217.3gops/mm2 multicore soc with dnn accelerator and image signal processor complying with iso26262 for automotive applications. In *2019 IEEE International Solid- State Circuits Conference - (ISSCC)*, pp. 132–134, 2019. Lei Yang, Zheyu Yan, Meng Li, Hyoukjun Kwon, Liangzhen Lai, Tushar Krishna, Vikas Chandra, Weiwen Jiang, and Yiyu Shi. Co-exploration of neural architectures and heterogeneous asic accelerator designs targeting multiple tasks. In *2020 57th ACM/IEEE Design Automation Conference (DAC)*, pp. 1–6, 2020a. Xuan Yang, Mingyu Gao, Qiaoyi Liu, Jeff Setter, Jing Pu, Ankita Nayak, Steven Bell, Kaidi Cao, Heonjae Ha, Priyanka Raina, Christos Kozyrakis, and Mark Horowitz. *Interstellar: Using Halide's Scheduling* Language to Analyze DNN Accelerators, pp. 369–383. Association for Computing Machinery, New York, NY, USA, 2020b. Amir Yazdanbakhsh, Christof Angermüller, Berkin Akin, Yanqi Zhou, Albin Jones, Milad Hashemi, Kevin Swersky, Satrajit Chatterjee, Ravi Narayanaswami, and James Laudon. Apollo: Transferable architecture exploration. *CoRR*, abs/2102.01723, 2021. Yanqi Zhou, Xuanyi Dong, Tianjian Meng, Mingxing Tan, Berkin Akin, Daiyi Peng, Amir Yazdanbakhsh, Da Huang, Ravi Narayanaswami, and James Laudon. Towards the co-design of neural networks and accelerators. In D. Marculescu, Y. Chi, and C. Wu (eds.), *Proceedings of Machine Learning and Systems*, volume 4, pp. 141–152, 2022. ## Appendix In the Appendix, we provide more details of dataflow and an experiment about performing DCP in a realistic HW platform in Sec. A and Sec. B, respectively. Additionally, an ablation study for the design decision of DCP is illustrated in Sec. C. ## A Dataflow Section 3 of the main paper provides a brief introduction of dataflow, and more details of dataflow are introduced in this section. Dataflow is the data communication pattern within DNN accelerators between the compute and memory elements. Dataflow affects the data reuse pattern, which is critical to the throughput and energy efficiency of the accelerator. ## A.1 Motivation Firstly, it has been shown that the energy cost of moving data exceeds the cost of computation (Horowitz, 2014). So understanding and optimizing dataflow is a critical component of DNN accelerator design as it directly determines how data is transferred between different levels of buffers in the memory hierarchy. Secondly, there are multiple data reuse opportunities in DNN accelerators, making dataflow design necessary. Two examples of data reuse taxonomy in DNN accelerators are multicasting and reduction. Multicasting. In running a DNN application, there are multiple opportunities to reuse data, like input tensor reuse and filter weight reuse, which can be leveraged by multicasting. Multicasting means reading a data point from a buffer only once and replicating it spatially or temporally. Spatial multicasting means delivering the data point to multiple spatial destinations (PEs), and it can reduce expensive memory access and data transfer to save energy and decrease latency. Temporal multicasting means delivering the data to multiple temporal destinations (same PE at different timestamps), and it has the same functionality as spatial multicasting. Reduction. Reduction means accumulating partial outputs spatially or temporally to get the destined output. For example, every convolution output accumulates multiple partial outputs by multiplication input tensors and weights. Spatial reduction means collecting these partial outputs from multiple spatial destinations, while temporal reduction means gathering them from multiple temporal destinations. ## A.2 Expression Specifically, we use three factors to describe a dataflow: parallelism, computation order, and partitioning size. Parallelism. Parallelism is about allocating the computation workload into the multiple hardware processing units and letting these processing units can perform the computation simultaneously. For DNN accelerators, the processing units are PEs, and it usually achieves parallelism via unrolling the loop nest of convolutional layers spatially. Computation order. Computation order is the temporal order of the dimensions to be performed in the multiply dimensional computation task. Different computation orders can exploit different data movement patterns and reuse opportunities. Partitioning size. As there are many parameters to the DNN application and the buffer of DNN accelerators is limited, accelerators with multi-level memory hierarchy will partition these parameters and allocate them into the buffer. In this process, partitioning size will determine the data size of each tensor (input/output/weight) that needs to be present within the accelerator's buffer at each timestamp. ## A.3 Example A simple 1-D convolution and its loop expression are shown in Figure 7. The loop shown in Figure 7b is timeconsuming as it only performs one multiplication and one add operation at each time step. Suppose we apply the parallelism to this 1-D Conv by unrolling the loop and using three processing elements simultaneously to ![17_image_0.png](17_image_0.png) perform the computation task. In that case, the 1-D Conv will be conducted as shown in Figure 7c. Figure 7: The computation process and loop expression of 1-D Conv. (a) An overview of the 1-D Conv process and W, I, and O represent the filter weight, input, and output activations, respectively. (b) The loop expression of the 1-D Conv process. (c) The loop expression of performing parallelism on 1-D Conv using three PEs. Then for the effect of computation order, it is illustrated in Figure 8. Stationary means the corresponding data stay the longest in the accelerator's buffer. As it is shown in Figure 8, "tmp" refers to one data in the accelerator's buffer, and different computation orders may result in different numbers of memory access for each tensor. Figure 8: Memory access on three different computation order patterns of performing 1-D Conv. As DNN accelerators have a multi-level memory hierarchy and a limited size buffer. Therefore, the data used in DNN applications may need to be partitioned before being transferred into the DNN accelerators and performing the computation. An example of partitioning the data used in 1-D Conv into different memory levels within the DNN accelerator is shown in Figure 9. In Figure 9, the data of input activation has been partitioned into smaller tiles and transferred into different memory levels. ## B Tensorlib As it is mentioned in Section 5, we can further generate synthetic circuits for the dataflow optimized by DCP, unlike prior arts only based on the performance simulators. To do this, we leverage Tensorlib (Jia et al., 2021), a spatial accelerator generation framework. More details are introduced in this section. We choose Tensorlib because it is open-sourced and also provides an elegant way to model the computation of accelerators, which is the Space-Time-Transformation (STT) matrix. ## B.1 Design Space To generate the dataflow satisfying the constraint of Tensorlib, we limit the search space of DCP with the design space of Tensorlib. The design space Tensorlib is mainly inclusive of three parts, which are buswidth, Space-Time Transformation (STT) matrix, and intrinsic size. Between the spatial accelerator and the memory, the is a data bus to transfer the data, and buswidth defines the width of this data bus in units of bits. Then, the STT matrix is a mean of expression to represent the hardware dataflow. And intrinsic size is used to ![18_image_0.png](18_image_0.png) (a) Accelerator memory levels - DRAM- int I[18]; int W[6]; int O[12]; –L2 buffer for (x2=0; x2 < 2; x2++) -L1 buffer for (x1=0; x1 < 3; x1++) -PE for (x0=0; x0 < 3; x0++) for (s=0; s < 6; s++) x' = x0 + x1*3 + x2*9 **for (s-0, s $\times$ 0, s $\times$ 0)** **x = x0 + x1 + x2 + x9** **O[x'] += W[s] + [x'+s]** ## (B) Partition Loop Figure 9: Data partitioning example. (a) An overview of the accelerator's memory level and input activation (I) data size in each level. (b) The loop expression of partitioning input activation on 1-D Conv. describe the size of the loop nest workload. As the spatial accelerator generated by Tensorlib targets the computation workload that can be described in a perfect nested loop. In executing such a computation workload, the PE array can be viewed as a hypercube, and the execution of hardware can be identified as a space vector and a time scalar indicating where and when the computation task is placed. In detail, for every point in the loop nest, the STT matrix can transform into the space-time vector in hardware execution using a matrix multiplication operation. Then this space-time vector can map loop instances to hardware spatially (coordinates in the PE array) and temporally (timestamp of execution). ## B.2 Example A detailed explanation of how we can get the space-time vector introduced in Sec B.1 is described in this section. Given a loop iteration in the loop nest x = [i, j, ... ]2 and an STT matrix, the execution space and time can be calculated as [p, t]2 = STT . x, where space vector p means the PE coordinates inside the PE array and time scalar t means the time step of execution. A simple example that targets the computation workload of 2D matrix multiplication is shown in Figure 10. What's more, we can get the upper bound and lower bound of PE coordinates and timestamp of execution by multiplying the intrinsic size and zero vector with the STT matrix and further calculating the size of the PE array and spatial accelerator's memory. ![18_image_1.png](18_image_1.png) Figure 10: Space-Time Transformation example with 2D matrix multiplication. ## B.3 Experiment To show the generalization of DCP, we build a benchmark of synthetic dataflow and DNN layer based on Tensorlib and then follow the workflow of DCP to search the optimal dataflow. After that, we generate the ![19_image_0.png](19_image_0.png) Figure 11: Layer-wise performance of DCP optimized dataflow and example dataflow provided by Tensorlib in the latency and energy consumption of MobileNet-v2. "WS" denotes the exemplary weight-stationary dataflow provided in Tensorlib. "NVDLA" denotes the dataflow of NVDLA (nvd, 2018) accelerate. "DCP" denotes the dataflow searched by DCP. synthetic circuit for the searched dataflow and perform a cycle-accurate simulation to show its performance. To build the benchmark for Tensorlib, We rebuild a new dataset that shares the same collection of DNN layers with the previous dataset but with 2K dataflows randomly sampled in the design space of Tensorlib. As the accelerator generated by Tensorlib has a fixed dataflow, we compare the performance of DCP-optimized dataflow with other fixed dataflow accelerators for a fair comparison. Fig. 11 compares the achieved layer-wise performance of the accelerator generated by the DCP-optimized dataflow and other exemplary dataflow provided in TensorLib. It is shown that a significant improvement is achieved by the dataflow optimized by DCP in both latency and energy consumption of MobileNet-V2. The exemplary dataflow provided in TensorLib is a kind of weight-stationary (WS) dataflow. It's worth noting that although many accelerators use WS dataflow, each of them may have some differences. For example, Google's TPU (Jouppi et al., 2017) and Intel's Gaudi (gau, 2020) are both custom-designed accelerators that use WS dataflow, but they have different architectures. TPU uses a unified on-chip memory to hold data, while Gaudi has a more fine-grained distributed memory architecture.
Review 1: Summary: This work introduces Dataflow Code Propagation (DCP), an approach to derive optimal dataflows for DNN layer, that take into account parallelization of the operations across processing units, partitioning over multiple memory levels, and order of the computations. The core idea is to train an attention-based network to predict relevant metrics (latency, energy, or their combination) based on the input dataflow encoding of a DNN layer, then iteratively obtain the optimal encoding subject to constraints and objectives. Results are evaluated on 3 separate DNN models (MobileNet-v2, ResNet101, ViT) and compared to several competing dataflow optimization frameworks. Strengths and Weaknesses: Strengths: - The topic of DNN runtime and energy consumption optimization, subject to HW constraints, is highly relevant - The text is well structured, clear, and easy to follow (despite grammatical errors, see Requested Changes) - Extensive comparison of results against several other dataflow optimization techniques and frameworks; reported results are quite impressive, with DCP outperforming competing methods by one order of magnitude of more across the evaluated metrics - The methodology also appears to be advantageous in terms of optimization runtime Requested clarifications and other comments: - To train the predictor, 2K DNN layers are randomly selected, and 2K random dataflows are samples per layer, requiring a total of 4M evaluations. Is this a one-time cost? How expensive is this operation? Is this cost included in the time cost estimates of Table 1? - When iterating on a frozen predictor to optimize the dataflow encoding (Fig. 4 and Section 4.3), is the newly obtained encoding used as input to the following iteration, at each step? If so, Fig. 4 could be modified to reflect this visually and the text could clarify this. - The work leverages the work by Ding et al. "Learning Versatile Neural Architectures by Propagating Network Codes" ICLR 2022, which introduced the use of design space search with codes and a trained neural predictor for Neural Architecture Search (NAS). While this work is referenced in Section 5.2 "Ablation Studies", it should be given more prominence as several core concepts overlap (herein applied on the distinct topic of dataflow optimization, and using an attention-based network instead of an MLP). Requested Changes: - Add comparison with Ding et al. to Section 2 "Related Work" - I would strongly recommend a revision of the manuscript, possibly with the help of a native speaker, as several grammatically incorrect expressions can be found throughout it Broader Impact Concerns: No specific concerns ================================================== Review 2: Summary: The paper proposes Dataflow Code Propagation (DCP), a method for automatically optimizing the dataflow in deep neural network layers, improving performance and efficiency. Specifically, DCP translates hardware dataflow configurations into a coding space for optimization. Additionally, it can adapt to new hardware configurations via zero-shot or few-shot learning, outperforming existing methods such as GAMMA. Experimental results on MobileNetv2, ResNet, and VIT models demonstrate DCP's improvements over baselines. Strengths and Weaknesses: # Strengths 1. Comprehensive summary of prior works: the prior work section covers general DNN accelerators, design space of DNN accelerators, simulators of DNN accelerators, and co-design of accelerators. The provided preliminary about the DNN accelerator is concise and clear. 2. New pipeline to get more efficient dataflows: while most existing works focus on searching for the best dataflows given the hardware resources or manually tuning it, this work proposes a new pipeline based on gradient back-propagation. Specifically, a DNN hardware efficiency metric predictor is first trained, and then the weights are fixed to update the input dataflow embeddings with the goal of getting the dataflow that can make the target metric smallest. 3. Impressive results: the optimized dataflow achieved much better (e.g., 100 times) efficiency performance as compared to baselines. # Weaknesses/Questions 1. The hardware efficiency metric used for training is obtained by simulators. How to justify that they can provide numbers that are very similar to the real devices? 2. NVDLA and Eyeriss are highly optimized for CNN workload. How did the authors change those accelerators for ViT workload? Is it fair to compare with NVDLA and Eyeriss when targeting ViT workload? It seems that the proposed method can achieve higher improvement on the ViT workload. 3. Although the proposed method is based on gradient backpropagation, it requires the background knowledge of DNN hardware accelerator. Thus, I am not sure whether TMLR is the best venue for it. Works focusing on applying deep learning to architecture are highly appreciated in the computer architecture area (e.g., https://arxiv.org/abs/2209.00188 best paper of MIRCO'22 about applying machine learning to Off-Chip Load Prediction). 4. Transferability to more complex DNNs: with DNNs are designed to be more complex (i.e., mixing different workloads and more inter-layer connections), will the proposed method still be able to provide better optimized dataflow than manually designed ones or other domain-specific dataflow optimization workflow. For example, there are some works focusing on mixing CNN and Transformer within the same layer (https://arxiv.org/abs/2004.11886). Meanwhile, some works find that inter-layer scheduling is also an important factor in the whole model's hardware efficiency (https://dl.acm.org/doi/abs/10.1145/3579371.3589048, https://arxiv.org/abs/2011.01302). Considering that this work only considers the hardware efficiency metric for each layer, how to change to consider inter-layer scheduling and the scalability to DNN with many inter-layer connections (e.g., https://arxiv.org/abs/1806.09055) may be a problem. Requested Changes: Please see the "Weaknesses/Questions" part. Broader Impact Concerns: No concern on the ethical implications of the work ================================================== Review 3: Summary: This paper presents a framework to automatically learn the optimal dataflow for hardware accelerators executing deep CNNs. The authors abstract each CNN layer into 7 key parameters and the hardware architecture as containing a memory hierarchy and an array of PEs. The authors further constrain the kind of operations (e.g., partitioning, re-ordering, etc) corresponding to each dataflow configuration. Based on such abstraction, the authors are able to formalize a coding scheme to represent possible dataflow and such coding is used as the input to the neural network predictor. The training of the predictor is based on a manually constructed benchmark via simulation. The inference of the predictor directly updates the coding so that the dataflow can be optimized under various target metrics. Experiments show that the automatically learnt dataflow achieves significantly better performance than manual design. Strengths and Weaknesses: Strengths + It is interesting to have a joint abstraction on the dataflow, CNN layer parameters and the target hardware. Such an abstraction enables a coding scheme which generates the predictor neural network's inputs. + The predictor is able to optimize multiple hardware objectives. This potentially makes the design more general and impactful. + The proposed design achieves significant performance improvement compared with baselines. Weaknesses - The proposed framework may only be applicable to some specific types of CNN models, execution algorithms, dataflow schemes and hardware architectures. For example, a lot of the hardware assumptions seem to be heavily based on a specific hardware chip, Eyeriss. For ASICs or FPGAs, the PEs and on-chip buffers can be flexibly organized, in a form not necessarily captured by Fig 2. Ideally, the parallelization can also be performed in a multi-level fashion but the encoding of DCP seems to only support a single level of unrolling. The hardware feasibility check for the generated dataflow is also following the constraints imposed by Eyeriss, which is restrictive. - For convolution layers, there is a rich set of literature focusing on hardware acceleration of fast convolution algorithms, such as frequency domain convolution [a] or Winograd convolution [b]. Accelerators for fast convolution algorithms may achieve much better performance than the original spatial convolution accelerators (as considered by this paper). Therefore, it is unclear whether this paper's contributions are significant if the proposed DCP does not incorporate fast convolution algorithms. - The paper is motivated by a huge design space consisting of all possible data flows. However, the challenges due to the size of the design space may be exaggerated. The paper shows an example of an O(10^36) design space. However, this space can be dramatically reduced by some simple condition checks and filtering. In addition, many works on ASIC and FPGA accelerators build accurate performance models that enable fast design space exploration. Since the CNN data has a fixed shape, the performance model should give a quite accurate estimation without the need of expensive simulation. - The baselines in experiments are quite old. There are many more recent works accelerating CNNs by customized dataflow. References: [a] Zeng et al., A Framework for Generating High Throughput CNN Implementations on FPGAs. In ACM/FPGA 2018 [b] Lavin et al., Fast Algorithms for Convolutional Neural Networks. In CVPR 2016 Requested Changes: * Please specify what kind of hardware architectures, CNN algorithms and partitioning / unrolling schemes can be supported by DCP. * Please describe how to perform hardware feasibility check for a new type of hardware. * Please include a discussion on accelerators for fast convolution algorithms. * Please include comparison with more relevant / recent baselines. Broader Impact Concerns: None that I am aware of. ================================================== Metareview: Recommendation: Reject Comment: All reviewers agreed that this submission has value. They unanimously agreed that the topic is of interest to the TMLR audience (although one reviewer suggested that a computer architecture venue might be an even better place to submit this work), that the reported results were extremely impressive, and that the text was generally well written, modulo some issues with incorrect English usage. The reviewers did, however, raise a number of points that, if addressed, would greatly improve the paper. Among these are the question of how specific the proposed DCP method is to the Eyeriss accelerator, whether or not the size of the search space is overstated in the paper because it can in practice be reduced via simple condition checks, the need for comparison against more current baselines, the extent to which the simulator results will transfer to actual hardware, whether the proposed method will work with more complicated network architectures, and the need to more clearly relate the work in the submission to prior work by Ding et al. in ICLR 2022. Regrettably, the authors did not take advantage of the response and discussion period, which is an integral part of the TMLR review process, to address these issues. ==================================================
# Referential Communication In Heterogeneous Communities Of Pre-Trained Visual Deep Networks Anonymous authors Paper under double-blind review ## Abstract As large pre-trained image-processing neural networks are being embedded in autonomous agents such as self-driving cars or robots, the question arises of how such systems can communicate with each other about the surrounding world, despite their different architectures and training regimes. As a first step in this direction, we systematically explore the task of *referential communication* in a community of heterogeneous state-of-the-art pre-trained visual networks, showing that they can develop, in a self-supervised way, a shared protocol to refer to a target object among a set of candidates. This shared protocol can also be used, to some extent, to communicate about previously unseen object categories of different granularity. Moreover, a visual network that was not initially part of an existing community can learn the community's protocol with remarkable ease. Finally, we study, both qualitatively and quantitatively, the properties of the emergent protocol, providing some evidence that it is capturing high-level semantic features of objects. ## 1 Introduction As state-of-the-art vision-processing deep networks start being deployed as components of real-life autonomous or semi-autonomous systems, the question arises of how such systems can communicate about the surrounding visual world, as seen through the lenses of their respective core visual components. Consider for example two industrial robots produced by different companies, or two self-driving cars from different makers, that need to coordinate about objects in their environment. One might be powered, say, by a ResNet convolutional net (He et al., 2016) trained on the ImageNet visual recognition challenge (Russakovsky et al., 2015), whereas the other might use a Vision Transformer trained with a self-supervised algorithm (Dosovitskiy et al., 2021; Caron et al., 2021). The set of object labels known to the two nets might differ (if labels are present at all), and, even when they coincide, the underlying categorization algorithms of the two nets might label the same object in different ways. Moreover, the original label set might not suffice to discriminate objects in the environment. For example, both nets might have been trained to categorize certain objects as *dogs*, but the current situation requires them to distinguish among multiple dog instances, or to denote an unfamiliar mammal neither network encountered at training time. Next, consider the scenario where a third system, relying on yet another visual network, is added to an existing "community" of systems that are already able to communicate. Do we need to develop a new communication protocol, or can the new agent quickly adapt to the one already in use? Could we eventually derive a universal protocol that any network-powered system could rapidly acquire? Note that, in the scenarios we are considering, the internal weights of the visual components might not be accessible for fine-tuning the network community as a single system, and, even if they were, this might be extremely costly or undesirable, as the core functionalities of the networks should not be altered. We begin to tackle the challenges we outlined by studying whether a set of diverse pre-trained visual networks, augmented with a light interface layer, can develop a shared protocol when faced with the core communicative task of *referring to a specific object* among a set of candidates (Skyrms, 2010). We are inspired by recent work on *deep net emergent communication* (Lazaridou & Baroni, 2020). However, we adopt a different perspective with respect to this line of research. Instead of designing *ad-hoc* architectures specifically optimized on the communication task, we look at emergent referential communication in communities of multiple pre-trained networks with heterogeneous architectures and training histories. After reviewing related work (Section 2) and presenting our general setup (Section 3), we delve into our experiments in Section 4. First, in Section 4.1, we show that it is indeed possible for sets of heterogeneous pre-trained networks to successfully converge on a referent through an induced communication protocol. In Section 4.2, we study *referential generalization*, showing that the developed protocol is sufficiently flexible that the networks can, to some extent, use it to refer to objects that were not seen during the training phase (the "unfamiliar mammal" case we discussed above), as well as to tell apart distinct instances of the same object (the "distinguishing between different dogs" case above). In Section 4.3, we consider instead *agent* generalization. We show that, given a community of networks that have been trained to communicate, it is faster for a new pre-trained network with a different architecture, training objective or training corpus to acquire the existing community protocol, than for the enlarged community to develop a new protocol from scratch. This suggests that we could use a small set of networks to develop a "universal" protocol, that can then be taught in a supervised way to new networks that require the envisaged communication functionality. In Section 4.4 we offer some qualitative and quantitative insights into the protocol, suggesting that the network populations have developed a single shared code, that is not (only) referring to low-level image features, but also to higher-level semantic concepts. The Conclusion (Section 5) takes stock of what we found, and discusses the way ahead. ## 2 Related Work Deep net emergent communication While there is a long tradition of work on communication emergence in communities of generic computational agents (e.g., Cangelosi & Parisi, 2002; Christiansen & Kirby, 2003; Wagner et al., 2003; Nolfi & Mirolli, 2020; Steels, 2012), there has recently been interest in the specific topic of *deep-net-based* emergent communication, with the aim to develop a protocol for autonomous information exchange between modern deep neural networks (Lazaridou & Baroni, 2020). Since the ability to refer to a specific object in a shared environment is seen as one of the core building blocks of communication, many studies in this area have focused on the *referential game* setup, where a sender network must send a message to a receiver network to help it discriminate a target object among a set of candidates (e.g., Lazaridou et al., 2017; Havrylov & Titov, 2017; Dessì et al., 2021). Inspired by human language, most work focusing on the referential game has been exploring a *discrete* communication setup in which the sender produces a symbol or a sequence of symbols. On the other hand, a continuous channel is often preferred in scenarios where agents have to tackle navigation-like tasks in environments featuring relatively few distinct referents (e.g., Foerster et al., 2016; Sukhbaatar et al., 2016; Tieleman et al., 2018; Kim et al., 2019; Singh et al., 2019). Carmeli et al. (2022) have recently shown that continuous communication outperforms discrete communication in the context of the referential game. As discrete communication imposes a non-differentiable bottleneck requiring special optimization techniques, we focus on the more natural continuous setup. We do however explore the effects of introducing a discrete channel in Appendix C. Larger human speaker communities lead to the emergence of better-behaved protocols (e.g., Raviv et al., 2019). Many studies have assessed the impact of community size in deep network language emergence (e.g., Tieleman et al., 2018; Cogswell et al., 2019; Graesser et al., 2019; Li & Bowling, 2019; Ren et al., 2020). It appears that community-based training leads to desirable properties such as systematicity and ease of learning, at least when relatively small populations of homogeneous agents are considered. However, Rita et al. (2022) and Chaabouni et al. (2022) have recently shown that, in large-scale setups and when appropriate controls are considered, population training by itself does not bring about any special benefit. In our case, we are not so much interested in whether population-based training *per se* improves communication, but rather in whether it is possible at all to develop a shared protocol that is usable by multiple heterogeneous pre-trained networks, and easy to learn for new networks added to a community. In typical population-based emergent communication studies, the networks in the population share the same architecture. Rita et al. (2022) looked at the effect of introducing sources of heterogeneity between senders and receivers, finding that using agents with different learning rates enhances population-based protocols. While encouraging, this result was based on varying a single hyperparameter of otherwise identical networks, still far from our community-of-heterogeneous-networks scenario. Representation similarity and model stitching Our work touches upon the issue of whether different neural networks share similar representations (e.g., Li et al., 2016; Morcos et al., 2018; McNeely-White et al., 2020). Some of the work on this topic adopts a method known as "model stitching," which consists in connecting intermediate layers of two models to measure their compatibility (Lenc & Vedaldi, 2019; Bansal et al., 2021). This can be seen a form of model-to-model communication. Moschella et al. (2023); Maiorca et al. (2023), in particular, have recently introduced an unsupervised method that allows heterogeneous encoder and decoder networks to be "stitched" together in a 0-shot manner, based on second-order object representations (objects are represented by their similarities to a set of reference objects). Applying this approach to our referential communication scenario is a very exciting direction for future work. Self-supervised learning for image classification Various self-supervised discriminative training approaches have used objectives very similar to the one of our referential game, in order to derive classifiers without relying on annotated data (Chen et al., 2020; Caron et al., 2021), sometimes explicitly conceptualizing the setup as a multi-agent system (Grill et al., 2020). Some of the questions that are discussed in this field are also relevant for us. For example Lavoie et al. (2023) studied the effect of sparsifying representations into a constrained space, showing it improves generalization on new datatsets (we tried their methodology as an alternative way to derive discrete message representations in Appendix C, but found it not competitive in our setup). While there are many similarities between our core methodology and self-supervised learning, our aim is fundamentally different: we are not trying to induce an image classifier from scratch without annotated data, but to let distinct pre-trained networks (typically already trained as image classifiers) share information. Our referential game is essentially a content-based image retrieval task, and in this sense our work is related to image retrieval using contrastive objectives (e.g., Wang et al., 2020b; El-Nouby et al., 2021). However, we do not train or fine-tune a full network to improve referent retrieval, but rather train shallow layers overlaid onto frozen networks with different architectures, and our emphasis, again, is on information sharing across networks. Multi-agent systems More broadly, our work fits into the wider area of multi-agent systems research, specifically cooperative learning and the decentralized POMDP setup (Panait & Luke, 2005; Oliehoek & Amato, 2016), a field in which there is also interest in the problem of optimizing the behavior of a diverse set of cooperating agents (e.g., Canaan et al., 2019). In the multi-agent decentralized learning domain, federated learning (e.g., McMahan et al., 2017; Lim et al., 2020) focuses on leveraging distributed model instances with different data sources to improve training. Like us, this domain focuses on communication efficiency and convergence of multiple agents (Wang et al., 2020a). However, we do not distribute training among a set of similar networks, focusing instead on multiple agents characterized by strong differences, and their ability to complete a communication task. ## 3 Setup 3.1 The Referential Communication Game Inspired by the core communicative task of *reference* (e.g., Skyrms, 2010), in the referential communication game a *sender* is given a target input (e.g., a picture) and issues a message (e.g., a word or, as in our case, a continuous vector). A *receiver* is exposed to a set of inputs, including the target, and must correctly point to the latter based on the message it receives from the sender. In our context, the sender and the receiver are neural networks that include pre-trained and frozen visual modules, plus wrapper components in charge of the message-passing interface. We refer to the full interacting systems as *agents*. In each episode of the game, the sender agent receives a target image as input, processes it with its visual module, and outputs a message to the receiver. The receiver gets the message and is presented | Table 1: Pre-trained visual architectures employed | | | | |------------------------------------------------------|-----------|----------------------------|------------| | Architecture | Type | Training | Parameters | | ResNet152 | CNN | Supervised ImageNet1k | 60.2M | | ResNet50 | CNN | Supervised COCO | 23.5M | | Inception | CNN | Supervised ImageNet1k | 27.2M | | VGG 11 | CNN | Supervised ImageNet1k | 132.9M | | ViT-B/16 | Attention | Supervised ImageNet1k | 86.6M | | ViT-S/16 | Attention | Self-supervised ImageNet1k | 21M | | Swin | Attention | Supervised ImageNet1k | 87.7M | with a set of candidate images, containing the target and a series of distractors. For every candidate image, the receiver, using its visual module, constructs a representation, which is then compared to a representation of the received message. The receiver selects whichever candidate has the most similar representation to the message. If the selected image matches the target, the episode is successful. Success above chance level is only possible if the receiver learns to correctly interpret the message sent by the sender. Pseudocode for the referential game is presented in Appendix A. Crucially, task accuracy only depends on target image matching, and does not require any kind of annotation. As such, the communication protocol is entirely learned in a self-supervised way. Below, we refer to the basic setup, in which a single sender-receiver pair is jointly trained to play the game, as the *one-to-one* setting, further distinguished into *homogeneous* and *heterogeneous* cases, depending on whether the two agents use the same or different visual modules for image processing. To extend the game to the *population* setting, given a population of N senders and receivers, we randomly sample one sender and one receiver at each step to play the game as previously described. ## 3.2 Agent Architectures And Training As mentioned, in our setup both sender and receiver are neural networks made up of a frozen vision module and light feed-forward layers used for communication (Fig. 1). ## 3.2.1 Pre-Trained Vision Modules As vision modules, we use widely used networks that have freely downloadable parameters (Table 1). We mainly consider architectural variations of networks trained with a supervised classification objective, as this is the most common axis of variation across modern models. In particular, we use both convolutional (*ResNet*: He et al. (2016), *Inception*: Szegedy et al. (2014), VGG: Simonyan & Zisserman (2015)) and attention-based networks (ViT: Dosovitskiy et al. (2021), *Swin*: Liu et al. (2021)), trained on ILSVRC2012 ImageNet data (Russakovsky et al., 2015). We however also include in our collection a ResNet (from Desai & Johnson (2021)) that was trained on a different dataset, namely COCO (Chen et al., 2015). The latter involves fewer labels as well as stronger data imbalance (Gauen et al., 2017). Finally, we include an attention-based network, DINO (Caron et al., 2021), that was trained on ImageNet, but using a self-supervised objective (denoted by its ViT-S/16 architecture in Table 1). The weights of the visual models are frozen (in blue in Fig. 1) and they are not modified at any point during our experiments. As output from the vision modules, we use their last layer, before the Softmax non-linearity is applied. Therefore, the vision module takes as input images and outputs vector representations of the images. While we are interested, by problem definition, in communication between *pre-trained* networks, whose visual processing abilities will largely derive from the pre-training phase, in Appendix B we try to assess to what extent the discrimination abilities that we'll see emerge in the agents are a simple by-product of pre-training. The results there suggest that this is not the case. ![4_image_0.png](4_image_0.png) Figure 1: Referential game setup and agent architectures. A target image is input to the sender, that extracts a vector representation of it by passing it through a pre-trained frozen visual network. This vector representation is fed to the feed-forward Communication Module, that generates a message consisting of another continuous vector, that is passed as one of the inputs to the Receiver. The receiver also processes each candidate image it gets as input by passing it through a pre-trained frozen visual network (which can have a different architecture from the one of the sender), obtaining a set of vector representations. These are fed to a Mapper Module, another feed-forward component that maps them to vectors in the same space as the sender message embedding. The Selection Module of the receiver simply consists of a parameter-free cosine similarity computation between the message and each image representation, followed by Softmax normalization. The receiver is said to have correctly identified the target if the largest value in the resulting probability distribution corresponds to the index of the target in the candidate array. Note that no parameters are shared between sender and receiver (except those of the frozen visual modules in the case in which the two agents are using homogeneous visual architectures). ## 3.2.2 Trainable Communication Components The second part of an agent's architecture consists in the layers devoted to handling communication. In both sender and receiver, all communication-related parameters are trainable, as shown in orange in Fig.1. In the sender, the communication module is a small linear feed-forward layer, with between 6k and 264k parameters. For comparison, the frozen vision modules in Table 1 all have more than 20M parameters. The communication module takes as input the image representation, and outputs a continuous vector we refer to as the *message* emitted by the sender. We ran a hyper-parameter search for message dimensionality (Appendix D). Since we found a ceiling effect, we decided to run all experiments with both the smallest (16) and the largest (64) size that reached peak validation performance. Note that, when we use the term *communication protocol* below, we refer to the deterministic inputconditioned message-emitting policy the sender converges to after training. In the receiver, the vision module is followed by a mapper module. Like the sender's communication module, it maps image representations to a new compressed state. The message from the sender is compared to these image representations. Following standard practice in the emergent communication literature, the comparison is conducted using the parameter-free cosine similarity measure. The receiver mapper module is larger than the sender communication component, being composed of two linear layers with a hidden dimension, as we adopted the architecture of Dessì et al. (2021) without further tuning. The number of parameters remains well below that of the pre-trained vision modules. As an example, VGG (132.9M parameters) is the vision module that has the largest output dimension, and therefore requires the largest mapper module, with 8.4 million parameters. Emergent communication research often adopts a discrete channel, as the latter more closely emulates human linguistic communication. We experimented extensively with a discrete interface, as reported in Appendix C. However, as discrete communication does not lead to clear advantages over continuous communication, and it involves a more involved and brittle optimization process, we focus here on the continuous interface we just described. ## 3.2.3 Training As the sender-receiver interface is continuous, the whole system can be straightforwardly trained by backpropagating the standard cross-entropy loss, obtained by comparing the receiver output to the ground-truth target. Batch size is set at 64, the largest value we could robustly fit in GPU memory. As we sample distractors directly from training batches, on each training step the referential game is played 64 times, once with every different image in the batch as target and the other 63 images serving as distractors. All experiments are implemented using the EGG toolkit (Kharitonov et al., 2019). All parameters needed to reproduce our experiments with the toolkit (both the continuous setup reported here, and the discrete one discussed in Appendix C) can be found in Appendix E. Evidence of training convergence is provided in Appendix F in terms of gradient evolution profiles. Appendix G reports results for variants of training in which we used image augmentations and hard distractors. ## 3.3 Datasets As nearly all agents rely on vision modules pre-trained on the ILSVRC2012 training set, we sample images from the validation data of that same dataset (50,000 images) to teach them to play the referential game, while reserving 10% of those images for testing (note that we do not use image annotations). We emphasize that our *ImageNet1k* communication training and testing sets are thus both extracted from the original ILSVRC2012 *validation* set. Agents are also tested on an out-of-domain (OOD) dataset containing classes from the larger ImageNet21k repository, as pre-processed by Ridnik et al. (2021). We selected the new classes among those that are neither hypernyms nor hyponyms of ImageNet1k classes, and we made sure that no OOD class had a Table 2: Percentage *accuracy* and *learning time* of agents playing the referential game. Learning time counts the number of epochs until maximum accuracy is reached (bigger numbers indicate slower convergence). Results are reported for two message dimensions. The *homogeneous* row reports mean scores and standard deviations across 7 pairs of same-architecture nets, each trained separately. The scores in the *heterogeneous* row are averaged across all 42 possible different-architecture pairings, each trained separately. Population accuracy is averaged across all 49 possible net pairings after joint training. There is no standard deviation around population learning time as we have a single jointly-trained population. Accuracy (16) Learning Time (16) Accuracy (64) **Learning Time (64)** Homogeneous 99.3 ± 0.8 9 ± 8 98.6 ± 2.9 6.5 ± 8.1 Heterogeneous 95.3 ± 3.4 7 ± 3 99.2 ± 1.1 9.7 ± 6.5 Population 96.8 ± 2.7 28 98.2 ± 2.2 24 WordNet path similarity score1 above 0.125 with any ImageNet1k class.2 We moreover used a number of heuristics, combined with manual inspection, to make sure the new classes were more or less at the same level of granularity as the ImageNet1k categories. After applying these filters, we were left with 52 classes denoting objects that belong to semantic domains disjoint from those represented in ImageNet1k, such as trees (olive tree, fir, *red pine*) and human professions (carpenter, physician, *organ grinder*). For each of them, we sampled all images available in the pre-processed ImageNet-21k dataset of Ridnik et al. (2021) (guaranteed to be at least 450). We further split the OOD data into a larger 90% set that is used for testing OOD communication accuracy (Section 4.2 below). We additionally train classifiers on this 90% partition for the experiments reported in Appendix H, using the remaining 10% of the OOD data to test them.3 ## 4 Experiments We will start our experimental report by comparing single agent pairs and larger communities in the straightforward setup in which test images depict new instances of referents used for communication training (Section 4.1). We will then look at protocol generalization along two axes: communicating about new *referents* (Section 4.2) and communicating with new *agents* (Section 4.3). ## 4.1 Referential Communication Of Homogeneous And Heterogeneous Networks Starting from the baseline scenario in which there are only one sender and one receiver with identical visual modules (one-to-one *homogeneous* setting), we look at the effect of pairing two *heterogeneous* architectures (one-to-one *heterogeneous* setting), and then scale up to training a full population of agents at once (*population* setting). The results are presented in Table 2. We observe first that it is possible to quickly train two homogeneous agents to near perfect referential accuracy (first row). Importantly, as shown in the second row of the table, pairing agents with different visual architectures only weakly affects accuracy and learning time, if at all. We conjecture that this ease of training in the heterogeneous setup is at least partially due to the fact that different architectures must ultimately extract comparable semantic features from images during pre-training, facilitating the task of making them communicate (although, as we will see below, there is no strong correlation between similarity of pre-trained visual module representations and communication performance). Detailed performance across all tested agent pairs is available in Appendix I, and we comment on some general patterns observed there in what follows. We focus here on agents trained with 16-dimensional messages, as with the 64-dimensional channel we are uniformly near the ceiling. Communication is easy for pairs that have different architectures. For example, communication between a ViT sender and a VGG receiver reaches 95% accuracy in 4 epochs. Communication is also easy for visual 1As implemented in the NLTK toolkit: https://www.nltk.org/. 2The COCO dataset, used to pre-train one of our visual modules, contains four labels slightly above the threshold, with maximum similarity at 0.17. 3We provide scripts to reproduce our ImageNet1k and OOD datasets at https://github.com/mahautm/emecom_pop_data 7 modules based on different training objectives: for example, ResNet-to-DINO communication reaches 98% accuracy in 12 epochs. It might look like communication is harder for pairs trained on different corpora, as 4/5 pairs requiring 10 or more epochs to train involve ResNet-COCO as the receiver agent. However, the latter also requires 29 epochs to converge in the homogeneous setup, suggesting that the (relative) issue with this module is the mismatch between its pre-training corpus (COCO) and the one used for communication training (ImageNet1k), rather than its heterogeneity with respect to the other agents.4 It is also possible to train the full agent population to very high accuracy in relatively few epochs (*Population* row in Table 2). In this setup, we use all 7 modules as both senders and receivers, randomly pairing them at training time, ensuring each agent interacts with every other agent. A common communication protocol emerges that is mutually intelligible across all 49 agent pairings. Note that the large increase in learning time compared to the one-to-one setups is only apparent, because during population training each agent is only seeing 1/7 of the data in each epoch.5 Thus, in terms of actual data exposure, a joint count of 28/24 epochs correspond to 4/3.3 effective epochs of data exposure for a single agent, on average. Convergence is thus faster on average in population training than in one-to-one training. We investigated whether the (generally small) differences in accuracy or learning time between agents with different visual modules is accounted for by the underlying discrepancy between their pre-trained visual representations. As different visual modules have different output dimension, we used RSA (Kriegeskorte et al., 2008) to measure the correlation between visual module output similarity and accuracy/learning time in communication training (measured for population pairs and one-to-one couplings, respectively). We did not find a significant correlation in either case, suggesting that communication training is quite robust to underlying visual representation differences. ## 4.2 Referential Generalization Having established with the previous experiment that it is possible to train a light communication layer that allows networks with heterogeneous architectures to successfully agree on a target referent, we go back to the questions about practical referent generalization we asked in the introduction. First, we explore whether the protocol can make more granular distinctions among objects coming from the same ImageNet1k class that were used to develop it. For these purposes, we built a special test set where all distractors are from the same ImageNet1k class as the target (so that, say, one target magpie needs to be distinguished from other magpies, instead of swans and bullfrogs). We tested all 1,000 ImageNet1k classes in smaller batches of 32 candidates, to ensure we had enough images in all cases. In this *single-class* setup, randomly choosing an image would put baseline accuracy at around 3.1%. Note that, since we are interested in out-of-the-box generalization, we use, zero-shot, the very same protocols induced with random distractors in the experiments above, without any special adaptation to the single-class setup. Table 3 shows that **communication is at least partially successful at a more granular level than** ImageNet1k classes, despite a large drop from the random-distractor performance reported above. There is a noticeable discrepancy between 16- and 64-dimensional messages, with the latter being generally better than the former, especially in the heterogeneous setup. We find this result intriguing, as we would have expected smaller message dimensionality to act as a regularizing bottleneck, leading to better generalization performance. Next, we ask whether a communication protocol can also generalize, zero-shot, to referents that were not seen at training time. In particular, the systems trained on the referential game using ImageNet1k data are now tested on the OOD dataset, that is entirely composed of new-class objects (see Section 3.3 above). As Table 3 shows, there is a significant accuracy drop (larger in the more challenging heterogeneous and population setups), but performance remains good enough to suggest that the protocol is at least to some extent able to generalize to images depicting referents not seen during training (recall 4The slightly larger average learning time and corresponding standard deviation in the homogeneous setup compared to the heterogeneous one are accounted for by the extra time it takes to train the ResNet-COCO sender-receiver pair. Note that, during heterogeneous training, at least one of the two agents is always ImageNet-based. 5In other words, Table 2 is comparing on the same scale the time it takes to train 2 agents in the one-to-one setups to the time it takes to train 14 agents in the population setup. | Table 3: Percentage accuracy on single-class and Out of Domain sets for both message dimensio | ns. | | | | |-------------------------------------------------------------------------------------------------|-------------|-------------------|------------|-------------| | Single-class (16) | OOD (16) | Single-class (64) | OOD (64) | | | Homogeneous | 47.2 ± 3.4 | 90.5 ± 8.0 | 47.4 ± 6.4 | 94.8 ± 10.4 | | Heterogeneous | 31.0 ± 22.2 | 62.9± 17.6 | 48.6 ± 2.1 | 82.2 ± 13.8 | | Population | 34.7 ± 6.8 | 72.2 ± 13.8 | 36.5 ± 8.6 | 72.2 ± 44.8 | that chance performance is here at 1/64 ≈ 1.6%). Larger dimensionality seems again to help generalization, at least in the homogeneous and heterogeneous setups. ## 4.3 Agent Generalization Having tested how well the protocol can be applied to new *referents*, we now consider whether it is possible to efficiently extend it to new *agents*, as in the practical scenario where a new autonomous device is added to an existing network of such items. In particular, we ask whether a new agent joining a community of agents already trained to communicate with each other can efficiently learn their communication protocol. To test ease of learning of a communication protocol, we add a single network, which we call the *learner* agent, to an existing community, either as sender or as receiver.6 This new agent has to play the referential game with the original agents and learn their protocol. To single out ease of learning of the communication protocol itself, and not the original agents' adaptability, we freeze all communication layer parameters except for the learner agent's. The new communication layer is therefore the only one being updated. The focus of this experiment is on the heterogeneous learners, where the new agent's vision module is different from that of the original agents. We nonetheless observe that, in the homogeneous case (not reported here), communication protocols are learned very quickly, needing at most one epoch to reach perfect or near-perfect accuracy. In the (heterogeneous) one-to-one setup, we train a communication protocol for each of the 49 possible different architecture pairs.7 For each pair, we then add a learner sender or a receiver for every vision module not in the original pair (e.g., if the protocol was trained on the ResNet152-Swin pair, we test, as both learner senders and receivers, Inception, VGG 11, ViT-B/16, ViT-S/16-DINO and Resnet50-COCO). In the population setup, the 7 possible leave-one-out populations of 6 different senders and 6 different receivers are trained on the referential game, and, for each, the learner agent will use the 7th vision module that was left out, acting as either sender or as receiver. Test accuracy and learning speed of the learner agents are reported in Fig. 2. In all runs with a 64-dimensional communication channel, **the learner agent succeeds at learning the communication protocol** with accuracy of at least 90%. There is some more variance with 16-dimensional messages, but in this case as well nearly all runs converge to very high accuracy. Receivers learn better and faster on average (94%/95% for one-to-one with 16/64-messages, respectively, and 96%/97% for population) than senders (88%/95%and 95%/97% respectively). The comparison between the one-to-one and population setups reveals no clear winner: population accuracy is on average higher than one-to-one accuracy with 16-dimensional messages but lower with 64-dimensional messages. Population accuracy, however, is more stable in both setups, showing very little variance from case to case. Regarding learning speed, **agents that learn a pre-existing communication protocol reach high** accuracy faster than it would take to retrain the whole population from scratch, as illustrated by the population-from-scratch baseline in Fig. 2. The communication protocol is indeed initially very easy to learn for a new agent. There is no clear difference in learning speed between the one-to-one and population setups. 6Alternatively, a single pair of agents could initially be trained, and then all other agents could be sequentially added to the growing community. As we obtain comparable results when adding each learner in turn to all possible network pairs or sextuples, we reasonably expect that this alternative setup would also lead to similar outcomes. 7These pairs also include homogeneous senders and receivers, but we will always add an heterogeneous agent to the pair. Figure 2: Test accuracy and learning speed of learner agents (left: 16-dimensional messages; right: 64- ![9_image_0.png](9_image_0.png) dimensional messages). Blue line: learning curve on test data for learner agent added to a communicating pair, averaged across all possible heterogeneous triples. Orange line: learning curve for learner agent added to an existing community, averaged across all possible leave-one-out cases. Vertical bars indicate standard deviation across cases. As a baseline for learning speed, the dashed green line shows the learning curve when training the whole 7x7 population at once from scratch. ## 4.4 Protocol Analysis Having shown its effectiveness, we turn now to a qualitative and quantitative examination of the emergent protocol. For this analysis, we focus on the overall better-performing 64-dimensional message setup. To start, some qualitative sense of what messages are expressing is conveyed by the examples in Figure 3 (further examples shown in Appendix J). These are representative cases of when the VGG 11 sender + ViT-B/16 receiver pair that was trained in the population setup failed to converge on the target. In a large majority of them, the wrongly selected image is depicting an entity from the same class as the target (first block of examples in the figure). The fact that often the relation is conceptual rather than perceptual (as in the second example of Figure 3, where the target is a drawing of a rocket, but the receiver picked a photograph of a rocket) suggests that agents are communicating about abstract categories, rather than low-level visual features. Of the minority of cases in which the wrongly selected image is not from the same class, some errors are relatively transparent, such as the ones in the second block of Figure 3, where we see similar shapes and textures in the target and in the wrongly picked distractor. Still, outside the frequent same-class errors, the most common case is the one illustrated by the last block of the figure, where the nature of the error is not clear. Such cases call for a more quantitative investigation of the protocol, which we will now discuss. We begin such investigation by applying the "Gaussian blobs" sanity test introduced by Bouchacourt & Baroni (2018). We check whether the agents trained to communicate on the ImageNet1k dataset are able, at test time, to play the referential game on blobs of Gaussian noise instead of genuine images. Success would mean the agents developed degenerate communication strategies, focusing on pixel-level image features that can transfer to the task of discriminating between blobs of Gaussian noise, rather than on more desirable high-level semantic information. We find that all one-to-one- and population-trained pairs are indeed at chance level on Gaussian blobs, suggesting they are not just communicating about low-level image features. To investigate further what image features are transmitted by the communication channel, we perform a set of perturbations affecting various aspects of the input images (an analysis of perturbations of the communication channel is reported in Appendix K). The effects of the perturbations on an example image are shown in Fig. 4. We perturb images from the ImageNet1k dataset that were seen by the agents during referential game training, where the receivers have perfect accuracy. In each experiment, we apply the same transformation to all images, both those seen by the sender and those seen by the receiver. Note that we test ![10_image_0.png](10_image_0.png) Figure 3: Examples from the ImageNet1k-based test set of mistakes made by a VGG 11 sender + ViT-B/16 receiver pair trained in the population setup. We also show an additional random distractor from the batch for context. Figure 4: Perturbation examples ![11_image_0.png](11_image_0.png) ![11_image_1.png](11_image_1.png) Figure 5: Accuracy after various image perturbations for the one-to-one and population setups. Gaussian blur was uniformly sampled within the [0.1,10] range. Mean accuracies and corresponding standard deviations are given across all 36 possible agent pairs. We add a small horizontal offset to the accuracy values for different perturbations to make them all visible. The horizontal lines connecting one-to-one and population accuracies for the same perturbation are meant to ease comparison between the two settings. Random baseline is 1.6% (randomly selecting one of the 64 images). senders and receivers that have been trained with non-corrupted images, and only face the perturbations at test time. Results for both the one-to-one and the population setups are reported in Fig. 5. All ablations affect accuracy. However, the color ablations (transforming the image to *grayscale* and *jittering colors*) and *resizing* the image are having a much smaller impact on performance than adding *Gaussian blur*. This is in line with our intuition about how much these changes should affect the ability to decode the contents of an image. As the example in Fig. 4 shows, color and size ablations don't normally affect the human ability to discriminate the object depicted in the image, whereas blurring the image can easily make its contents difficult to decode for us as well. We finally observe that all perturbation types affect one-to-one and population-trained agents in a similar manner, with population-trained agents being marginally more affected. Still, an important distinction in favor of population-based training is that in this setup, as shown in Fig. 6, the senders converge to using very similar messages to denote the same image, approximating a single protocol. Note that the observation is not trivial: the senders could in principle have developed very different protocols, with the receivers learning to process the union of these distinct protocols (we informally observed something of the sort taking place in the emergence of discrete population-based communication). Fig. 6 also shows that the distance between one-to-one senders, that have been trained independently of one another, is significantly larger on average than that between population-trained senders, and virtually indistinguishable from the baseline of averaging distances between messages representing different images for a single sender. Figure 6: Distributions of cosine distances between messages sent by two different senders for the same ![12_image_0.png](12_image_0.png) ImageNet1k training set images. The different senders are either trained in the heterogeneous one-to-one setup (blue) or in the same population (orange). As a baseline, the green boxplot shows distances between the messages produced for *different* input images by population-trained VGG 11 and ViT-B/16 senders. To further illustrate, and build upon, the observation that population training has converged to a single protocol, in Appendix H we report an experiment in which the common representations induced in this setting are used for zero-shot classifier transfer. ## 5 Conclusion Coming back to the questions we asked in the Introduction, we found that it is possible for agents based on pre-trained deep visual modules with different architectures, training objectives and training data, to induce a successful referential communication protocol through a self-supervised training procedure that only involves a light communication layer, without touching the visual module weights. The architectural extensions are simple and straightforward, suggesting that differing underlying pre-trained visual models already converged to similar representations. The networks can use the emergent protocol, to some extent, to communicate about referents that are only distinguishable at a more granular level than used during communication training; and they can, to some extent, communicate about referents coming from categories that were not seen during pre-training nor in the communication protocol induction phase. Importantly, we showed that a new deep net agent can successfully learn the protocol developed by an existing community, and that it can do so in less time than it would take to re-train the enlarged community including the new agent from scratch. This points to the possibility of developing a "universal" deep net protocol, that could be quickly taught to any new model before it is deployed in multi-network communication scenarios. We further found that the emergent protocol possesses a number of intuitive characteristics suggesting that it is focusing on semantic properties of the objects depicted in images, rather than on low-level visual features. Despite our encouraging set of initial results, clearly much work is still needed before the envisaged communication layer can be of practical use. First, we observed a drop in performance in the referent generalization experiments compared to communication about in-domain referents. Future work should further explore the generality of the protocol, and devise ways to broaden it. An intriguing direction for future work would be to include visual encoders trained on objectives that involve mapping images to natural language (e.g., Radford et al., 2021), as the representations of such encoders might embed positive biases inherited from language. We have motivated our study in terms of nets embedded in robots and self-driving cars. Such systems will not perceive the world as a discrete set of pictures, but rather as a fully embodied egocentric image flow. This scenario obviously poses further challenges. For example, two agents that need to communicate about an object would almost never have an identical view of it. How our approach could scale up to this setup is another important direction for future work. Referent denotation is an important building block of communication, but it's clearly just the starting point, and further work should extend deep net communication to other functions of language, such as highlighting different properties of objects, describing actions, and distinguishing between providing information, asking for it and giving instructions. These features will in turn require extending the setup to multiple exchanges, and to agents that can function both as senders and as receivers. ## References Yamini Bansal, Preetum Nakkiran, and Boaz Barak. Revisiting model stitching to compare neural representations. In *Proceedings of NeurIPS*, pp. 225–236, Online, 2021. Diane Bouchacourt and Marco Baroni. How agents see things: On visual representations in an emergent language game. In *Proceedings of EMNLP*, pp. 981–985, Brussels, Belgium, 2018. Rodrigo Canaan, Julian Togelius, Andy Nealen, and Stefan Menzel. Diverse agents for ad-hoc cooperation in Hanabi. In *Proceedings of CoG*, pp. 504–511, London, UK, 2019. Angelo Cangelosi and Domenico Parisi (eds.). *Simulating the evolution of language*. Springer, New York, 2002. Boaz Carmeli, Ron Meir, and Yonatan Belinkov. Emergent quantized communication. *CoRR*, abs/2211.02412, 2022. doi: 10.48550/arXiv.2211.02412. URL https://doi.org/10.48550/arXiv.2211. 02412. Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In *Proceedings of ICCV*, pp. 9650–9660, Online, 2021. Rahma Chaabouni, Florian Strub, Florent Altché, Eugene Tarassov, Corentin Tallec, Elnaz Davoodi, Kory Wallace Mathewson, Olivier Tieleman, Angeliki Lazaridou, and Bilal Piot. Emergent communication at scale. In *Proceedings of ICLR*, Online, 2022. Published online: https://openreview.net/group?id= ICLR.cc/2022/Conference. Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In Hal Daumé III and Aarti Singh (eds.), *Proceedings of the 37th* International Conference on Machine Learning, volume 119 of *Proceedings of Machine Learning Research*, pp. 1597–1607. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/chen20j.html. Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollár, and C. Lawrence Zitnick. Microsoft COCO captions: Data collection and evaluation server. *CoRR*, abs/1504.00325, 2015. Morten Christiansen and Simon Kirby (eds.). *Language Evolution*. Oxford University Press, Oxford, UK, 2003. Michael Cogswell, Jiasen Lu, Stefan Lee, Devi Parikh, and Dhruv Batra. Emergence of compositional language with deep generational transmission. https://arxiv.org/abs/1904.09067, 2019. Karan Desai and Justin Johnson. VirTex: Learning Visual Representations from Textual Annotations. In CVPR, 2021. Roberto Dessì, Eugene Kharitonov, and Marco Baroni. Interpretable agent communication from scratch (with a generic visual processor emerging on the side). In *Proceedings of NeurIPS*, Online, 2021. Published online: https://papers.nips.cc/paper/2021. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In *International* Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=YicbFdNTTy. Alaaeldin El-Nouby, Natalia Neverova, Ivan Laptev, and Hervé Jégou. Training vision transformers for image retrieval. http://arxiv.org/abs/2102.05644, 2021. Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In *Proceedings of NIPS*, pp. 2137–2145, Barcelona, Spain, 2016. Vincent Francois-Lavet, Peter Henderson, Riashat Islam, Marc Bellemare, and Joelle Pineau. An introduction to deep reinforcement learning. *Foundations and Trends in Machine Learning*, 25(3-4):1–140, 2018. Kent Gauen, Ryan Dailey, John Laiman, Yuxiang Zi, Nirmal Asokan, Yung-Hsiang Lu, George K. Thiruvathukal, Mei-Ling Shyu, and Shu-Ching Chen. Comparison of visual datasets for machine learning. In 2017 IEEE International Conference on Information Reuse and Integration (IRI), pp. 346–355, 2017. doi: 10.1109/IRI.2017.59. Laura Graesser, Kyunghyun Cho, and Douwe Kiela. Emergent linguistic phenomena in multi-agent communication games. In *Proceedings of EMNLP*, pp. 3700–3710, Hong Kong, China, 2019. Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Remi Munos, and Michal Valko. Bootstrap your own latent - a new approach to self-supervised learning. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), *Advances in Neural Information Processing Systems*, volume 33, pp. 21271–21284. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper_files/paper/2020/file/ f3ada80d5c4ee70142b17b8192b2958e-Paper.pdf. Serhii Havrylov and Ivan Titov. Emergence of language with multi-agent games: Learning to communicate with sequences of symbols. In *Proceedings of NIPS*, pp. 2149–2159, Long Beach, CA, 2017. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of CVPR, pp. 770–778, Las Vegas, NV, 2016. Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. *Neural Computation*, 9(8):1735–1780, 1997. Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with Gumbel-Softmax. In *Proceedings of ICLR Conference Track*, Toulon, France, 2017. Published online: https://openreview.net/ group?id=ICLR.cc/2017/conference. Eugene Kharitonov, Rahma Chaabouni, Diane Bouchacourt, and Marco Baroni. EGG: a toolkit for research on emergence of language in games. In *Proceedings of EMNLP (System Demonstrations)*, pp. 55–60, Hong Kong, China, 2019. Daewoo Kim, Sangwoo Moon, David Hostallero, Wan Ju Kang, Taeyoung Lee, Kyunghwan Son, and Yung Yi. Learning to schedule communication in multi-agent reinforcement learning. In *Proceedings of ICLR*, New Orleans, LA, 2019. Published online: https://openreview.net/group?id=ICLR.cc/2019/conference. Nikolaus Kriegeskorte, Marieke Mur, and Peter Bandettini. Representational similarity analysis: Connecting the branches of systems neuroscience. *Frontiers in Systems Neuroscience*, 2(4):1–28, 2008. Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Cifar-100 (canadian institute for advanced research), 2009. URL http://www.cs.toronto.edu/~kriz/cifar.html. Samuel Lavoie, Christos Tsirigotis, Max Schwarzer, Ankit Vani, Michael Noukhovitch, Kenji Kawaguchi, and Aaron C. Courville. Simplicial embeddings in self-supervised learning and downstream classification. In *ICLR*. OpenReview.net, 2023. Angeliki Lazaridou and Marco Baroni. Emergent multi-agent communication in the deep learning era. https://arxiv.org/abs/2006.02419, 2020. Angeliki Lazaridou, Alexander Peysakhovich, and Marco Baroni. Multi-agent cooperation and the emergence of (natural) language. In *Proceedings of ICLR Conference Track*, Toulon, France, 2017. Published online: https://openreview.net/group?id=ICLR.cc/2017/conference. Karel Lenc and Andrea Vedaldi. Understanding image representations by measuring their equivariance and equivalence. *International Journal of Computer Vision*, 127(5):456–476, 2019. Fushan Li and Michael Bowling. Ease-of-teaching and language structure from emergent communication. In Proceedings of NeurIPS, Vancouver, Canada, 2019. Published online: https://papers.nips.cc/paper/ 2019. Yixuan Li, Jason Yosinski, Jeff Clune, Hod Lipson, and John Hopcroft. Convergent learning: Do different neural networks learn the same representations? In *Proceedings of ICLR Conference Track*, San Juan, Puerto Rico, 2016. Published online: http://www.iclr.cc/doku.php?id=iclr2016:main. Wei Yang Bryan Lim, Nguyen Cong Luong, Dinh Thai Hoang, Yutao Jiao, Ying-Chang Liang, Qiang Yang, Dusit Niyato, and Chunyan Miao. Federated learning in mobile edge networks: A comprehensive survey. IEEE Communications Surveys & Tutorials, 22(3):2031–2063, 2020. Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 10012–10022, 2021. Chris Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. In *Proceedings of ICLR Conference Track*, Toulon, France, 2017. Published online: https://openreview.net/group?id=ICLR.cc/2017/conference. Valentino Maiorca, Luca Moschella, Antonio Norelli, Marco Fumero, Francesco Locatello, and Emanuele Rodolà. Latent space translation via semantic alignment. In *Thirty-seventh Conference on Neural Information Processing Systems*, 2023. URL https://openreview.net/forum?id=pBa70rGHlr. Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-Efficient Learning of Deep Networks from Decentralized Data. In Aarti Singh and Jerry Zhu (eds.), *Proceedings of the 20th International Conference on Artificial Intelligence and Statistics*, volume 54 of *Proceedings of Machine Learning Research*, pp. 1273–1282. PMLR, 20–22 Apr 2017. URL https://proceedings.mlr.press/v54/mcmahan17a.html. David McNeely-White, Ross Beveridge, and Bruce Draper. Inception and ResNet features are (almost) equivalent. *Cognitive Systems Research*, 59:312–318, 2020. Ari Morcos, Maithra Raghu, and Samy Bengio. Insights on representational similarity in neural networks with canonical correlation. In *Proceedings of NeurIPS*, Montreal, Canada, 2018. Published online: https: //papers.nips.cc/paper/2018. Luca Moschella, Valentino Maiorca, Marco Fumero, Antonio Norelli, Francesco Locatello, and Emanuele Rodolà. Relative representations enable zero-shot latent space communication. In *Proceedings of ICLR*, Kigali, Rwanda, 2023. Published online: https://openreview.net/group?id=ICLR.cc/2023/Conference. Stefano Nolfi and Marco Mirolli (eds.). *Evolution of communication and language in embodied agents*. Springer, Berlin, Germany, 2020. Frans Oliehoek and Christopher Amato. *A concise introduction to decentralized POMDPs*. Springer, Berlin, Germany, 2016. Liviu Panait and Sean Luke. Cooperative multi-agent learning: The state of the art. Autonomous Agents and Multi-Agent Systems, 11:387–434, 2005. Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In *Proceedings of ICML*, pp. 8748–8763, Online, 2021. Limor Raviv, Antje Meyer, and Shiri Lev-Ari. Larger communities create more systematic languages. *Proceedings of the Royal Society B: Biological Sciences*, 286(1907):20191262, 2019. Yi Ren, Shangmin Guo, Matthieu Labeau, Shay Cohen, and Simon Kirby. Compositional languages emerge in a neural iterated learning model. In *Proceedings of ICLR*, Online, 2020. Published online: https: //openreview.net/group?id=ICLR.cc/2020/Conference. Tal Ridnik, Emanuel Ben-Baruch, Asaf Noy, and Lihi Zelnik. ImageNet-21K pretraining for the masses. In *Proceedings of NeurIPS Datasets and Benchmarks Track*, Online, 2021. Published online: https: //datasets-benchmarks-proceedings.neurips.cc/paper/2021. Mathieu Rita, Florian Strub, Jean-Bastien Grill, Olivier Pietquin, and Emmanuel Dupoux. On the role of population heterogeneity in emergent communication. In *Proceedings of ICLR*, Online, 2022. Published online: https://openreview.net/group?id=ICLR.cc/2022/Conference. Joshua Robinson, Ching-Yao Chuang, Suvrit Sra, and Stefanie Jegelka. Contrastive learning with hard negative samples. In *Proceedings of ICLR*, Online, 2021. Proceedings at: https://openreview.net/ group?id=ICLR.cc/2021/Conference. Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition challenge. *International Journal of Computer Vision*, 115(3):211–252, 2015. Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In *Proceedings of ICLR Conference Track*, San Diego, CA, 2015. Published online: http://www.iclr. cc/doku.php?id=iclr2015:main. Amanpreet Singh, Tushar Jain, and Sainbayar Sukhbaatar. Learning when to communicate at scale in multiagent cooperative and competitive tasks. In *Proceedings of ICLR*, New Orleans, LA, 2019. Published online: https://openreview.net/group?id=ICLR.cc/2019/conference. Brian Skyrms. *Signals: Evolution, learning, and information*. Oxford University Press, Oxford, UK, 2010. Luc Steels (ed.). *Experiments in Cultural Language Evolution*. John Benjamins, Amsterdam, the Netherlands, 2012. Sainbayar Sukhbaatar, Arthur Szlam, and Rob Fergus. Learning multiagent communication with backpropagation. In *Proceedings of NIPS*, pp. 2244–2252, Barcelona, Spain, 2016. Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. http://arxiv.org/abs/ 1409.4842, 2014. Olivier Tieleman, Angeliki Lazaridou, Shibl Mourad, Charles Blundell, and Doina Precup. Shaping representations through communication. https://openreview.net/pdf?id=HkzL4hR9Ym, 2018. Kyle Wagner, James Reggia, Juan Uriagereka, and Gerald Wilkinson. Progress in the simulation of emergent communication and language. *Adaptive Behavior*, 11(1):37–69, 2003. Jianyu Wang, Qinghua Liu, Hao Liang, Gauri Joshi, and H Vincent Poor. Tackling the objective inconsistency problem in heterogeneous federated optimization. *Advances in neural information processing systems*, 33: 7611–7623, 2020a. Xun Wang, Haozhi Zhang, Weilin Huang, and Matthew Scott. Cross-batch memory for embedding learning. In *Proceedings of CVPR*, pp. 6388–6397, Online, 2020b. Ronald Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. ## A **The One-To-One Referential Game In Pseudocode** initialize sender and receiver for n training iterations do for batch of images b in training data do recdists = list() groundtruths = list() for image i in b do groundtruths.add(one-hot vector with 1 at i's index) sender receives i sender outputs message vector receiver receives message and b receiver processes message and each image in b to generate representations recdist = cosine between receiver representations of message and images in b recdist = softmax(recdist) recdists.add(recdist) end for compute cross-entropy loss CE between groundtruths and recdists backpropagation + update end for end for For the B images in a batch, the cross-entropy loss function is computed as follows: $$\mathbf{CE}=-\sum_{i=1}^{B}\sum_{j=1}^{B}r e c d i s t s_{i j}\log({\boldsymbol{g r o u n d t r u t h s_{i j}}})$$ In the population-based setup, all available senders and receivers are initialized at the beginning, and a sender and a receiver are randomly selected at each iteration of the second for loop. ## B **Using Visual Representations Without A Communication Layer** Our setup assumes that we need to connect networks that have already been pre-trained on visual tasks. While our main objective is to evaluate communication success, an interesting question is to what extent the communication layer is adding something non-trivial to what is already encoded in the pre-trained visual representations of the networks. To partially assess this, we attempted to directly play the game with "agents" that generated messaged directly from last-layer visual representations. For each network, we clustered all images using k-means, setting k to the ground-truth number of classes in the dataset. We then treated the k-means clusters as the "message" produced by the sender. The receiver would then randomly pick an image belonging to the correct cluster from the candidate set. As table 4 shows, in the homogeneous case where sender and receiver have the same architecture,8 k-means pairs achieve on average ImageNet1k and OOD performance well above chance level, but clearly lagging behind the networks that underwent communication training (performance > 98% and > 90% on these tasks, respectively). This confirms that the latter has enriched the networks with discrimination abilities that go beyond what's directly inherited from (mostly) supervised pre-training. 8For the heterogeneous case, where sender and receiver are different networks, we tested various ways to align the clusters on the training set, but performance was consistently scarcely above chance. Table 4: Percentage accuracy of agents evaluated on the ImageNet1k and OOD sets. Agents are unsupervised clusters of visual representations built using the k-means algorithm. ImageNet1k OOD Homogeneous 49.8 ± 17.9 21.2 ± 7.3 Table 5: Percentage accuracy and learning time of agents playing the referential game with discrete messages once both agents have reached convergence. Terminology as in Table 2. Accuracy Learning Time Homogeneous 78.2 ± 0.1 20 ± 1 Heterogeneous 71.1 ± 4.3 22 ± 2 Population 62.4 ± 3.2 23 ## C Discrete Experiments Building on intuitions from the deep net emergent communication literature, we studied whether imposing a discrete bottleneck would lead to a better, more general protocol than direct communication through a continuous channel. In a first experiment, we implemented a discrete bottleneck letting the agents exchange a one-hot vector, by optimizing it through the widely used Gumbel Softmax differentiable relaxation (Havrylov & Titov, 2017; Jang et al., 2017; Maddison et al., 2017), fixing vocabulary size (dimensionality of the message vector) to 256. Note that, when communication is discrete, a further decoder component is added to the receiver architecture, mapping the discrete messages back to the continuous space in which it can be compared to the candidate image representations. We did not find any evidence that the discrete bottleneck helps. Not only is the discrete protocol significantly less accurate than the continuous one (Table 5), but this low performance hides any trace of better generalization capabilities (Table 6). When generalizing a discrete communication protocol to a new agent (Figure 7), as done for continuous messages in Section 4.3, we observe convergence to a lower accuracy at a slower pace. Still, this setup confirms even more dramatically that less time is required to train a new agent to top accuracy than is needed to retrain a larger group from scratch. Specifically, the population trained from scratch would require 23 epochs to reach its best accuracy, whereas 5 epochs are sufficient to teach a new agent an already accurate protocol. The population training paradigm is more stable across architectures, as with continuous messages. In order to make sure that our negative results concerning discrete communication are not due to an unfortunate choice of hyperparameters, we repeated most experiments across a range of settings. We report here results for the more interesting population setup, but similar patterns are observed in one-to-one training. Table 7 shows that there is a small increase in accuracy when enlarging vocabulary size (compared to the results obtained with 256-dimensional messages reported in tables 5 and 6 above), but performance is still well below that of the continuous case even when using a vector as large as 8192 dimensions (compared to 16 dimensions in the continuous case). Note that using vocabulary sizes below 256 (not shown in the table) led to failure to converge to non-random accuracy. We also considered replacing Gumbel Softmax optimization with the commonly used policy gradient REINFORCE algorithm for fully discrete optimization (Williams, 1992). Gumbel Softmax (Table 7) proved to be the more effective training strategy. Switching to REINFORCE (Table 8) causes accuracy to drop to near-chance levels. REINFORCE allows a straightforward implementation of multi-symbol autoregressive communication, where we let the sender and receiver produce/parse symbol sequences by replacing their communication encoding/decoding components with a recurrent LSTM network (Hochreiter & Schmidhuber, 1997). We set maximum message length to 10 symbols. Performance of this multi-symbol approach stays capped at 1.6% accuracy, which corresponds to the random baseline. Table 6: Percentage accuracy on single-class and OOD test sets for discrete communication Single-class Out of Domain Homogeneous 13.2 ± 4.1 43.2 ± 5.0 Heterogeneous 16.0 ± 6.2 29.1 ± 4.3 Population 8.9 ± 2.1 25.8 ± 4.5 Figure 7: Test accuracy and learning speed of discrete learner agents. Blue line: learning curve on test ![20_image_0.png](20_image_0.png) data for learner agent added to a communicating pair, averaged across all possible heterogeneous triples. Orange line: learning curve for learner agent added to an existing community, averaged across all possible leave-one-out cases. Vertical bars indicate standard deviation across cases. As a baseline for learning speed, the dashed green line shows the learning curve when training the whole 7x7 populations at once from scratch. We conjectured that the overall disappointing performance of discrete communication is due to the difficulty of optimizing agent coordination when the error gradient cannot be passed through the discrete channel. We thus tried the *simplicial* embeddings from Lavoie et al. (2023), as this approach results in nearly discrete representations while not requiring discrete-channel optimization. We applied the method on top of the continuous linear layer, which maps the vision module representation space to message space (16 dimensions). We cut the 16 dimensions into 2, 4 or 8 groups of 8, 4 or 2 vectors respectively, and apply a softmax nonlinearity within those groups, before concatenating everything back to 16 dimensions. The number of groups had very little impact on results, and led to the same average performance. Accuracy with both in-domain and Table 7: Percentage accuracy of agents evaluated on the two ImageNet-based validation sets in function of vocabulary size. Agents were trained with Gumbel Softmax in a population setup. Vocabulary size ImageNet1k OOD 512 62.1 26.8 1024 66.8 31.1 2048 71.7 32.1 4096 74.3 33.4 8192 78.5 35.2 Table 8: Percentage accuracy of agents evaluated on the two ImageNet validation sets. Agents were trained with REINFORCE in a population setup. Vocabulary size ImageNet1k OOD 256 5.6 3.9 512 3.4 2.4 1024 3.3 2.1 2048 2.8 1.6 4096 2.4 1.8 8192 2.2 2.1 Table 9: Percentage accuracy of agents evaluated on the two ImageNet validation sets. Agents were trained with simplicial embeddings. ImageNet1k OOD Homogeneous 84.4 ± 15.4 63.9 ± 17.7 Heterogeneous 82.2 ± 5.9 45.6 ± 12.3 Population 62.7 ± 3.4 24.9 ± 11.1 out-of-domain datasets is reported in Table 9, and it remains below that of plain continuous communication, without the expected boost in generalization abilities. If using a discrete channel is considered a priority (for example, because it might lead to a more interpretable protocol), other discrete optimization techniques could also be explored, such as more advanced policy gradient methods (Francois-Lavet et al., 2018), or quantization approaches such as the one recently proposed by Carmeli et al. (2022) (although we tried something similar, with less-than-encouraging results, in Appendix K). ## D Hyperparameter Search For Continuous Communication Since, following standard practice, we are using the ILSVRC2012 validation partition for testing (the ILSVRC2012 test partition is not available), we rely on a separate dataset, namely CIFAR100 (Krizhevsky et al., 2009), for hyperparameter tuning. The two main hyperparameters to consider in continuous communication are the size of the continuous message, and the non-linearity applied to it. We performed multiple grid searches to determine the best and most efficient combination, through referential game experiments run on CIFAR100. Table 10 shows accuracy at epochs 1 and 25 of an agent pair based on the Inception vision module. On our validation set, all dimensions between 16 and 64 reach perfect accuracy. We thus decided to run the main experiments with both the smallest (16) and largest (64) dimensionalities in this range. We leave it to future work to explore even larger dimensionalities. We remark, however, that one of our desiderata is to keep the communication module small, and increasing dimensionality inevitably expands the size of the module. We also note here that dimensionalities smaller than 16 still manage to carry a lot of information. We are above the random chance level of 1/64 ≈ 1.6% even with 2 dimensions. The sigmoid non-linearity has a small margin over softmax (clearer in the smaller dimensions, where there is no ceiling effect), and we thus pick the former for the main experiments. ## E Experiment Hyperparameters All hyperparameters required to reproduce the continuous (main-text) experiments using the EGG toolkit are provided in Table 11. Hyperparameters for discrete experiments (Appendix C) are in Table 12. Table 13 has hyperparameters for the REINFORCE experiments (Appendix C). Each experiments was conducted using a single NVIDIA A30 GPU. Table 10: Grid search reporting percentage accuracies for different message dimensions and non-linearities in an Inception-to-Inception referential game on cifar100 data. Non-linearity Sigmoid Softmax Dimensions Epoch 1 Epoch 25 Epoch 1 Epoch 25 2 5.8 14.1 13.4 12.0 4 40.2 73.8 32.6 67.3 8 97.1 99.7 94.2 98.7 16 100 100 100 99.9 32 100 100 100 100 64 100 100 100 99.8 Table 11: Hyperparameters for training continuous communication channels. Hyperparameters batch size 64 optimizer Adam learning rate 1e-4 max message length 1 non linearity sigmoid vocab size 16 / 64 receiver hidden dimension 2048 image size 384 receiver cosine temperature 0.1 ## F Gradient Evolution During Training We verify convergence by providing evolution of the loss of individual continuous learners throughout training in Figure 8 (the same is true for discrete learners, around 4 times slower), also finding that receivers go through higher norm weight modification than senders during the initial stages of learning, as previously noted by Rita et al. (2022). ## G **Augmentations And Hard Distractors** We consider two training strategies commonly used in self-supervised learning: image augmentation and hard distractors. Dessì et al. (2021) showed that augmentations are crucial to develop non-degenerate protocols when training deep agents from scratch to communicate. We faithfully follow their data augmentation Table 12: Hyperparameters for training discrete communication channels using the Gumbel Softmax. Hyperparameters batch size 64 optimizer Adam learning rate 1e-4 max message length 1 vocab size 8192 receiver hidden dimension 2048 image size 384 gumbel softmax temperature 5 gs temperature decay 1 update gs temp frequency 1 mimimum gs temperature 1 receiver cosine temperature 0.1 Table 13: Hyperparameters for training discrete communication channels using REINFORCE. Hyperparameters batch size 64 optimizer Adam learning rate 1e-4 max message length 1 receiver hidden dimension 2048 image size 384 receiver cosine temperature 0.1 sender entropy coef 0.5 KL divergence coeff 0 Figure 8: Higher gradient norms result in bigger optimizer steps. Despite being in a multi-agent setup, both ![23_image_0.png](23_image_0.png) agents stably converge. Receiver and sender lines on the plot are averages across all possible continuous one-to-one experiments. pipeline, using their same hyperparameters. We stochastically apply crop-and-resize, color perturbation, and random Gaussian blurring to every image. Results for agents trained with data augmentations are presented in Table 14. In all experiments, including those that require generalizing out-of-domain, the agents trained with augmentations perform considerably worse than those trained without augmentations (compare to Tables 2 and 3 in the main text). We hypothesize that since, unlike Dessì et al. (2021), we are using pre-trained visual models that already abstract away from low-level features of the images, there is not further benefit in applying augmentation during the communication-training phase. At the same time, this phase only tunes a single layer, which implies that the models do not have a lot of power to adapt to the augmentations. This ends up making the task harder without bringing about better abstractions skills than those already acquired during pre-training. Table 14: Percentage accuracy of agents evaluated on the two ImageNet validation sets (64-dimensional communication channel). Agents were trained with data augmentation applied to sender and receiver inputs. No augmentation is applied at test time ImageNet1k Single-class OOD Homogeneous 90.2 ± 6.7 30.4 ± 8.2 61.2 ± 13.7 Heterogeneous 88.7 ± 5.1 30.2 ± 2.3 53.1 ± 13.3 Population 78.8 ± 40.8 19.3 ± 39.5 41.1 ± 49.2 Table 15: Percentage accuracy of agents evaluated on the two ImageNet validation sets (64-dimensional communication channel). Agents were trained on batches of 64 images with low cosine distance. ImageNet1k Single-class OOD Homogeneous 99.9 ± 0.2 47.6 ± 2.1 97.0 ± 2.2 Heterogeneous 97.1 ± 3.8 35.1 ± 9.6 68.0 ± 18.5 Population 63.7 ± 48.1 14.2 ± 8.5 30.9 ± 46.2 Table 16: Percentage accuracy of a linear classifier trained to classify objects in the OOD dataset using communication layer representations as input. Transfer accuracy is the average percentage accuracy for the same classification task when directly transfering the trained classifier to another agent from the population. Vision Module Accuracy Transfer Accuracy VGG 11 76.7 87.6 ± 2.1 Inception 84.6 89.5 ± 3.0 ResNet 152 85.2 82.8 ± 7.3 ViT-B/16 79.84 85.6 ± 6 ViT-S/16 DINO 85.1 88.5 ± 3.0 Swin 81.8 88.7 ± 2.8 ResNet50 COCO 90.4 87.3 ± 1.9 Another interesting idea we can borrow from self-supervised contrastive learning is that of choosing *hard* distractors at training time (Robinson et al., 2021). As we do not want to rely on data annotation, we use the cosine distance between a target image and the other images in the training set to find near distractors (we manually checked that this simple strategy does provide intuitively similar distractors). We create batches by randomly picking an image in the Imagenet1k dataset, and adding the 63 closest images. We repeat the process throughout training. Results are found in Table 15. While agents succeed in learning communication protocols to the same degree as in the original setup, they do not outperform it. In the Single-class case, where we could expect an improvement from training on similar images, heterogeneous pairs even perform slightly worse. We thus adopt the simpler and faster random batching approach for all experiments in the main text. ## H Exploiting The Communication Layer For Zero-Shot Classifier Transfer Besides our primary goal to study communication between heterogeneous networks, a learned shared protocol is appealing from a representation learning perspective (Tieleman et al., 2018). We illustrate the point here by showing how, through this independently learned representation, we can perform seamless zero-shot classifier transfer, a task that is related to recent literature on "model stitching" (see references in the *Representation* similarity and model stitching paragraph of Related Work (Section 2) of the main article). We consider a set of heterogeneous sender agents that have been population-trained to communicate on the ImageNet1k dataset. A single sender from the population is sampled and its output messages (64-dimensional vectors) are used to train a linear classifier on the OOD dataset classes. All agents reach good performance (Table 16) despite the fact that neither the communication layer nor the visual modules are further tuned to recognize the new out-of-domain classes. The very same classifier is then transferred, without any further tuning, to another sender, and its OOD classification performance is evaluated. As shown in Table 16, the transfer senders, despite never having been paired up with this classifier during training, reach accuracy comparable to that of the classifier tested with the sender it was trained on (in several cases, the transfer senders even outperform the original senders, possibly thanks to the quality of their visual components). Figure 9: Pairwise population communication accuracy and heterogeneous one-to-one learning time for every ![25_image_0.png](25_image_0.png) visual module (16-dimensional messages). The y axis denotes senders, the x axis receivers. A line separates CNNs from attention-based architectures. This positive result confirms that population-training leads to a single protocol shared by all senders, and it points to the usefulness of the communication layer as a compact shared representation for visual deep nets–an opportunity to be further explored in future work. ## I Visual-Module To Visual-Module Analysis In order to ensure that the high accuracy observed in terms of averaged population performance does not hide weaker communication for specific pairs, we checked every pair of agents' performance, and recorded them in Fig. 9. We present the accuracy matrix for the population setup when using 16-dimensional messages, since it is the one where we observe in general more variance from pair to pair, compared to the heterogeneous one, and to using 64-dimensional messages, where we observe a ceiling effect. Communication accuracy is consistently high, even across different architecture types (CNNs: VGG11, Inception, ResNet, ResNet-COCO, left of the line; attention-based: Swin, ViT-B and ViT-S (DINO), right of the line) or different training paradigms (DINO was self-supervised, ResNet-COCO was pre-trained on the COCO dataset, while all other agents used supervised pre-training on the ILSVRC2012 ImageNet dataset). The lowest accuracies are observed when comparing ResNet-COCO (a CNN pre-trained on COCO) to either ViT-B or DINO, two attention-based architectures, suggesting a compounding effect for differences both in architecture and pre-training corpus. Concerning training time, we report in Fig. 9 data for the heterogeneous one-to-one setup (population time is 28 epochs). Training times are generally low, with the two outliers involving ResNet-COCO. Note that one of these outliers is actually the homogenous ResNet-COCO-to-ResNet-COCO case, suggesting that we are observing a main effect of pre-training/communication-training corpus discrepancy, rather than issues arising when combining heterogeneous agents. ## J Further Communication Errors Further representative cases in which the 64-dimensional-message VGG 11 sender + ViT-B/16 receiver pair from the population setup failed to converge on the target are presented in Figures 10 and 11. The first sections of each figure are errors where the wrongly selected image is from the same class as the target. The transparent errors are examples where it is possible to guess the reason why the error arose, while the opaque errors are unclear as such, and would require some more investigation. ![26_image_0.png](26_image_0.png) Figure 10: Examples from the ImageNet1k-based test set of mistakes made by a VGG 11 sender + ViT-B/16 receiver pair trained in the population setup. We also show an additional random distractor from the batch for context. ![27_image_0.png](27_image_0.png) Figure 11: Examples from the ImageNet1k-based test set of mistakes made by a VGG 11 sender + ViT-B/16 receiver pair trained in the population setup. We also show an additional random distractor from the batch for context. Figure 12: Explained variance for a PCA across messages (left) and correlation of the different continuous ![28_image_0.png](28_image_0.png) dimensions (right) from a population setup. Messages were generated by senders exposed to the ImageNet1k test set. ## K Discretization And Other Channel Perturbations In the spirit of Carmeli et al. (2022), we wondered whether we could use an easy-to-optimize continuous channel at communication training time, but then discretize the messages at inference time, thus getting the "best of both worlds". We communication-trained the agents with dense continuous messages, but at evaluation time we discretized their messages by rounding the value of each continuous dimension in the message to either 0 or 1. On the ImageNet1k test set, performance fell to near chance levels for all investigated thresholds, in both population and one-to-one settings. Performance loss was also drastic when transforming both the 16 and 64-dimensional continuous message into a one-hot vector, using the maximum value as the "hot" value. The continuous messages thus seem to be genuinely dense. Indeed, further analysis showed that introducing Gaussian noise (e.g., µ = 0, σ = 0.05) in the messages during evaluation impacted performance negatively (22% accuracy loss). Very small changes in the message representation significantly changed the image the receiver would choose. That information is not sparsely encoded in the continuous vector dimensions, or in some latent combinations of them, is confirmed by a PCA analysis over 64-dimensional message space. The PCA eigenvalues are shown in Fig. 12. All PCA dimensions explain similar amounts of variance, with no dimension holding significantly more information. The figure also shows that there is no significant correlation between the original continuous vector dimensions, suggesting that they all carry independent information.
Review 1: Summary: This paper contributes by systematically exploring how diverse pre-trained visual networks autonomously develop shared communication protocols despite architectural differences, demonstrating their adaptability to unseen object categories and ease of protocol acquisition, while also analyzing the emergent protocol's properties, thereby advancing understanding of referential communication among heterogeneous networks. Strengths and Weaknesses: strengths: The topic of referential communication in heterogeneous communities of pre-trained visual deep networks is indeed intriguing. Exploring how these networks can develop shared communication protocols despite their varied architectures and training regimes offers valuable insights into the potential for autonomous agents to interact effectively. Weaknesses: The high accuracy achieved in the referential communication game task is quite surprising and noteworthy. It raises some questions: 1) how this work process of selecting candidate images, particularly negative images, and how they contribute to the referential communication task? 2) Any further insights into the strategies and processes involved in achieving this level of accuracy? 3) The paper mentions that nearly all agents rely on vision modules pre-trained on the ILSVRC2012 training set. It seems not a common assumption in the real world. It raises questions about the generalizability of the findings to agents trained on different data distributions. Requested Changes: 1. It would be beneficial for the paper to provide more details about the experimental setup, particularly regarding the selection process of negative candidates. 2. It could offer valuable insights into the robustness and adaptability of communication protocols across varying training data by exploring how agents trained on diverse datasets perform in the referential communication task. 3. Additional insights into the communication task would be appreciated. Broader Impact Concerns: N/A ================================================== Review 2: Summary: The paper studies referential communication between different pre-trained visual models. Given a set of images and two (frozen) vision models, lightweight adaptors are trained on top of the models to extract compact representations (“codes”) and the target is for the second model (“receiver”) to select the correct image based on these codes. The paper studies this setting in some detail and in particular, explores “population training” where many models are trained to communicate simultaneously. Strengths and Weaknesses: Pros: 1. An interesting and fairly original setting: communication research is not at all new, but this is an interesting take on it. 2. Fairly thorough experiments, including 1-to-1 and population training and experiments on introducing new models to an existing protocol 3. Reasonable analysis of generalization to other classes, perturbations Cons: 1. Some doubts/questions about the training protocol: 1a. “leading to 781 batches of 64 images” - this sounds like batches are fixed and not resampled during training, is that so? It would be quite strange and unconventional. 1b. It appears that no data augmentation has been applied at training time - that's also quite unconventional, why is it? It’s very standard practice and I don’t see how it would hurt, should only make communication more robust. It would be interesting to compare applying the same transformation to all images in a batch vs different transformations. 1c. It appears that training batches are sampled randomly? If so, given that ImageNet has many classes, a very simple strategy for the model would be to just communicate the class - as evidenced by the same-class experiment, this happens to a large degree. Why not sample batches at training time smarter, such that same-class examples are often seen during training and the model has to learn to communicate the differences? 2. Somewhat related, the selection of the code dimensionality to be 16 seems quite unjustified. Tuning the dimensionality of the code on CIFAR-100 seems strange given that all other experiments are on ImageNet - since CIFAR-100 is a simpler dataset, one might very well end up setting an overly low dimensionality? The interesting question to be investigated here is if there are downsides to low dimensionality, e.g. in terms of adaptation to new classes and new networks being added, or becoming very “low-level” (which, to some degree, is not necessarily such a bad thing, in my opinion). If not, why not just set it higher? 3. I'm surprised to see that there are no CLIP-style models in the list of so compared models, why is that? Adding those could be especially interesting since it might open doors to mapping the communication protocol to natural language. 4. Presentation issues. 4a. Wrong first author for the citation of the ViT paper (and it’s twice in the bibliography). 4b. Figure 1 - please increase resolution, at the moment looks unprofessional and somewhat difficult to read. 4c. Please add more qualitative examples. And it appears images are oversaturated in Figure 9? Please fix. 4d. The paper says color perturbations “don’t have a very strong effect on accuracy” - I wouldn’t agree here, in Figure 4 the accuracy seems to go from maybe 98-99% to maybe 93%, which is ~5x increase in error rate. And it’s even more for other perturbations. This is a very strong effect. 4e. “the population has truly developed a single protocol” is an overstatement: for sure the messages are much more similar than for one-to-one training, but still especially in some cases very different, >0.3 distance. Please tone down. 4f. The setting seems related to image retrieval, please discuss it in the paper. Requested Changes: Address the cons - clarify the training setup and very desirably fix/improve it - otherwise the presented results may be incomplete/misleading (Con 1) - perform experiments with larger dimensionality of the code - otherwise the presented results may be incomplete/misleading (Con 2) - address the presentation issues (Con 4) - (less crucial) consider adding a CLIP model to the comparisons Broader Impact Concerns: no specific concerns ================================================== Review 3: Summary: The paper investigates whether it is possible to learn a communication protocol for a community of pretrained visual models so that they can refer to a specific image within a set of images. In contrast to related works that consider pretrained models of the same architecture, this paper considers pretrained models of different architectures, sizes, and training methods. The paper proposes a simple method that achieves >95% accuracy on in-distribution images, while leaving room for improvement in out-of-distribution generalization. Strengths and Weaknesses: Strengths: - The paper is well written and easy to follow. - The topic of communication among heterogeneous pretrained models is interesting and well motivated. - The experiments present quite extensive analysis, including community types, generalization to difficult distractors and unseen images, and the possibility of incrementally adding agents to a trained community. Weaknesses: - Some observations made in the experiments can be strongly influenced by the pretrained model. The paper does not clearly separate the effects of the pretrained model and the added communication module. For example, regarding the limited generalization ability, is it because the pretrained model itself cannot generalize well, or because the low-dimensional protocol loses critical information? Regarding the “Gaussian blobs” test, one can also argue that it is because the pretrained model already captures high-level semantics and discards pixel-level details. - Some clarity issues: - Fig. 1 seems to be in low resolution, and becomes blurry when zoomed in. - It would be better to have an equation showing the training loss, and some pseudocode summarizing the training procedure. Requested Changes: Please see weaknesses, especially the first point. Broader Impact Concerns: N/A ================================================== Metareview: Recommendation: Reject Comment: The paper explores the task of referential communication in a community of heterogeneous pre-trained visual networks, aiming to develop a shared communication protocol despite varying architectures and training regimes. The study shows promising results in enabling these networks to refer to target objects among a set of candidates, generalize to previously unseen object categories, and integrate new networks into an existing community protocol. The research provides qualitative and quantitative evidence suggesting that the emergent protocol captures high-level semantic features of objects. This paper investigates a very novel and practically valuable topic. Proposing and exploring this new topic is one of the core contributions of this paper. The authors have also provided many seemingly interesting experimental setups, and some of the current experimental results suggest that this is a worthwhile direction of research. However, the paper has serious shortcomings in the sufficiency and completeness of the experiments, significantly differing from its claimed systematic experimentation. Regarding several innovative experimental setups, the descriptions in the paper are not clear enough, leading multiple reviewers to question the solidity of its conclusions. This raises significant concerns about the generalization and adaptability of the findings. In further work, the authors should pay special attention to the reproducibility of the experiments, as well as the presentation and clarity. They should also compare as many types of models as possible, including self-supervised learning models, CLIP-based models, and reinforcement learning models. The paper has a significant potential and contributes to a novel and important area of research. However, the issues highlighted by the reviewers are critical and must be thoroughly addressed to strengthen the validity and clarity of the findings. I invite the authors to revise the manuscript accordingly, addressing each of the weaknesses and requested changes in detail. Upon resubmission, the revised paper will be re-evaluated to ensure that the necessary improvements have been made. ==================================================
# Dataset Distillation In Large Data Era Anonymous authors Paper under double-blind review ## Abstract Dataset distillation or condensation aims to generate a smaller but representative subset from a large dataset, which allows a model to be trained more efficiently, meanwhile evaluating on the original testing data distribution to achieve decent performance. Previous decoupled methods like SRe2L simply use a unified gradient update scheme for synthesizing data from Gaussian noise, while, we notice that the initial several update iterations will determine the final outline of synthesis, thus an improper gradient update strategy may dramatically affect the final generation quality. To address this, we introduce a simple yet effective *global-to-local* gradient refinement approach enabled by curriculum data augmentation (CDA) during data synthesis. The proposed framework achieves the current published highest accuracy on both large-scale ImageNet-1K and 21K with 63.2% under IPC (Images Per Class) 50 and 36.1% under IPC 20, using a regular input resolution of 224×224. The proposed model outperforms the current state-of-the-art methods like SRe2L, TESLA, and MTT by more than 4% Top-1 accuracy on ImageNet-1K/21K and for the first time, reduces the gap to its full-data training counterparts to less than absolute 15%. Moreover, this work represents the inaugural success in dataset distillation on the larger-scale ImageNet-21K dataset under the standard 224×224 resolution. Our distilled ImageNet-21K dataset of 20 IPC, 2K recovery budget is available anonymously at link. ## 1 Introduction Dataset distillation or condensation (Wang et al., 2018) has attracted considerable attention across various fields of computer vision (Cazenavette et al., 2022b; Cui et al., 2023; Yin et al., 2023) and natural language processing (Sucholutsky & Schonlau, 2021; Maekawa et al., 2023). This task aims to optimize the process of condensing a massive dataset into a smaller, yet representative subset, preserving the essential features and characteristics that would allow a model to learn from scratch as effectively from the distilled dataset as it would from the original large dataset. As the scale of data and models continue to grow, this *dataset distillation* concept becomes even more critical in the large data era, where datasets are often voluminous that they pose storage, computational, and processing challenges. Generally, dataset distillation can level the playing field, allowing researchers with limited computation and storage resources to participate in state-of-the-art foundational model training and application development, such as affordable ChatGPT (Brown et al., 2020; OpenAI, 2023) and Stable Diffusion (Rombach et al., 2022), in the current large data and large model regime. Moreover, by working with distilled datasets, there is potential to alleviate some data privacy concerns, as raw, personally identifiable data points might be excluded from the distilled version. SRe 2L (4K) Our CDA (1K) Our CDA (4K) Resnet-18 Resnet-50 Resnet-101DenseNet-121RegNet-Y-8GF 45 50 55 60 65 Top-1 Accuarcy (%) Figure 1: ImageNet-1K comparison with SRe2L. Recently, there has been a significant trend in adopting large models and large data across various research and application areas. Yet, many prior dataset distillation methods (Wang et al., 2018; Zhao et al., 2020; Zhou et al., 2022; Cazenavette et al., 2022a; Kim et al., 2022a; Cui et al., 2023) predominantly target datasets like CIFAR, Tiny-ImageNet and downsampled ImageNet-1K, finding it challenging to scale their frameworks for larger datasets, such as full ImageNet-1K (Deng et al., 2009). This suggests that these approaches have not fully evolved in line with contemporary advancements and dominant methodologies. ![1_image_0.png](1_image_0.png) Figure 2: Motivation of our work. The left column is the synthesized images after a few gradient update iterations from Gaussian noise. Middle and right columns are intermediate and final synthesized images. In this study, we extend our focus even beyond the ImageNet-1K dataset, venturing into the uncharted territories of the full ImageNet-21K (Deng et al., 2009; Ridnik et al., 2021) at a conventional resolution of 224×224. This marks a pioneering effort in handling such a vast dataset for dataset distillation task. Our approach harnesses a straightforward yet effective global-to-local learning framework. We meticulously address each aspect and craft a robust strategy to effectively train on the complete ImageNet-21K, ensuring comprehensive knowledge is captured. Specifically, following a prior study (Yin et al., 2023), our approach initially trains a model to encapsulate knowledge from the original datasets within its dense parameters. However, we introduce a refined training recipe that surpasses the results of Ridnik et al. (2021) on ImageNet-21K. During the data recovery/synthesis phase, we employ a strategic learning scheme where partial image crops are sequentially updated based on the difficulty of regions: transitioning either from simple to difficult, or vice versa. This progression is modulated by adjusting the lower and upper bounds of the *RandomReiszedCrop* data augmentation throughout varying training iterations. Remarkably, we observe that this straightforward learning approach substantially improves the quality of synthesized data. In this paper, we delve into three learning paradigms for data synthesis linked to the curriculum learning framework. The first is the standard curriculum learning, followed by its alternative approach, reverse curriculum learning. Lastly, we also consider the basic and previously employed method of constant learning. Motivation and Intuition. We aim to maximize the global informativeness of the synthetic data. Both SRe2L (Yin et al., 2023) and our proposed approach utilize local mini-batch data's mean and variance statistics to match the global statistics of the entire original dataset, synthesizing data by applying gradient updates directly to the image. The impact of such a strategy is that the initial few iterations set the stage for the global structure of the ultimately generated image, as shown in Figure 2. Building upon the insights derived from the analysis, we can leverage the *global-to-local* gradient refinement scheme for more expressive synthesized data, in contrast, SRe2L does not capitalize on this characteristic. Specifically, our proposed approach exploits this by initially employing large crops to capture a more accurate and complete outline of objects, for building a better foundation. As the process progresses, it incrementally reduces the crop size to enhance the finer, local details of the object, significantly elevating the quality of the synthesized data. Global-to-local via Curriculum Sampling. *RandomResizedCrop* randomly crops the image to a certain area and then resizes it back to the pre-defined size, ensuring that the model is exposed to different regions and scales of the original image during training. As illustrated in Figure 3, the difficulty level of the cropped region can be controlled by specifying the lower and upper bounds for the area ratio of the crop. This can be used to ensure that certain portions of the image (small details or larger context) are present in the cropped region. If we aim to make the learning process more challenging, reduce the minimum crop ratio. This way, the model will often see only small portions of the image and will have to learn from those limited contexts. If we want the model to see a larger context more frequently, increase the minimum crop ratio. In this paper, we perform a comprehensive study on how the gradual difficulty changes by sampling strategy influence the optimization of data generation and the quality of synthetic data for dataset distillation. Our proposed curriculum data augmentation (CDA) is a heuristic and intuitive approach to simulate a global-to- ![2_image_0.png](2_image_0.png) Figure 3: Illustration of crop distribution from different lower and upper bounds in *RandomResizedCrop*. The first row is the central points of bounding boxes from different sampling scale hyperparameters. The second and last rows correspond to 30 and 10 boxes of the crop distributions. In each row, from left to right, the difficulty of crop distribution is decreasing. local learning procedure. Moreover, it is highly effective on large-scale datasets like ImageNet-1K and 21K, achieving state-of-the-art performance on dataset distillation. The Significance of Large-scale Dataset Condensation. Large models trained on large-scale datasets tend to outperform smaller models and those trained on limited data (Dosovitskiy et al., 2020; Dehghani et al., 2023; OpenAI, 2023). They exhibit remarkable abilities in capturing intricate patterns and understanding nuanced contextual information, making them highly effective across diverse tasks and domains. These models are pivotal in solving complex industrial problems and enhancing the development of AI-driven products and services, thus driving economic growth and advancement. Consequently, it is essential to adapt dataset condensation or distillation approaches for these large-scale data scenarios to realize their true potential in both academic and industrial spheres. We conduct extensive experiments on the CIFAR, Tiny-ImageNet, ImageNet-1K, and ImageNet-21K datasets. Employing a resolution of 224×224 and IPC 50 on ImageNet-1K, the proposed approach attains an impressive accuracy of 63.2%, surpassing all prior state-of-the-art methods by substantial margins. As illustrated in Figure 1, our proposed CDA outperforms SRe2L by 4∼6% across different architectures under 50 IPC, on both 1K and 4K recovery budgets. When tested on ImageNet-21K with IPC 20, our method achieves a top-1 accuracy of 35.3%, which is closely competitive, exhibiting only a minimal gap compared to the model pre-trained with full data, at 44.5%, while using 50× fewer training samples. Our contributions of this work: - We propose a new curriculum data augmentation (CDA) framework enabled by *global-to-local* gradient update in data synthesis for large-scale dataset distillation. - We are the first to distill the ImageNet-21K dataset, which reduces the gap to its full-data training counterparts to less than an absolute 15% accuracy. - We conduct extensive experiments on CIFAR-100, Tiny-ImageNet, ImageNet-1K and ImageNet-21K datasets to demonstrate the effectiveness of the proposed approach. ## 2 Related Work Dataset condensation or distillation strives to form a compact, synthetic dataset, retaining crucial information from the original large-scale dataset. This approach facilitates easier handling, reduces training time, and aims for performance comparable to using the full dataset. Prior solutions typically fall under four categories: *Meta-Model Matching* optimizes for model transferability on distilled data, with an outer-loop for synthetic data updates, and an inner-loop for network training, such as DD (Wang et al., 2020), KIP (Nguyen et al., 2021), RFAD (Loo et al., 2022), FRePo (Zhou et al., 2022), LinBa (Deng & Russakovsky, 2022), and MDC (He et al., 2024); *Gradient Matching* performs a one-step distance matching between models, such as DC (Zhao et al., 2020), DSA (Zhao & Bilen, 2021), DCC (Lee et al., 2022), IDC (Kim et al., 2022b), and MP (Zhou et al., 2024a); *Distribution Matching* directly matches the distribution of original and synthetic data with a single-level optimization, such as DM (Zhao & Bilen, 2023), CAFE (Wang et al., 2022), HaBa (Liu et al., 2022a), KFS (Lee et al., 2022), DataDAM (Sajedi et al., 2023), FreD Shin et al. (2024), and GUARD (Xue et al., 2024); *Trajectory Matching* matches the weight trajectories of models trained on original and synthetic data in multiple steps, methods include MTT (Cazenavette et al., 2022b), TESLA (Cui et al., 2023), APM (Chen et al., 2023), and DATM (Guo et al., 2024). Moreover, there are some recent methods out of these categories that have further improved the existing dataset distillation. SeqMatch (Du et al., 2023) reorganizes the synthesized dataset during the distillation and evaluation phases to extract both low-level and high-level features from the real dataset, which can be integrated into existing dataset distillation methods. Deep Generative Prior (Cazenavette et al., 2023) utilizes the learned prior from the pre-trained deep generative models to synthesize the distilled images. RDED (Sun et al., 2024) proposes a non-optimization method to concatenate multiple cropped realistic patches from the original data to compose the distilled dataset. D3M (Abbasi et al., 2024) condenses an entire category of images into a single textual prompt of latent diffusion models. SC-DD (Zhou et al., 2024b) proposes a self-supervised paradigm by applying the self-supervised pre-trained backbones for dataset distillation. EDC (Shao et al., 2024b) explores a comprehensive design space that includes multiple specific, effective strategies like soft category-aware matching and learning rate schedule to establishe a benchmark for both small and large-scale dataset distillation. Ameliorate Bias (Cui et al., 2024) studies the impact of bias within the original dataset on the performance of dataset condensation. It introduces a simple yet effective approach based on a sample reweighting scheme that utilizes kernel density estimation. SRe2L (Yin et al., 2023) is the first and mainstream framework to distill large-scale datasets, such as ImageNet-1K, and achieve significant performance. Thus, we consider it as our closest baseline. More specifically, SRe2L proposes a decoupling framework to avoid the bilevel optimization of model and synthesis during distillation, which consists of three stages of squeezing, recovering, and relabeling. In the first squeezing stage, a model is trained on the original dataset and serves as a frozen pre-train model in the following two stages. During the recovering stage, the distilled images are synthesized with the knowledge recovered from the pre-train model. At the last relabeling stage, the soft labels corresponding to synthetic images are generated and saved by leveraging the pre-train model. Recently, distilling on large-scale datasets has received significant attention in the community, and many works have been proposed, including (Sun et al., 2023; Liu et al., 2023; Chen et al., 2023; Shao et al., 2024a; Zhou et al., 2024a; Wu et al., 2024; Abbasi et al., 2024; Zhou et al., 2024b; Shao et al., 2024b; Xue et al., 2024; Qin et al., 2024; Gu et al., 2023; Ma et al., 2024; Shang et al., 2024). ## 3 Approach 3.1 Preliminary: Dataset Distillation The goal of dataset distillation is to derive a concise synthetic dataset that maintains a significant proportion of the information contained in the original, much larger dataset. Suppose there is a large labeled dataset Do =(x1, y1)*, . . . ,* x|Do|, y|Do| , our target is to formulate a compact distilled dataset, represented as Dd = n(x ′ 1 , y ′ 1 )*, . . . ,* x ′ |Dd| , y ′ |Dd| o, where y ′is the soft label corresponding to synthetic data x ′, and |Dd*| ≪ |D*o|, preserving the essential information from the original dataset Do. The learning objective based on this distilled synthetic dataset is: is: $$\theta_{\mathcal{D}_d}=\underset{\theta}{\arg\min}\mathcal{L}_{\mathcal{D}_d}(\pmb{\theta})$$ $$\mathcal{L}_{\mathcal{D}_d}(\pmb{\theta})\!=\!\mathbb{E}_{(\pmb{x}',\pmb{y}')\in\mathcal{D}_d}\!\Big[\ell(\phi_{\pmb{\theta}_{\mathcal{D}_d}}(\pmb{x}'),\pmb{y}')\Big]$$ (θ) (1) i(2) where ℓ is the regular loss function such as the soft cross-entropy, and ϕθDd is model. The primary objective of the dataset distillation task is to generate synthetic data aimed at attaining a specific or minimal performance $$(1)$$ $$\left(2\right)$$ disparity on the original validation data when the same models are trained on the synthetic data and the original dataset, respectively. Thus, we aim to optimize the synthetic data Dd by: $$\operatorname*{arg\,min}_{\mathcal{D}_{d},|\mathcal{D}_{d}|}\left(\operatorname*{sup}\left\{\left|\ell\left(\phi_{\theta_{\mathcal{D}_{o}}}(\mathbf{x}_{v a l}),\mathbf{y}_{v a l}\right)-\ell\left(\phi_{\theta_{\mathcal{D}_{d}}}(\mathbf{x}_{v a l}),\mathbf{y}_{v a l}\right)\right|\right\}_{(\mathbf{x}_{v a l},\mathbf{y}_{v a l})\sim\mathcal{D}_{o}}\right)$$ $$\left(3\right)$$ (3) where (xval, yval) are sample and label pairs in the validation set of the real dataset Do. Then, we learn <data, label>∈Dd with the corresponding number of distilled data in each class. ## 3.2 Dataset Distillation On Large-Scale Datasets Currently, the prevailing majority of research studies within dataset distillation mainly employ datasets of a scale up to ImageNet-1K (Cazenavette et al., 2022b; Cui et al., 2023; Yin et al., 2023) as their benchmarking standards. In this work, we are the pioneer in showing how to construct a strong baseline on ImageNet21K (the approach is equivalently applicable to ImageNet-1K) by incorporating insights presented in recent studies, complemented by conventional optimization techniques. Our proposed baseline is demonstrated to achieve state-of-the-art performance over prior counterparts. We believe this provides substantial significance towards understanding the true impact of proposed methodologies on dataset distillation task and towards assessing the true gap with full original data training. We further propose a curriculum training paradigm to achieve a more informative representation of synthetic data. Following prior work in dataset distillation (Yin et al., 2023), we focus on the decoupled training framework, *Squeeze-Recover-Relabel*, to save computation and memory consumption on large-scale ImageNet-21K, the procedures are listed below: Squeeze: Building A Strong Pre-trained Model on ImagNet-21K. To obtain a squeezing model, we use a relatively large label smooth of 0.2 together with Cutout (DeVries & Taylor, 2017) and RandAugment (Cubuk et al., 2020), as shown in Appendix B.4. This recipe helps achieve ∼2% improvement over the default training (Ridnik et al., 2021) on ImageNet-21K, as provided in Table 18. Recover: Curriculum Training for Better Representation of Synthetic Data. A well-crafted curriculum data augmentation is employed during the synthesis stage to realize the global-to-local learning scheme and enhance the representational capability of the synthetic data. This step is crucial, serving to enrich the generated images by embedding more knowledge accumulated from the original dataset, thereby making them more informative. Detailed procedures will be further described in the following Section 3.3. Relabel: Post-training on Larger Models with Stronger Training Recipes. Prior studies, such as TESLA (Cui et al., 2023), have encountered difficulties, particularly, a decline in accuracy when utilizing models of larger scale. This suggests that the synthetic data used is potentially inadequate for training larger models. Conversely, the data we relabel show improvement with the use of larger models combined with enhanced post-training methodologies, displaying promise when applied to larger datasets in distillation processes. We have also observed that maintaining a smaller batch size is crucial for post-training on synthetic data to achieve commendable accuracy. This is attributed to the *Generalization Gap* (Keskar et al., 2016; Hoffer et al., 2017), which suggests that when there is a deficiency in the total training samples, the model's capacity to generalize to new, unseen data is not robust. Employing smaller batch sizes while training on the small-scale synthetic data allows models to explore the loss landscape more meticulously before converging to an optimal minimum. ## 3.3 Global-To-Local Gradient Update Via Curriculum In SRe2L (Yin et al., 2023) approach, the key of data synthesis revolves around utilizing the gradient information emanating from both the semantic class and the predictions of the pre-trained squeezing model, paired with BN distribution matching. Let (x, y) be an example x for optimization and its corresponding one-hot label y for the pre-trained squeezing model. Throughout the synthesis process, the squeezing model is frozen to recover the encoded information and ensure consistency and reliability in the generated data. Let T (x) be the target training distribution from which the data synthesis process should ultimately learn a function of desired trajectories, where T is a data transformation function to augment input samples to various levels of difficulties. Following Bengio et al. (2009), a weight 0 ≤ Ws(x) ≤ 1 is defined and applied to example x at stage s in the curriculum sequence. The training distribution Ds(x) is: Ds(x) ∝ Ws(x)T (x) ∀x (4) $$D_{s}(x)\propto W_{s}(x){\mathcal{T}}(x)\quad\forall x$$ In our scenario, since the varying difficulties are governed by the data transformation function T , we can straightforwardly employ Ws(x) = 1 across all stages. Consequently, the training distribution solely depends on T (x) and can be simplified as follows: initial image × S times Optimizer synthetic image ![5_image_0.png](5_image_0.png) Figure 4: Global-to-local data synthesis. D(x) ∝ T (x) ∀x (5) By integrating curriculum learning within the data synthesis phase, this procedure can be defined as: Definition 1 (Curriculum Data Synthesis). *In the data synthesis* optimization, the corresponding sequence of distributions D(x) will be a curriculum if there is an increment in the entropy of these distributions, i.e., the difficulty of the transformed input samples escalates and becomes increasingly challenging for the pre-trained model to predict as the training progresses. Thus, the key for our curriculum data synthesis becomes how to design T (x) across different training iterations. The following discusses several strategies to construct this in the curriculum scheme. Baseline: Constant Learning (CTL). This is the regular training method where all training examples are typically treated equally. Each sample from the training dataset has an equal chance of being transformed in a given batch, assuming no difficulty imbalance or biases across different training iterations. CTL is straightforward to implement since we do not have to rank or organize examples based on difficulty. In practice, we use *RandomResizedCrop* to crop a small region via current crop ratio randomly sampled from a given interval [min_crop, max_crop] and then resize the cropped image to its original size, formulated as follows: xT ←*RandomResizedCrop*(xs, min_crop = αl, max_crop = αu) (6) where αl and αu are the constant lower and upper bounds of crop scale. Curriculum Learning (CL). As shown in Algorithm 1, in our CL, data samples are organized based on their difficulty. The difficulty level of the cropped region can be managed by defining the lower and upper scopes for the area ratio of the crop. This enables the assurance that specific crops of the image (small details or broader context) are included in the cropped region. For the difficulty adjustment, the rate at which more difficult examples are introduced and the criteria used to define difficulty are adjusted dynamically as predetermined using the following schedulers. Step. Step scheduler reduces the minimal scale by a factor for every fixed or specified number of iterations, as shown in Figure 5 right. Linear. Linear scheduler starts with a high initial value and decreases it linearly by a factor γ to a minimum value over the whole training. Cosine. Cosine scheduler modulates the distribution according to the cosine function of the current iteration number, yielding a smoother and more gradual adjustment compared to step-based methods. As shown in Figure 5, the factor distribution manages the difficulty level of crops with adjustable αu and αl for CTL and milestone for CL. ![5_image_1.png](5_image_1.png) Figure 5: Crop ratio schedulers of prior CTL solution (left) and our *Global-to-local* (right) enabled by curriculum. The colored regions depict the random sampling intervals for the crop ratio value in each iteration under different schedulers. Data Synthesis by Recovering and Relabeling. After receiving the transformed input xT , we update it by aligning between the final classification label and intermediate Batch Normalization (BN) statistics, i.e., mean and variance from the original data. This stage forces the synthesized images to capture a shape of the original image distribution. The learning goal for this stage can be formulated as follows: $$\mathbf{x}_{\mathcal{T}}^{\prime}=\arg\operatorname*{min}\;\ell\left(\phi_{\mathbf{\theta}}\left(\mathbf{x}_{\mathcal{T}}\right),\mathbf{y}\right)+\mathcal{R}_{\mathrm{reg}}$$ T = arg min ℓ (ϕθ (xT ), y) + Rreg (7) Algorithm 1: Our CDA via *RandomResizedCrop* Input: squeezed model ϕθ, recovery iteration S, curriculum milestone T, target label y, default lower and upper bounds of crop scale βl and βu in *RandomResizedCrop*, decay of lower scale bound γ Output: synthetic image x Initialize: x0 from a standard normal distribution for step s from 0 to S-1 do if s ≤ T **then** $s\leq T$ then $\alpha\leftarrow\begin{cases}\beta_{\text{u}}&\text{if}\textbf{step}\\ \beta_{l}+\gamma*\left(\beta_{\text{u}}-s/T\right)&\text{if}\textbf{linear}\\ \beta_{l}+\gamma*\left(\beta_{\text{u}}+\cos\left(\pi*s/T\right)\right)/2&\text{if}\textbf{cosine}\end{cases}$ $$\begin{array}{c}{{\mathbf{lse}}}\\ {{\alpha\leftarrow}}\end{array}$$ else α ← βl end xT ← *RandomResizedCrop*(xs, min_crop = α, max_crop = βu) x ′ T ← xT is optimized w.r.t ϕθ and y in Eq. 7. xs+1 ← *ReverseRandomResizedCrop*(xs, x ′ T ) end return x ← xS where ϕθ is the pre-trained squeezing model and will be frozen in this stage. During synthesis, only the input crop area will be updated by the gradient from the objective. The entire training procedure is illustrated in Figure 4. After synthesizing the data, we follow the relabeling process in SRe2L to generate soft labels (Shen & Xing, 2022) with the integration of the small batch size setting for post-training. Rreg is the regularization term used in Yin et al. (2023), its detailed formulation using channel-wise mean and variance matching is: $$\mathcal{R}_{\mathrm{reg}}\left(\mathbf{x}^{\prime}\right)=\sum_{k}\left\|\mu_{k}\left(\mathbf{x}^{\prime}\right)-\mathbb{E}\left(\mu_{k}\mid\mathcal{D}_{o}\right)\right\|_{2}+\sum_{k}\left\|\sigma_{l}^{2}\left(\mathbf{x}^{\prime}\right)-\mathbb{E}\left(\sigma_{k}^{2}\mid\mathcal{D}_{o}\right)\right\|_{2}$$ $$\approx\sum_{k}\left\|\mu_{k}\left(\mathbf{x}^{\prime}\right)-\mathbf{B}\mathbf{N}_{k}^{\mathrm{RM}}\right\|_{2}+\sum_{k}\left\|\sigma_{k}^{2}\left(\mathbf{x}^{\prime}\right)-\mathbf{B}\mathbf{N}_{k}^{\mathrm{RV}}\right\|_{2}$$ $$({\boldsymbol{\delta}})$$ where k is the index of BN layer, µk (x ′) and σ 2 k (x ′) are the channel-wise mean and variance in current batch data. BNRM k and BNRV k are mean and variance in the pre-trained model at k-th BN layer, which are globally counted. Advantages of Global-to-local Synthesis. The proposed CDA enjoys several advantages: (1) Stabilized training: Curriculum synthesis can provide a more stable training process as it reduces drastic loss fluctuations that can occur when the learning procedure encounters a challenging sample early on. (2) Better generalization: By gradually increasing the difficulty, the synthetic data can potentially achieve better generalization on diverse model architectures in post-training. It reduces the chance of the synthesis getting stuck in poor local minima early in the training process. (3) Avoid overfitting: By ensuring that the synthetic data is well-tuned on simpler examples before encountering outliers or more challenging data, there is a potential to reduce overfitting. ## 4 Experiments 4.1 Datasets And Implementation Details We verify the effectiveness of our approach on small-scale CIFAR-100 and various ImageNet scale datasets, including Tiny-ImageNet (Le & Yang, 2015), ImageNet-1K (Deng et al., 2009), and ImageNet-21K (Ridnik et al., 2021). For evaluation, we train models from scratch on synthetic distilled datasets and report the Top-1 accuracy on real validation datasets. Default lower and upper bounds of crop scales βl and βu are 0.08 and 1.0, respectively. The decay γ is 0.92. In Curriculum Learning (CL) settings, the actual lower bound is dynamically adjusted to control difficulty, whereas the upper bound is fixed to the default value of 1.0 to | Dataset | CIFAR-100 | Tiny-ImageNet | | ImageNet-1K | ImageNet-21K | | | | | | | |---------------------------------------------------------------------------------------------------------------------------|-------------|-----------------|-----------|---------------|----------------|-----------|----------|----------|----------|-----------|-----------| | IPC | 10 | 50 | 10 | 50 | 100 | 10 | 50 | 100 | 200 | 10 | 20 | | Ratio (%) | 2 | 10 | 2 | 10 | 20 | 0.8 | 4 | 8 | 16 | 0.8 | 1.6 | | DM | 29.7±0.3 | 43.6±0.4 | 12.9±0.4 | 24.1±0.3 | - | 5.7±0.1 | 11.4±0.9 | - | - | - | - | | DSA | 32.3±0.3 | 42.8±0.4 | - | - | - | - | - | - | - | - | - | | FRePo | 42.5±0.2 | 44.3±0.2 | 25.4±0.2 | - | - | - | - | - | - | - | - | | MTT | 39.7±0.4 | 47.7±0.2 | 23.2±0.2 | 28.0±0.3 | - | - | - | - | - | - | - | | DataDAM | 34.8±0.5 | 49.4±0.3 | 18.7±0.3 | 28.7±0.3 | - | 6.3±0.0 | 15.5±0.2 | - | - | - | - | | TESLA | 41.7±0.3 | 47.9±0.3 | - | - | - | 17.8±1.3 | 27.9±1.2 | - | - | - | - | | DATM | 47.2±0.4 | 55.0±0.2 | 31.1±0.3 | 39.7±0.3 | - | - | - | - | - | - | - | | Full Dataset1 | 79.1 | 61.2 | | 69.8 | 38.5 | | | | | | | | SRe2L | 23.5±0.8 | 51.4±0.8 | 17.7±0.7∗ | 41.1±0.4 | 49.7±0.3 | 21.3±0.6∗ | 46.8±0.2 | 52.8±0.4 | 57.0±0.3 | 18.5±0.2∗ | 21.8±0.1∗ | | CDA (Ours) | 49.5±0.6 | 64.0±0.5 | 21.3±0.3 | 48.7±0.1 | 53.2±0.1 | 33.5±0.3 | 53.5±0.3 | 58.0±0.2 | 63.3±0.2 | 22.6±0.2 | 26.4±0.1 | | ∗ Replicated experiment results are marked with ∗ , while the other baseline results are referenced from original papers. | | | | | | | | | | | | Table 1: Comparison with state-of-the-art methods on various datasets. ensure there is a probability of cropping and optimizing the entire image in any progress. More details are provided in the Appendix B. ## 4.2 Cifar-100 Result comparisons with baseline methods, including DM (Zhao & Bilen, 2023), DSA (Zhao & Bilen, 2021), FRePo (Zhou et al., 2022), MTT (Cazenavette et al., 2022b), DataDAM (Sajedi et al., 2023), TESLA (Cui et al., 2023), DATM (Guo et al., 2024), and SRe2L (Yin et al., 2023) on CIFAR-100 are presented in Table 1. Our model is trained with an 800ep budget. It can be observed that our CDA validation accuracy outperforms all baselines under 10 and 50 IPC. And our reported results have the potential to be further improved as training budgets increase. Overall, our CDA method is also applicable to small-scale dataset distillation. ## 4.3 Tiny-Imagenet Results on the Tiny-ImageNet dataset are detailed in the second group of Table 1 and the first group of Table 3. Our CDA outperforms all baselines except DATM under 10 IPC. Compared to SRe2L, our CDA achieves average improvements of 7.7% and 3.4% under IPC 50 and IPC 100 settings across ResNet-{18, 50, 101} validation models, respectively. Importantly, CDA stands as the inaugural approach to diminish the Top-1 accuracy performance disparity to less than 10% between the distilled dataset employing IPC 100 and the full Tiny-ImageNet, signifying a breakthrough on this dataset. ## 4.4 Imagenet-1K | Constant learning type \ α | 0.08 | 0.2 | 0.4 | 0.6 | 0.8 | 1.0 | |------------------------------|--------|-------|-------|-------|-------|--------| | Easy (αl = α, αu = βu) | 44.90‡ | 47.88 | 46.34 | 45.35 | 43.48 | 41.30 | | Hard (αl = βl , αu = α) | 22.99 | 34.75 | 42.76 | 44.61 | 45.76 | 44.90‡ | Table 2: Constant learning result. αl and αu stand for the min_crop and max_crop parameters in *RandomResizedCrop*. ‡represents the results from SRe2L implementation but following the setting in the table. Constant Learning (CTL). We leverage a ResNet-18 and employ synthesized data with 1K recovery iterations. As observed in Table 2, the results for exceedingly straightforward or challenging scenarios fall below the reproduced SRe2L baseline accuracy of 44.90%, especially when α ≥ 0.8 in *easy* and α ≤ 0.4 in hard type. Thus, the results presented in Table 2 suggest that adopting a larger cropped range assists in circumventing extreme scenarios, whether easy or hard, culminating in enhanced performance. A noteworthy observation is the crucial role of appropriate lower and upper bounds for constant learning in boosting validation accuracy. This highlights the importance of employing curriculum data augmentation strategies in data synthesis. | Dataset | IPC | ResNet-18 | ResNet-50 | ResNet-101 | | | | |-----------|-------|-------------|-------------|--------------|----------|----------|----------| | SRe2L | Ours | SRe2L | Ours | SRe2L | Ours | | | | Tiny-IN | 50 | 41.1 | 48.7↑7.6 | 42.2 | 49.7↑7.5 | 42.5 | 50.6↑8.1 | | 100 | 49.7 | 53.2↑3.5 | 51.2 | 54.4↑3.2 | 51.5 | 55.0↑3.5 | | | 50 | 46.8 | 53.5↑6.7 | 55.6 | 61.3↑5.7 | 57.6 | 61.6↑4.0 | | | 100 | 52.8 | 58.0↑5.2 | 61.0 | 65.1↑4.1 | 62.8 | 65.9↑3.1 | | | IN-1K | 200 | 57.0 | 63.3↑6.3 | 64.6 | 67.6↑3.0 | 65.9 | 68.4↑2.5 | | IN-21K | 10 | 18.5 | 22.6↑4.1 | 27.4 | 32.4↑5.0 | 27.3 | 34.2↑6.9 | | 20 | 21.8 | 26.4↑4.6 | 31.3 | 35.3↑4.0 | 33.2 | 36.1↑2.9 | | Table 3: Comparison with baseline on various datasets. Curriculum Learning (CL). We follow the recovery recipe of SRe2L's best result for 4K recovery iterations. As illustrated in Table 1 and the second group of Table 3, when compared to the strong baseline SRe2L, CDA enhances the validation accuracy, exhibiting average margins of 6.1%, 4.3%, and 3.2% on ResNet-{18, 50, 101} across varying IPC settings. Furthermore, as shown in Figure 1, the results achieve with our CDA utilizing merely 1K recovery iterations surpass those of SRe2L encompassing the entire 4K iterations. These results substantiate the efficacy and effectiveness of applying CDA in large-scale dataset distillation. ## 4.5 Imagenet-21K Pre-training Results. Table 18 of the Appendix presents the accuracy for ResNet-18 and ResNet-50 on ImageNet-21K-P, considering varying initial weight configurations. Models pre-trained by us and initialized with ImageNet-1K weight exhibit commendable accuracy, showing a 2.0% improvement, while models initialized randomly achieve marginally superior accuracy. We utilize these pre-trained models to recover ImageNet-21K data and to assign labels to the synthetic images generated. An intriguing observation is the heightened difficulty in data recovering from pre-trained models that are initialized randomly compared to those initialized with ImageNet-1K weight. Thus, our experiments employ CDA specifically on pre-trained models that are initialized with ImageNet-1K weight. Validation Results. As illustrated in Table 1 and the final group of Table 3, we perform validation experiments on the distilled ImageNet-21K employing IPC 10 and 20. This yields an extreme compression ratio of 100× and 50×. When applying IPC 10, i.e., the models are trained utilizing a distilled dataset that is a mere 1% of the full dataset. Remarkably, validation accuracy surpasses 20% and 30% on ResNet-18 and ResNet-{50, 101}, respectively. Compared to reproduced SRe2L on ImageNet-21K, our approach attains an elevation of 5.3% on average under IPC 10/20. This not only highlights the efficacy of our approach in maintaining dataset essence despite high compression but also showcases the potential advancements in accuracy over existing methods. ## 4.6 Ablations Curriculum Scheduler. To schedule the global-to-local learning, we present three distinct types of curriculum schedulers, step, *linear*, and *cosine* to manipulate the lower bounds on data cropped augmentation. As illustrated in Figure 5, the dataset distillation progress is divided into two phases by a milestone. It is observed that both *linear* and *cosine* with continuous decay manifest robustness across diverse milestone configurations and reveal a trend of enhancing accuracy performance when the milestone is met at a later phase, as shown in Figure 6. Moreover, *cosine* marginally outperforms *linear* in terms of accuracy towards the end. Consequently, we choose to implement the *cosine* scheduler, assigning a milestone percentage of 1.0, to modulate the minimum crop ratio adhering to the principles of curriculum learning throughout the progression of synthesis. Batch Size in Post-training. We perform an ablation study to assess the influence of utilizing smaller batch sizes on the generalization performance of models when the synthetic data is limited. We report results on the distilled ImageNet-21K from ResNet-18. In Table 4, a ![9_image_0.png](9_image_0.png) Figure 6: Ablation study on three different schedulers with varied milestone settings. rise in validation accuracy is observed as batch size reduces, peaking at 16. This suggests that smaller batch sizes enhance performance on small-scale synthetic datasets. However, this leads to more frequent data loading and lower GPU utilization in our case, extending training times. To balance training time with performance, we chose a batch size of 32 for our experiments. ## 4.7 Analysis Cross-Model Generalization. The challenge of ensuring distilled datasets generalize effectively across models unseen during the recovery phase remains significant, as in prior approaches (Zhao et al., 2020; Cazenavette et al., 2022a), synthetic images were optimized to overfit the recovery model. In the first group of Table 5, we deploy our ImageNet-1K distilled datasets to train various validation models, and we attain over 60% Top-1 accuracy with most of these models. Additionally, our performance in Top-1 accuracy surpasses that of SRe2L across all validation models spanning various architectures. Although DeiT-Tiny is not validated with a comparable Top-1 accuracy to other CNN models due to the ViT's inherent characteristic requiring more training data, CDA achieves double cross-model generation performance on the DeiT-Tiny validation model, compared with SRe2L. More validation models on distilled ImageNet-1K are included in Table 16 of the Appendix. The second group of Table 5 supports further empirical substantiation of the CDA's efficacy in the distillation of large-scale ImageNet-21K datasets. The results demonstrate that the CDA's distilled datasets exhibit reduced dependency on specific recovery models, thereby further alleviating the overfitting optimization issues. Table 4: Ablation on batch size in validation. Batch Size Acc. (%) 128 20.79 64 21.85 32 22.54 16 **22.75** 8 22.41 Table 5: Cross-model generation on distilled ImageNet-1K with 50 IPC and ImageNet-21K with 20 IPC. | Dataset | Method | | | Validation Model | | | | | |------------|----------|-------|--------------|--------------------|---------------|-----------|-------|-------| | R18 | R50 | R101 | DenseNet-121 | RegNet-Y-8GF | ConvNeXt-Tiny | DeiT-Tiny | | | | IN-1K | SRe2L | 46.80 | 55.60 | 57.60 | 49.74 | 60.34 | 53.53 | 15.41 | | CDA (ours) | 53.45 | 61.26 | 61.57 | 57.35 | 63.22 | 62.58 | 31.95 | | | IN-21K | SRe2L | 21.83 | 31.26 | 33.24 | 24.66 | 34.22 | 34.95 | 15.76 | | CDA (ours) | 26.42 | 35.32 | 36.12 | 28.66 | 36.13 | 36.31 | 18.56 | | Impact of Curriculum. To study the curriculum's advantage on synthetic image characteristics, we evaluate the Top-1 accuracy on CDA, SRe2L and real ImageNet-1K training set, using a åmean of random 10-crop and global images. We employ PyTorch's pre-trained MobileNet-V2 to classify these images. As shown in Table 6, CDA images closely resemble real ImageNet images in prediction accuracies, better than SRe2L. Consequently, curriculum data augmentation im- | Top-1 (%) | Dataset | | | |-------------|------------|-------|-------| | SRe2L | CDA (ours) | Real | | | global | 79.34 | 81.25 | 82.16 | | cropped | 87.48 | 82.44 | 72.73 | Table 6: Classification accuracy using MobileNet-V2. proves global image prediction and reduces bias and overfitting post-training on simpler, cropped images of SRe2L. Visualization and Discussion. Figure 7 provides a comparative visualization of the gradient synthetic images at recovery steps of {100, 500, 1K, 2K} to illustrate the differences between SRe2L and CDA within the dataset distillation process. SRe2L images in the upper line exhibit a significant amount of noise, indicating a slow recovery progression in the early recovery stage. On the contrary, due to the mostly entire image optimization in the early stage, CDA images in the lower line can establish the layout of the entire image and reduce noise rapidly. And the final synthetic images contain more visual information directly related to the target class *Plant*. Therefore, the comparison highlights CDA's ability to synthesize images with enhanced visual coherence to the target class, offering a more efficient recovery process. More visualizations are provided in Appendix D. Figure 7: Synthetic ImageNet-21K images (*Plant*). ![10_image_0.png](10_image_0.png) Synthesis Cost. We highlight that there is no additional synthesis cost incurred in our CDA to SRe2L (Yin et al., 2023) under the same recovery iteration setting. Specifically, for ImageNet-1K, it takes about 29 hours to generate the distilled ImageNet-1K with 50 IPC on a single A100 (40G) GPU and the peak GPU memory utilization is 6.7GB. For ImageNet-21K, it takes 11 hours to generate ImageNet-21K images per IPC on a single RTX 4090 GPU and the peak GPU memory utilization is 15GB. In our experiment, it takes about 55 hours to generate the entire distilled ImageNet-21K with 20 IPC on 4× RTX 4090 GPUs in total. ## 4.8 Application: Continual Learning The distilled datasets, comprising high-semantic images, possess a boosted representation capacity compared to the original datasets. This attribute can be strategically harnessed to combat catastrophic forgetting in continual learning. We have further validated the effectiveness of our introduced CDA synthesis within various continual learning scenarios. Following the setting introduced in SRe2L (Yin et al., 2023), we conducted 5-step and 10-step class-incremental experiments on Tiny-ImageNet, aligning our results against the baseline SRe2L and a randomly selected subset on Tiny-ImageNet for comparative analysis. As illustrated in Figure 8, our CDA distilled dataset notably surpasses SRe2L, exhibiting an average advantage of 3.8% and 4.5% on 5-step and 10-step class-incremental learning assignments respectively. This demonstrates the substantial benefits inherent in the generation of CDA, particularly in mitigating the complexities associated with continual learning. ![10_image_1.png](10_image_1.png) ## 5 Conclusion We presented a new framework focused on *global-to-local* gradient refinement through curriculum data synthesis for large-scale dataset distillation. Our approach involves a practical paradigm with detailed pertaining for compressing knowledge, data synthesis for recovery, and post-training recipes. The proposed approach enables the distillation of ImageNet-21K to 50× smaller while maintaining competitive accuracy levels. In regular benchmarks, such as ImageNet-1K and CIFAR-100, our approach also demonstrated superior performance, surpassing prior state-of-the-art methods by substantial margins. We further show the capability of our synthetic data on downstream tasks of cross-model generalization and continual learning. With the recent substantial growth in the size of both models and datasets, the critical need for dataset distillation on large-scale datasets and models has become increasingly prominent and urgent. Our future work will focus on distilling more modalities like language and speech. ## References Ali Abbasi, Ashkan Shahbazi, Hamed Pirsiavash, and Soheil Kolouri. One category one prompt: Dataset distillation using diffusion models. *arXiv preprint arXiv:2403.07142*, 2024. Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In *Proceedings* of the 26th annual international conference on machine learning, pp. 41–48, 2009. Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020. George Cazenavette, Tongzhou Wang, Antonio Torralba, Alexei A Efros, and Jun-Yan Zhu. Dataset distillation by matching training trajectories. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4750–4759, 2022a. George Cazenavette, Tongzhou Wang, Antonio Torralba, Alexei A. Efros, and Jun-Yan Zhu. Wearable imagenet: Synthesizing tileable textures via dataset distillation. In *Proceedings of the IEEE/CVF Conference* on Computer Vision and Pattern Recognition Workshops, 2022b. George Cazenavette, Tongzhou Wang, Antonio Torralba, Alexei A Efros, and Jun-Yan Zhu. Generalizing dataset distillation via deep generative prior. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3739–3748, 2023. Mingyang Chen, Bo Huang, Junda Lu, Bing Li, Yi Wang, Minhao Cheng, and Wei Wang. Dataset distillation via adversarial prediction matching. *arXiv preprint arXiv:2312.08912*, 2023. Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition workshops, pp. 702–703, 2020. Justin Cui, Ruochen Wang, Si Si, and Cho-Jui Hsieh. Scaling up dataset distillation to imagenet-1k with constant memory. In *International Conference on Machine Learning*, pp. 6565–6590. PMLR, 2023. Justin Cui, Ruochen Wang, Yuanhao Xiong, and Cho-Jui Hsieh. Ameliorate spurious correlations in dataset condensation. In *Forty-first International Conference on Machine Learning*, 2024. Mostafa Dehghani, Josip Djolonga, Basil Mustafa, Piotr Padlewski, Jonathan Heek, Justin Gilmer, Andreas Peter Steiner, Mathilde Caron, Robert Geirhos, Ibrahim Alabdulmohsin, et al. Scaling vision transformers to 22 billion parameters. In *International Conference on Machine Learning*, pp. 7480–7512. PMLR, 2023. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In *2009 IEEE conference on computer vision and pattern recognition*, pp. 248–255. Ieee, 2009. Zhiwei Deng and Olga Russakovsky. Remember the past: Distilling datasets into addressable memories for neural networks. *arXiv preprint arXiv:2206.02916*, 2022. Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. *arXiv preprint arXiv:1708.04552*, 2017. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. *arXiv preprint arXiv:2010.11929*, 2020. Jiawei Du, Qin Shi, and Joey Tianyi Zhou. Sequential subset matching for dataset distillation. Advances in Neural Information Processing Systems, 36, 2023. Jianyang Gu, Saeed Vahidian, Vyacheslav Kungurtsev, Haonan Wang, Wei Jiang, Yang You, and Yiran Chen. Efficient dataset distillation via minimax diffusion. *arXiv preprint arXiv:2311.15529*, 2023. Ziyao Guo, Kai Wang, George Cazenavette, Hui Li, Kaipeng Zhang, and Yang You. Towards lossless dataset distillation via difficulty-aligned trajectory matching. In The Twelfth International Conference on Learning Representations, 2024. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9729–9738, 2020. Yang He, Lingao Xiao, Joey Tianyi Zhou, and Ivor Tsang. Multisize dataset condensation. *ICLR*, 2024. Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. *Advances in neural information processing systems*, 30, 2017. Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 4700–4708, 2017. Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016. Jang-Hyun Kim, Jinuk Kim, Seong Joon Oh, Sangdoo Yun, Hwanjun Song, Joonhyun Jeong, Jung-Woo Ha, and Hyun Oh Song. Dataset condensation via efficient synthetic-data parameterization. In International Conference on Machine Learning, pp. 11102–11118. PMLR, 2022a. Jang-Hyun Kim, Jinuk Kim, Seong Joon Oh, Sangdoo Yun, Hwanjun Song, Joonhyun Jeong, Jung-Woo Ha, and Hyun Oh Song. Dataset condensation via efficient synthetic-data parameterization. In *Proceedings of* the 39th International Conference on Machine Learning, 2022b. Ya Le and Xuan Yang. Tiny imagenet visual recognition challenge. *CS 231N*, 7(7):3, 2015. Saehyung Lee, Sanghyuk Chun, Sangwon Jung, Sangdoo Yun, and Sungroh Yoon. Dataset condensation with contrastive signals. In *International Conference on Machine Learning*, pp. 12352–12364. PMLR, 2022. Haoyang Liu, Tiancheng Xing, Luwei Li, Vibhu Dalal, Jingrui He, and Haohan Wang. Dataset distillation via the wasserstein metric. *arXiv preprint arXiv:2311.18531*, 2023. Songhua Liu, Kai Wang, Xingyi Yang, Jingwen Ye, and Xinchao Wang. Dataset distillation via factorization. Advances in Neural Information Processing Systems, 35:1100–1113, 2022a. Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. In *Proceedings of the IEEE/CVF conference on computer vision and pattern* recognition, pp. 11976–11986, 2022b. Noel Loo, Ramin Hasani, Alexander Amini, and Daniela Rus. Efficient dataset distillation using random feature approximation. *arXiv preprint arXiv:2210.12067*, 2022. Zhiheng Ma, Anjia Cao, Funing Yang, and Xing Wei. Curriculum dataset distillation. arXiv preprint arXiv:2405.09150, 2024. Aru Maekawa, Naoki Kobayashi, Kotaro Funakoshi, and Manabu Okumura. Dataset distillation with attention labels for fine-tuning bert. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 119–127, 2023. Timothy Nguyen, Roman Novak, Lechao Xiao, and Jaehoon Lee. Dataset distillation with infinitely wide convolutional networks. *Advances in Neural Information Processing Systems*, 34:5186–5198, 2021. OpenAI. Gpt-4 technical report, 2023. Tian Qin, Zhiwei Deng, and David Alvarez-Melis. Distributional dataset distillation with subtask decomposition. *arXiv preprint arXiv:2403.00999*, 2024. Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dollár. Designing network design spaces. In *Proceedings of the IEEE/CVF conference on computer vision and pattern recognition*, pp. 10428–10436, 2020. Tal Ridnik, Emanuel Ben-Baruch, Asaf Noy, and Lihi Zelnik-Manor. Imagenet-21k pretraining for the masses. arXiv preprint arXiv:2104.10972, 2021. Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684–10695, 2022. Ahmad Sajedi, Samir Khaki, Ehsan Amjadian, Lucy Z. Liu, Yuri A. Lawryshyn, and Konstantinos N. Plataniotis. Datadam: Efficient dataset distillation with attention matching. In *Proceedings of the IEEE/CVF* International Conference on Computer Vision (ICCV), pp. 17097–17107, October 2023. Xinyi Shang, Peng Sun, and Tao Lin. Gift: Unlocking full potential of labels in distilled dataset at near-zero cost. *arXiv preprint arXiv:2405.14736*, 2024. Shitong Shao, Zeyuan Yin, Muxin Zhou, Xindong Zhang, and Zhiqiang Shen. Generalized large-scale data condensation via various backbone and statistical matching. *CVPR*, 2024a. Shitong Shao, Zikai Zhou, Huanran Chen, and Zhiqiang Shen. Elucidating the design space of dataset condensation. *arXiv preprint arXiv:2404.13733*, 2024b. Zhiqiang Shen and Eric Xing. A fast knowledge distillation framework for visual recognition. In *European* Conference on Computer Vision, pp. 673–690. Springer, 2022. Donghyeok Shin, Seungjae Shin, and Il-Chul Moon. Frequency domain-based dataset distillation. *Advances* in Neural Information Processing Systems, 36, 2024. Ilia Sucholutsky and Matthias Schonlau. Soft-label dataset distillation and text dataset distillation. In 2021 International Joint Conference on Neural Networks (IJCNN), pp. 1–8. IEEE, 2021. Peng Sun, Bei Shi, Daiwei Yu, and Tao Lin. On the diversity and realism of distilled dataset: An efficient dataset distillation paradigm. *arXiv preprint arXiv:2312.03526*, 2023. Peng Sun, Bei Shi, Daiwei Yu, and Tao Lin. On the diversity and realism of distilled dataset: An efficient dataset distillation paradigm. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024. Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In *International conference* on machine learning, pp. 10347–10357. PMLR, 2021. Kai Wang, Bo Zhao, Xiangyu Peng, Zheng Zhu, Shuo Yang, Shuo Wang, Guan Huang, Hakan Bilen, Xinchao Wang, and Yang You. Cafe: Learning to condense dataset by aligning features. In *Proceedings* of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022. Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A Efros. Dataset distillation. *arXiv preprint* arXiv:1811.10959, 2018. Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A. Efros. Dataset distillation, 2020. Yifan Wu, Jiawei Du, Ping Liu, Yuewei Lin, Wenqing Cheng, and Wei Xu. Dd-robustbench: An adversarial robustness benchmark for dataset distillation. *arXiv preprint arXiv:2403.13322*, 2024. Eric Xue, Yijiang Li, Haoyang Liu, Yifan Shen, and Haohan Wang. Towards adversarially robust dataset distillation by curvature regularization. *arXiv preprint arXiv:2403.10045*, 2024. Zeyuan Yin, Eric Xing, and Zhiqiang Shen. Squeeze, recover and relabel: Dataset condensation at imagenet scale from a new perspective. In *NeurIPS*, 2023. Bo Zhao and Hakan Bilen. Dataset condensation with differentiable siamese augmentation. In *International* Conference on Machine Learning, pp. 12674–12685. PMLR, 2021. Bo Zhao and Hakan Bilen. Dataset condensation with distribution matching. In *IEEE/CVF Winter Conference on Applications of Computer Vision, WACV 2023, Waikoloa, HI, USA, January 2-7, 2023*, 2023. Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset condensation with gradient matching. *arXiv* preprint arXiv:2006.05929, 2020. Binglin Zhou, Linhao Zhong, and Wentao Chen. Improve cross-architecture generalization on dataset distillation. *arXiv preprint arXiv:2402.13007*, 2024a. Muxin Zhou, Zeyuan Yin, Shitong Shao, and Zhiqiang Shen. Self-supervised dataset distillation: A good compression is all you need. *arXiv preprint arXiv:2404.07976*, 2024b. Yongchao Zhou, Ehsan Nezhadarya, and Jimmy Ba. Dataset distillation using neural feature regression. Advances in Neural Information Processing Systems, 35:9813–9827, 2022. ## Appendix A Datasets Details We conduct experiments on three ImageNet scale datasets, Tiny-ImageNet (Le & Yang, 2015), ImageNet1K (Deng et al., 2009), and ImageNet-21K (Ridnik et al., 2021). The dataset details are as follows: - CIFAR-100 dataset composes 500 training images per class, each with a resolution of 32×32 pixels, across 100 classes. - Tiny-ImageNet dataset is derived from ImageNet-1K and consists of 200 classes. Within each category, there are 500 images with a uniform 64×64 resolution. - ImageNet-1K dataset comprises 1,000 classes and 1,281,167 images in total. We resize all images into standard 224×224 resolution during the data loading stage. - The original ImageNet-21K dataset is an extensive visual recognition dataset containing 21,841 classes and 14,197,122 images. We use ImageNet-21K-P (Ridnik et al., 2021) which utilizes data processing to remove infrequent classes and resize all images to 224×224 resolution. After data processing, ImageNet21K-P dataset consists of 10,450 classes and 11,060,223 images. ## B Implementation Details B.1 Cifar-100 Hyper-parameter Setting. We train a modified ResNet-18 model (He et al., 2020) on CIFAR-100 training data with a Top-1 accuracy of 79.1% using the parameter setting in Table 7a. The well-trained model serves as the recovery model under the recovery setting in Table 7b. Table 7: Hyper-parameter settings on CIFAR-100. | (a) Squeezing/validation setting. | (b) Recovery setting. | | | |-------------------------------------|---------------------------|-------------------|-------| | config | value | config | value | | optimizer | SGD | | | | base learning rate | 0.1 | | | | momentum | 0.9 | | | | weight decay | 5e-4 | | | | batch size | 128 (squeeze) / 8 (val) | | | | learning rate schedule | cosine decay | | | | training epoch | 200 (squeeze) / 800 (val) | | | | augmentation | RandomResizedCrop | αBN | 0.01 | | | optimizer | Adam | | | | base learning rate | 0.25 | | | | momentum | β1, β2 = 0.5, 0.9 | | | | batch size | 100 | | | | learning rate schedule | cosine decay | | | | recovery iteration | 1,000 | | | | augmentation | RandomResizedCrop | | Due to the low resolution of CIFAR images, the default lower bound βl needs to be raised from 0.08 (ImageNet setting) to a higher reasonable value in order to avoid the training inefficiency caused by extremely small cropped areas with little information. Thus, we conducted the ablation to select the optimal value for the default lower bound βlin RandomResizedCrop operations in Table 8. We choose 0.4 as the default lower bound βlin Algorithm 1 to exhibit the best distillation performance on CIFAR-100. We adopt a small batch size value of 8 and extend the training budgets in the following validation stage, which aligns with the strong training recipe on inadequate datasets. | default lower bound βl | 0.08 | 0.2 | 0.4 | 0.6 | 0.8 | 1.0 | |---------------------------------|--------|-------|-------|-------|-------|-------| | validation accuracy (800ep) (%) | 58.5 | 62.14 | 64.0 | 63.36 | 61.65 | 54.43 | Table 8: Ablation on the lower bound βl setting in distilling CIFAR-100. ## B.2 Tiny-Imagenet Hyper-parameter Setting. We train a modified ResNet-18 model (He et al., 2020) on Tiny-ImageNet training data with the parameter setting in Table 9a and use the well-trained ResNet-18 model with a Top-1 accuracy of 61.2% as a recovery model for CDA. The recovery setting is provided in Table 9b. Table 9: Hyper-parameter settings on Tiny-ImageNet. | (a) Squeezing/validation setting. | (b) Recovery setting. | | | |-------------------------------------|--------------------------|-------------------|-------| | config | value | config | value | | optimizer | SGD | | | | base learning rate | 0.2 | | | | momentum | 0.9 | | | | weight decay | 1e-4 | | | | batch size | 256 (squeeze) / 64 (val) | | | | learning rate schedule | cosine decay | | | | training epoch | 50 (squeeze) / 100 (val) | | | | augmentation | RandomResizedCrop | αBN | 1.0 | | | optimizer | Adam | | | | base learning rate | 0.1 | | | | momentum | β1, β2 = 0.5, 0.9 | | | | batch size | 100 | | | | learning rate schedule | cosine decay | | | | recovery iteration | 4,000 | | | | augmentation | RandomResizedCrop | | | Tiny-ImageNet IPC | DM | MTT | CDA (200ep) | CDA (400ep) | CDA (800ep) | |---------------------|------|-------|---------------|---------------|---------------| | 1 | 3.9 | 8.8 | 2.38 ± 0.08 | 2.82 ± 0.06 | 3.29 ± 0.26 | | 10 | 12.9 | 23.2 | 30.41 ± 1.53 | 37.41 ± 0.02 | 43.04 ± 0.26 | | 20 | - | - | 43.93 ± 0.20 | 47.76 ± 0.19 | 50.46 ± 0.14 | | 50 | 24.1 | 28.0 | 50.26 ± 0.09 | 51.52 ± 0.17 | 55.50 ± 0.18 | Small IPC Setting Comparison. Table 10 presents the result comparison among our CDA, DM (Zhao & Bilen, 2023) and MTT (Cazenavette et al., 2022b). Consider that our approach is a decoupled process of dataset compression followed by recovery through gradient updating. It is well-suited to large-scale datasets but less so for small IPC values. As anticipated, there is no advantage when IPC value is extremely low, such as IPC = 1. However, when the IPC is increased slightly, our method demonstrates considerable benefits on accuracy over other counterparts. Furthermore, we emphasize that our approach yields substantial improvements when afforded a larger training budget, i.e., more training epochs. Table 10: Comparison with baseline methods on Tiny-ImageNet. | # class | 40 | 80 | 120 | 160 | 200 | |------------|-------|-------|-------|-------|-------| | SRe2L | 45.60 | 48.71 | 49.27 | 50.25 | 50.27 | | CDA (ours) | 51.93 | 53.63 | 53.02 | 52.60 | 52.15 | | # class | 20 | 40 | 60 | 80 | 100 | 120 | 140 | 160 | 180 | 200 | |------------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | SRe2L | 38.17 | 44.97 | 47.12 | 48.48 | 47.67 | 49.33 | 49.74 | 50.01 | 49.56 | 50.13 | | CDA (ours) | 44.57 | 52.92 | 54.19 | 53.67 | 51.98 | 53.21 | 52.96 | 52.58 | 52.40 | 52.18 | Continual Learning. We adhere to the continual learning codebase outlined in Zhao et al. (2020) and validate provided SRe2L and our CDA distilled Tiny-ImageNet dataset under IPC 100 as illustrated in Figure 8. Detailed values are presented in the Table 11 and Table 12. Table 11: 5-step class-incremental learning on Tiny-ImageNet. This complements details in the left subfigure of Figure 8. Table 12: 10-step class-incremental learning on Tiny-ImageNet. This complements details in the right subfigure of Figure 8. ## B.3 Imagenet-1K Hyper-parameter Settings. We employ PyTorch off-the-shelf ResNet-18 and DenseNet-121 with the Top-1 accuracy of {69.8%, 74.4%} which are trained with the official recipe in Table 13a. And the recovery settings are provided in Table 13c, and it is noteworthy that we tune and set distinct parameters αBN and learning rate for different recovery models in Table 13d. Then, we employ ResNet-{18, 50, 101, 152} (He et al., 2016), DenseNet-121 (Huang et al., 2017), RegNet (Radosavovic et al., 2020), ConvNeXt (Liu et al., 2022b), and DeiT-Tiny (Touvron et al., 2021) as validation models to evaluate the cross-model generalization on distilled ImageNet-1K dataset under the validation setting in Table 13b. | (a) Squeezing setting. | (b) Validation setting. | | | | |------------------------------|--------------------------------------|-------------------|-----------|--------------| | config | value | config | value | | | | optimizer | AdamW | | | | | base learning rate | 1e-3 | | | | | weight decay | 1e-2 | | | | | batch size | 128 | | | | | learning rate schedule | cosine decay | | | | | training epoch | 300 | | | | | augmentation | RandomResizedCrop | | | | optimizer | SGD | | | | | base learning rate | 0.1 | | | | | momentum | 0.9 | | | | | weight decay | 1e-4 | | | | | batch size | 256 | | | | | lr step size | 30 | | | | | lr gamma | 0.1 | | | | | training epoch | 90 | | | | | augmentation | RandomResizedCrop | | | | | (c) Shared recovery setting. | (d) Model-specific recovery setting. | | | | | config | value | config | ResNet-18 | DenseNet-121 | | | αBN | 0.01 | 0.01 | | | | base learning rate | 0.25 | 0.5 | | | | recovery iteration | 1,000 / 4,000 | 1,000 | | | optimizer | Adam | | | | | momentum | β1, β2 = 0.5, 0.9 | | | | | batch size | 100 | | | | | learning rate schedule | cosine decay | | | | | augmentation | RandomResizedCrop | | | | Table 13: Hyper-parameter settings on ImageNet-1K. | Method \Validation Model | ResNet-18 | ResNet-50 | ResNet-101 | DenseNet-121 | RegNet-Y-8GF | |----------------------------|-------------|-------------|--------------|----------------|----------------| | SRe2L (4K) | 46.80 | 55.60 | 57.59 | 49.74 | 60.34 | | Our CDA (1K) | 52.88 | 60.70 | 61.10 | 57.26 | 62.94 | | Our CDA (4K) | 53.45 | 61.26 | 61.57 | 57.35 | 63.22 | Histogram Values. The histogram data of ImageNet-1K comparison with SRe2L in Figure 1 can be conveniently found in the following Table 14 for reference. Table 14: ImageNet-1K comparison with SRe2L. This table complements details in Figure 1. To conduct the ablation studies efficiently in Table 2, Table 19 and Figure 6, we recover the data for 1,000 iterations and validate the distilled dataset with a batch size of 1,024, keeping other settings the same as Table 13. Detailed values of the ablation study on schedulers are provided in Table 15. Table 15: Ablation study on three different schedulers with varied milestone settings. It complements details in Figure 6. | Scheduler \ Milestone | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1 | |-------------------------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | Step | 45.46 | 46.08 | 46.65 | 46.75 | 46.87 | 46.13 | 45.27 | 44.97 | 42.49 | 41.18 | | Linear | 45.39 | 46.30 | 46.59 | 46.51 | 46.60 | 47.18 | 47.13 | 47.37 | 48.06 | 47.78 | | Cosine | 45.41 | 45.42 | 46.15 | 46.90 | 46.93 | 47.42 | 46.86 | 47.33 | 47.80 | 48.05 | Cross-Model Generalization. To supplement the validation models on distilled ImageNet-1K in Table 5, including more different architecture models to evaluate the cross-architecture performance. We have conducted validation experiments on a broad range of models, including SqueezeNet, MobileNet, EfficientNet, MNASNet, ShuffleNet, ResMLP, AlexNet, DeiT-Base, and VGG family models. These validation models are selected from a wide variety of architectures, encompassing a vast range of parameters, shown in Table 16. In the upper group of the table, the selected models are relatively small and efficient. There is a trend that its validation performance improves as the number of model parameters increases. In the lower group, we validated earlier models AlexNet and VGG. These models also show a trend of performance improvement with increasing size, but due to the simplicity of early model architectures, such as the absence of residual connections, their performance is inferior compared to more recent models. Additionally, we evaluated our distilled dataset on ResMLP, which is based on MLPs, and the DeiT-Base model, which is based on transformers. In summary, the distilled dataset created using our CDA method demonstrates strong validation performance across a wide range of models, considering both architectural diversity and parameter size. | Model | SqueezeNet | MobileNet | EfficientNet | MNASNet | ShuffleNet | ResMLP | |--------------|--------------|-------------|----------------|-----------|--------------|----------| | #Params (M) | 1.2 | 3.5 | 5.3 | 6.3 | 7.4 | 30.0 | | accuracy (%) | 19.70 | 49.76 | 55.10 | 55.66 | 54.69 | 54.18 | | Model | AlexNet | DeiT-Base | VGG-11 | VGG-13 | VGG-16 | VGG-19 | | #Params (M) | 61.1 | 86.6 | 132.9 | 133.0 | 138.4 | 143.7 | | accuracy (%) | 14.60 | 30.27 | 36.99 | 38.60 | 42.28 | 43.30 | Table 16: ImageNet-1K Top-1 on cross-model generation. Our CDA dataset consists of 50 IPC. Hyper-parameter Setting. ImageNet-21K-P (Ridnik et al., 2021) proposes two training recipes to train ResNet-{18, 50} models. One way is to initialize the models from well-trained ImageNet-1K weight and train on ImageNet-21K-P for 80 epochs, another is to train models with random initialization for 140 epochs, as shown in Table 17a. The accuracy metrics on both training recipes are reported in Table 18. In our experiments, we utilize the pre-trained ResNet-{18, 50} models initialized by ImageNet-1K weight with the Top-1 accuracy of {38.1%, 44.2%} as recovery model. And the recovery setting is provided in Table 17c. Then, we evaluate the quality of the distilled ImageNet-21K dataset on ResNet-{18, 50, 101} validation models under the validation setting in Table 17b. To accelerate the ablation study on the batch size setting in Table 4, we train the validation model ResNet-18 for 140 epochs. ## C Reverse Curriculum Learning Reverse Curriculum Learning (RCL). We use a reverse step scheduler in the RCL experiments, starting with the default cropped range from βl to βu and transitioning at the milestone point to optimize the whole image, shifting from challenging to simpler optimizations. Other settings follow the recovery recipe on ResNet-18 for 1K recovery iterations. Table 19 shows the RCL results, a smaller step milestone indicates an earlier difficulty transition. The findings reveal that CRL does not improve the generated dataset's quality compared to the baseline SRe2L, which has 44.90% accuracy. | (a) Squeezing setting. | (b) Validation setting. | | | |--------------------------|-----------------------------------|------------------------------|-------| | config | value | config | value | | optimizer | Adam | | | | base learning rate | 3e-4 | | | | weight decay | 1e-4 | | | | batch size | 1,024 | | | | learning rate schedule | cosine decay | | | | label smooth | 0.2 | | | | training epoch | 80/140 | | | | augmentation | CutoutPIL, RandAugment | optimizer | AdamW | | | base learning rate | 2e-3 | | | | weight decay | 1e-2 | | | | batch size | 32 | | | | learning rate schedule | cosine decay | | | | label smooth | 0.2 | | | | training epoch | 300 | | | | augmentation | CutoutPIL, RandomResizedCrop | | | (c) Recovery setting. | | | | | config | value | | | | αBN | 0.25 | | | | optimizer | Adam | | | | base learning rate | 0.05 (ResNet-18), 0.1 (ResNet-50) | | | | momentum | β1, β2 = 0.5, 0.9 | | | | batch size | 100 | | | | learning rate schedule | cosine decay | | | | recovery iteration | 2,000 | | | | augmentation | RandomResizedCrop | | | Table 17: Hyper-parameter settings on ImageNet-21K. | Model | Initial Weight | Top-1 Acc. (%) | Top-5 Acc. (%) | |----------------------|------------------|------------------|------------------| | ResNet-18 (Ours) | ImageNet-1K | 38.1 | 67.2 | | Random | 38.5 | 67.8 | | | Ridnik et al. (2021) | ImageNet-1K | 42.2 | 72.0 | | ResNet-50 (Ours) | ImageNet-1K | 44.2↑2.0 | 74.6↑2.6 | | Random | 44.5↑2.3 | 75.1↑3.1 | | | Step Milestone | Accuracy (%) | |------------------|----------------| | 0.2 | 41.38 | | 0.4 | 41.59 | | 0.6 | 42.60 | | 0.8 | 44.39 | Table 18: Accuracy of ResNet-{18, 50} on ImageNet-21K-P. Table 19: Ablation of reverse curriculum learning. ## D Visulization We provide additional comparisons of four groups of visualizations on synthetic ImageNet-21K images at recovery steps of {100, 500, 1,000, 1,500, 2,000} between SRe2L (upper) and CDA (lower) in Figure 9. The chosen target classes are Benthos, Squash Rackets, *Marine Animal*, and *Scavenger*. In addition, we present our CDA's synthetic ImageNet-1K images in Figure 10 and ImageNet-21K images in Figure 11 and Figure 12. ![20_image_0.png](20_image_0.png) ![21_image_0.png](21_image_0.png) Figure 10: Synthetic ImageNet-1K data visualization from CDA. ![22_image_0.png](22_image_0.png) ![23_image_0.png](23_image_0.png)
Review 1: Summary: This paper proposes to improve large-scale dataset distillation using a proposed curriculum data augmentation (CDA), which gradually increases the training difficulty by lowering the minimal crop ratio. The rest of the method is the same as a prior method SRe$^2$L. There are 3 steps: - **Squeeze**, where a model is trained on the real dataset and frozen in the following stages. This step follows from the practices in SRe$^2$L. - **Recover**, which is the synthesizing step where images are generated using gradient information. The motivation for CDA is that we want to refine the gradients from global to local throughout training. - For CDA, the paper considers 2 scheduling for the curriculum (i.e. linear and cosine), and searches over the length of the curriculum (called the "milestone"). - **Relabel**, where a model is . The paper finds that small-batch training helps improve the performance, especially when the data is limited. The paper shows that CDA improves over the baseline SRe$^2$L across datasets (CIFAR-100, Tiny-ImageNet, ImageNet-1K and 21K) and models (ResNet-18, 50, 101, DenseNet, RegNet, ConvNeXt, DeiT). The paper provides ablation study on the effects of curriculum scheduling and batch size. Strengths and Weaknesses: Strength: - Although CDA is the only major technical modification, it is effective and works well across datasets and architectures. It's interesting to know that a simple change in curriculum suffices to provide good performance. - The paper provides thorough experiments and ablation studies. - This includes comparison at various Image-per-class (IPC), curriculum scheduling (or ranges for constant cropping ratios), and batch sizes. - It discusses the computation cost for synthesis. Weakness: My main complaint is that the method is highly specific to the baseline SRe$^2$L, which is the only baseline in this work. - The paper mentions several related works at the end of the related work section. Could you provide a brief description on these works, and the reason why these methods are not compared against? - Are there other baselines that can achieve comparable performance, and if yes, can the curriculum idea be applied to these baselines? Some other comments: - The title should be made more specific. Currently the title is overly broad and vague. - Eq (3): why taking the sup rather than the average? - In the paragraph of "Relabel: Post-training on Larger Models with Stronger Training Recipes.", the paper mentions that another prior method TESLA has a decline in accuracy when scaled up. Could you comment on why? - Fig 4: Each step has 2 boxes, one with solid borders, one with dashed borders. Are the two boxes of the same type (i.e. simply 2 crops), or does the border type signal anything? - At the end of section 3, the paragraph of "Advantages of Global-to-local Synthesis": this paragraph mentions 3 advantages of the proposed CDA: (1) stabilized training, (2) better generalization, and (3) avoiding overfitting. Aren't "better generalization" and "avoiding overfitting" the same? - Are $\beta_l, \beta_u$ used other than in Table 2? If not, please remove these notations and use 0.08, 1 directly. - The ablation on the curriculum schedule (i.e. Fig 6): I wonder how much difference linear vs cosine schedules have -- how many seeds are used in producing the bars in Fig 6? Also, it seems that the best performance is from Linear at 90%. - There's a minor typo next to Table 6. Requested Changes: Questions: - In "Synthesis Cost", could you add a comment comparing the synthesis time to the training time of the models being tested? - We may want to trade off quality versus efficiency. Could you comment on how the quality of the pretrained model and the number of recovery iterations affect the quality of the generated data? For example, why Table 7(b) uses 1000 recover iterations? - Could you comment on potential ways to reduce the synthesis cost? For example, would selecting (rather than randomly sampling) the images per class provide improvements? - Table 1: What would the results be for higher IPC (e.g. 32%, 64%)? I’m wondering whether there’s a smooth growth in performance w.r.t. IPC. Please treat this question as optional since it's expensive to generate more images. Broader Impact Concerns: There are no direct societal or ethical concerns. ================================================== Review 2: Summary: This paper addresses the challenge of dataset distillation, which involves generating a smaller yet representative subset from a large dataset to enable efficient model training while maintaining strong performance on the original testing data distribution. Previous methods have struggled with improper gradient update strategies, leading to a decline in the quality of the distilled datasets. To overcome this, the authors propose a novel global-to-local gradient refinement approach that is enhanced by curriculum data augmentation (CDA) during the data synthesis process. This method significantly improves the quality of the distilled datasets, achieving state-of-the-art accuracy on both ImageNet-1K and ImageNet-21K benchmarks. Strengths and Weaknesses: **Strengths** * The paper is very well-written and easy to understand. * The proposed method significantly outperforms previous dataset distillation methods. * It is the first work to validate on a large dataset (i.e., ImageNet-21K). * The authors perform a good analysis of their method, including an application to Continual Learning. **Weaknesses** The authors have done a wonderful job explaining and conveying their methods, and the method has been validated with rigorous experiments. Some weaknesses related to the formatting is as follows: * Although it has been mentioned in related works of the different categories of previous methods, it would be great to reiterate why SRe2L and CDA are tied together in Table 1 or somewhere in the Experiments Section (Section 4). * It would be good to highlight that Figure 4 is the central figure for explaining the proposed method, with detailed captions provided to enhance understanding. Requested Changes: See the Weaknesses above. Broader Impact Concerns: N/A ================================================== Review 3: Summary: **Claims and Contributions**: The paper introduces a method for dataset distillation with a special focus at scale using the ImageNet 21k dataset. More specifically, the authors propose curriculum data augmentation (CDA) which utilizes modulated random cropping during the synthesis stage of dataset distillation to better model the global and local structures in dataset samples. Empirically, the proposed method achieves highest accuracy on large scale ImageNet 1k and 21k datasets and outperforms competing baselines. Strengths and Weaknesses: **Strengths**: 1. The proposed curriculum based Random cropping is simple and works nicely at scale. 1. The quantitative evaluation is extensive which helps clarify a lot of questions. **Weaknesses**: **Limited methodological novelty**: Apart from the proposed data augmentation setup, most of the framework for learning distilled samples has already been proposed in prior work. Though for TMLR, I don't think this is a major problem per se. See Requested Changes for other questions/queries. Requested Changes: 1. **Rephrase**: The authors mention: “ Moreover, by working with distilled datasets, there is potential to alleviate some data privacy concerns, as raw, personally identifiable data points might be excluded from the distilled version”. This seems inaccurate as the representative subset might still violate privacy concerns. It might be worth mentioning approaches which utilize recent large scale generative models to synthesize novel samples (not a dataset subset) which have the potential to mitigate these concerns to a large extent (although these methods have their own set of challenges). 1. **Clarification on Quantitative Results**: For the quantitative results in Table 1, are the baselines also evaluated using the improved Squeeze network training as discussed in Section 3.2? If not, can the authors show an ablation of CDA applied to the ResNet 18 model for a small dataset like CIFAR-100 or Tiny ImageNet and compare it with other baselines for fair comparison? 1. The authors mention: “ We have also observed that maintaining a smaller batch size is crucial for post-training on synthetic data to achieve commendable accuracy. This is attributed to the Generalization Gap”. This is not obvious to me. Can the authors elaborate more on this in the main text? 1. While the quantitative results are good, the visualizations in Fig. 7 indicate that the quality of samples even with 2k recovery steps is not comparable to the sample quality achieved by state-of-the-art generative models on large scale datasets. I would highly recommend the authors to include a note in the conclusion highlighting some of the limitations/strengths as compared to generating datasets using powerful image generation models. Broader Impact Concerns: N/A ==================================================
# Learning Algorithms For Markovian Bandits: Is Posterior Sampling More Scalable Than Optimism? Nicolas Gast *nicolas.gast@inria.fr* Bruno Gaujal *bruno.gaujal@inria.fr* Kimang Khun kimang.khun@inria.fr Univ. Grenoble Alpes, Inria, CNRS, Grenoble INPú, LIG 38000 Grenoble, France ú*Institute of Engineering Univ. Grenoble Alpes* Reviewed on OpenReview: *https: // openreview. net/ forum? id= Sh3RF9JowK& noteId= xrsTB4Cenz* ## Abstract In this paper, we study the scalability of model-based algorithms learning the optimal policy of a discounted rested Markovian bandit problem with n arms. There are two categories of model-based reinforcement learning algorithms: Bayesian algorithms (like PSRL), and optimistic algorithms (like UCRL2 or UCBVI). A naive application of these algorithms is not scalable because the state-space is exponential in n. In this paper, we construct variants of these algorithms specially tailored to Markovian bandits (MB) that we call MBPSRL, MB-UCRL2, and MB-UCBVI. We consider an episodic setting with geometrically distributed episode length, and measure the performance of the algorithm in terms of regret (Bayesian regret for MB-PSRL and expected regret for MB-UCRL2 and MB-UCBVI). We prove that, for this setting, all algorithms have a low regret in O˜(S ÔnK) - where K is the number of episodes, n is the number of arms and S is the number of states of each arm. Up to a factor ÔS, these regrets match the Bayesian minimax regret lower bound of ( ÔSnK) that we also derive. Even if their theoretical regrets are comparable, the *time complexities* of these algorithms vary greatly: We show that MB-UCRL2, as well as all algorithms that use bonuses on transition matrices have a time complexity that grows exponentially in n. In contrast, MBUCBVI does not use bonuses on transition matrices and we show that it can be implemented eciently, with a time complexity linear in n. Our numerical experiments show, however, that its empirical regret is large. Our Bayesian algorithm, MB-PSRL, enjoys the best of both worlds: its running time is linear in the number of arms and its empirical regret is the smallest of all algorithms. This is a new addition in the understanding of the power of Bayesian algorithms, that can often be tailored to the structure of the problems to learn. ## 1 Introduction Markov decision processes (MDPs) are a powerful model to solve stochastic optimization problems. They suer, however, from what is called the *curse of dimensionality*, which basically says that the state size of a Markov process is exponential in the number of system components. This implies that the complexity of computing an optimal policy is, in general, exponential in the number of system components. The same holds for general purpose reinforcement learning algorithms: they all have a regret and a runtime exponential in the number of components, so they also suer from the same curse. Very few MDPs are known to escape from this curse of dimensionality. One of the most famous examples is the Markovian bandit problem in which a decision maker faces n Markov reward processes (the n components, that we will call the n arms in the rest of the paper), and must decide which arm to activate at each decision epoch. Markovian bandit is a well structured MDP; and an optimal policy for such a system can be computed in O(n), by using the Gittins indices (computed for each arm independently), and its value can be computed by using retirement values (see for example Whittle (1996)). In this paper, we investigate how reinforcement learning algorithms can exploit these two advantages. We consider an episodic setting with geometrically distributed episode length, in which the optimal strategy for a decision maker who know all parameters of the system is to use Gittins index policy. We study a specialization of PSRL (Osband et al., 2013) to Markovian bandits, that we call Markovian bandit posterior sampling (MB-PSRL) that consists in using PSRL with a prior tailored to Markovian bandits. We show that the Bayesian regret of MB-PSRL is sub-linear in the number of episodes and arms. We also provide an expected regret guarantee for two optimistic algorithms that we call MB-UCRL2 and MB-UCBVI, and that are based respectively on UCRL2 (Jaksch et al., 2010) and UCBVI (Azar et al., 2017). They both use modified confidence bounds adapted to Markovian bandit problems. The upper bound for their regret is similar to the bound for MB-PSRL. This shows that in terms of regret, the Bayesian approach (MBPSRL) and the optimistic approach (MB-UCRL2 and MB-UCBVI) scale well with the number of arms. We also provide a Bayesian minimax regret lower bound for any learning algorithm in rested Markovian bandit problems with the aforementioned setting, which shows that the regret bounds that we obtain for the three algorithms are close to optimal. The situation is radically dierent when considering the processing time: the runtime of MB-PSRL is linear (in the number of arms), while the runtime of MB-UCRL2 is exponential. We show that this is not an artifact of our implementation of MB-UCRL2 by exhibiting a Markovian bandit problem for which being optimistic in each arm is not optimistic in the global MDP. This implies that UCRL2 and its variants (Bourel et al., 2020; Fruit et al., 2018; Talebi & Maillard, 2018; Filippi et al., 2010) cannot be adapted to have ecient runtime in Markovian bandit problems unless an oracle gives the optimal policy. We argue that this nonscalability of UCRL2 and its variants is not a limitation of the optimistic approach but comes from the fact that UCRL2 relies on extended value iteration (Jaksch et al., 2010) needed to deal with upper confidence bounds on the transition matrices. We show that MB-UCBVI, an optimistic algorithm that does not add bonus on transition probabilities and hence does not rely on extended value iteration, does not suer from the same problem. Its regret is sub-linear in the number of episodes, and arms (although larger than the regret of both MB-PSRL and MB-UCRL2), and its runtime is linear in the number of arms. This allows us to conclude that, on the one hand, if a weakly coupled MDP or a factored MDP can be solved eciently when all the parameters are known, then the Bayesian approach is ecient both in terms of learning and computation time. On the other hand, knowing how to solve a weakly coupled MDP or a factored MDP eciently is not sucient for all optimistic algorithms to be computationally ecient. We also conduct a series of numerical experiments to compare the performance of MB-PSRL, MB-UCRL2 and MB-UCBVI. They confirm the good behavior of MB-PSRL, both in terms of regret and computational complexity. These numerical experiments also show that the empirical regret of MB-UCBVI is larger than the regret of MB-PSRL and MB-UCRL2, confirming the comparisons between the upper bounds derived in Theorem 1. All this makes MB-PSRL the better choice between the three learning algorithms. Related work Markovian bandits have been applied to many problems such as single-machine scheduling, choosing a job in ressource constraint problems as well as other industrial research problems. Many applications can be found in Puterman (2014, Section 3.6) and Gittins et al. (2011). Gittins (1979) shows that rested Markovian bandit can be solved linearly in the number of arms using Gittins index policy. Therefore, several papers are focused on the complexity of computing Gittins index (Chakravorty & Mahajan, 2014; Gast et al., 2022). In this paper, we focus on rested Markovian bandit problems with discount factor - < 1 where all reward functions and transition matrices are unknown. A possible approach to learn under these conditions is to ignore the problem structure and view the Markovian bandit problem as a generic MDP. There are two main families of generic reinforcement learning algorithms with regret guarantees. The first one uses the *optimism in face of uncertainty* (OFU) principle. OFU methods build a confidence set for the unknown MDP and compute an optimal policy of the "best" MDP in the confidence set, *e.g.*, Bourel et al. (2020); Zhang & Ji (2019); Talebi & Maillard (2018); Fruit et al. (2017); Azar et al. (2017); Bartlett & Tewari (2012); Jaksch et al. (2010). UCRL2 (Jaksch et al., 2010) is a well known OFU algorithm. The second family uses a Bayesian approach, the posterior sampling method introduced by Thompson (1933). Such algorithms keep a posterior distribution over possible MDPs and execute the optimal policy of a sampled MDP, see e.g., Ouyang et al. (2017); Agrawal & Jia (2017); Gopalan & Mannor (2015); Osband et al. (2013). PSRL (Osband et al., 2013) is a classical example of Bayesian learning algorithm. All these algorithms, based on OFU or on Bayesian principles, have sub-linear bounds on the regret, which means that they provably learn the optimal policy. Yet, applied as-is to Markovian bandit problems, these bounds grow exponentially with the number of arms. Our work is not the first attempt to exploit the structure of a MDP to improve learning. Factored MDPs (the state space can be factored into n œ Nú components) are investigated in Guestrin et al. (2003), where asymptotic convergence to the optimal policy is proved to scale polynomially in the number of components. The regret of learning algorithms in factored MDP with a factored action space is considered by Tian et al. (2020); Rosenberg & Mansour (2020); Xu & Tewari (2020); Osband & Van Roy (2014). Our work diers substantially from these. First, the Markovian bandit problem is not a factored MDP because the action space is global and cannot be factored. Second, our reward is discounted over an infinite horizon while factored MDPs have been analyzed with no discount. Finally, and most importantly, the factored MDP framework assumes that the successive optimal policies are computed by an unspecified solver (oracle). There is no guarantee that the time complexity of this solver scales linearly with the number of components, especially for OFU-based algorithms. For Markovian bandits, we get an additional leverage: when all parameters are known, the Gittins index policy is known to be an optimal policy and its computational complexity is linear in the number of arms. This reveals an interesting dierence between Bayesian and extended value based algorithms (the former being scalable and not the latter). This dierence is not present in the literature about factored MDPs because such papers do not consider the time complexity. Our Markovian bandit setting is known in the literature as rested or *restful* bandit or a family of alternative bandit processes. Tekin & Liu (2012) consider a non-discounted setting, - = 1, and provide algorithms with logarithmic regret guarantee for *rested* as well as *restless* settings (a generalization of rested). However, they consider a notion of regret known as *weak regret* that measures how fast the learning algorithm identifies the best arm in stationary regime. So, it ignores the learning behavior at the beginning of learning process. In contrast, we consider the discounted rested bandit setting in which the regret of Tekin & Liu (2012) makes no more senses due to the discount factor and we propose a regret definition that is frequently used in reinforcement learning literature and captures the performance of a learning algorithm during the whole learning process. In addition, Ortner et al. (2012); Jung & Tewari (2019); Wang et al. (2020b) consider a non-discounted restless bandit setting in which only the state of chosen arms are observed by the learner. Ortner et al. (2012); Wang et al. (2020b) propose optimistic algorithms for infinite-horizon setting and provide regret bounds that are sub-linear in time. Again the discounted case is not considered in these papers while it is particularly interesting because learning algorithms can leverage the optimal Gittins index policy. Jung & Tewari (2019) propose a Bayesian algorithm in the episodic finite-horizon setting and also provide a regret bound that is sub-linear in the number of episodes. However, the computational complexity is not studied in their work (the algorithm of Ortner et al. (2012) is intractable while the ones of Jung & Tewari (2019); Wang et al. (2020b) rely on the unspecified problem solver called *oracle*). Contrarily, we provide both performance guarantee and computational complexity analysis of each algorithm that we consider in this paper. Finally, Killian et al. (2021) consider a more general setting of restless bandits in which each arm is itself a MDP and the learner has to decide which arms to choose and which action to execute on each chosen arm under a global action constraint. The authors propose a Lagrangian suboptimal policy to solve the restless bandit problem with known parameters and a sampling algorithm to learn their Lagrangian policy when the parameters are unknown. Unfortunately, no performance guarantee is provided in their work. Since index policies scale with the number of arms, using Q-learning approaches to learn such a policy is also popular, see *e.g.*, Avrachenkov & Borkar (2022); Fu et al. (2019); Du (1995). Du (1995) addresses the same Markovian bandit problem as we do: their algorithm learns the optimal value in the restart-in-state MDP (Katehakis & Veinott Jr, 1987) for each arm and uses Softmax exploration to solve the explorationexploitation dilemma. As mentioned on page 250 of Auer et al. (2002), however, there exists no finite-time regret bounds for this algorithm. Furthermore, tuning its hyperparameters (learning rate and temperature) is rather delicate and unstable in practice. ## 2 Markovian Bandit Problem In this section, we introduce the Markovian bandit problem and recall the notion of Gittins index when the parameters (ra, Qa) of all arms are known. ## 2.1 Definitions And Main Notations We consider a Markovian bandit problem with n arms. Each arm ÈSa, ra, QaÍ for a œ {1*,...,n*} =: [n] is a Markov reward process with a finite state space Sa of size S. Each arm has a mean reward vector, ra œ [0, 1]S, and a transition matrix Qa. When Arm a is activated in state xa œ Sa, it moves to state ya œ Sa with probability Qa(xa, ya). This provides a reward whose expected value is ra(xa). Without loss of generality, we assume that the state spaces of the arms are pairwise distinct: Sa fl Sb = ÿ for a "= b. In the following, the state of an arm a will always be denoted with an index a: we will denote such a state by xa or ya. As state spaces are disjoint, this allows us to simplify the notation by dropping the index a from the reward and transition matrix: when convenient, we will denote them by r(xa) instead of ra(xa) and by Q(xa, ya) instead of Qa(xa, ya) since no confusion is possible. At time 1, the global state X1 is distributed according to some initial distribution fl over the global state space E = S1◊ ... ◊Sn. At time t, the decision maker observes the states1 of all arms, Xt = (Xt,1 ... Xt,n), and chooses which arm At to activate. This problem can be cast as a MDP - that we denote by M - with state space E and action space [n]. Let a œ [n] and x, y œ E. If the state at time t is Xt = x, the chosen arm is At = a, then the agent receives a random reward Rt drawn from some distribution on [0, 1] with mean r(xa) and the MDP M transitions to state Xt+1 = y with probability Pa(x, y) that satisfies: $$P^{a}(\mathbf{x},\mathbf{y})={\begin{cases}Q(x_{a},y_{a})&{\mathrm{if~}}x_{a^{\prime}}=y_{a^{\prime}}{\mathrm{~for~all~}}a^{\prime}\neq a;\\ 0&{\mathrm{otherwise.}}\end{cases}}$$ That is, the active arm makes a transition while the other arms remain in the same state. Let be the set of deterministic policies, *i.e.,* the set of functions fi : E 'æ [n]. For the MDP M, we denote by V fiM(x) the expected cumulative discounted reward of M under policy fi starting from an initial state x: $$V_{M}^{\pi}(\mathbf{x}){=}\mathbb{E}\left[\sum_{t=1}^{\infty}\beta^{t-1}R_{t}\mid\mathbf{X}_{1}{=}\mathbf{x},A_{t}{=}\pi(\mathbf{X}_{t})\right].$$ $\quad(1)$ . An alternative definition of V is to consider a finite-horizon problem with a geometrically distributed length. Indeed, let H be a time-horizon geometrically distributed with parameter 1 ≠ - > 0. We have $$V_{M}^{\pi}(\mathbf{x}){=}\mathbb{E}\left[\sum_{t=1}^{H}R_{t}\ |\ \mathbf{X}_{1}{=}\mathbf{x},A_{t}{=}\pi(\mathbf{X}_{t})\right].\tag{2}$$ Problem 1. Given a Markovian bandit M with n arms, each is a Markov reward process ÈSa, ra, QaÍ *with* a finite state space of size S, find a policy fi : S1◊ ... ◊Sn 'æ [n] that maximizes V fiM(x) *for any state* x distributed according to initial global state distribution fl. By a small abuse of notation, we denote by V fiM(fl) the expected reward when the initial state is randomly generated according to fl : V fiM(fl) = qx fl(x)V fiM(x). A policy fiú is optimal for Problem 1 if V fiúM (x) Ø V fiM(x) for all fi œ and x œ E. By Puterman (2014), such a policy exists and does not depend on x (or fl). One well-known optimal policy is the Gittins index policy, defined below. 1Throughout the paper, we use capital letters (like Xt) to denote random variables and small letter (like x) to denote their realizations. Bold letters (Xt or x) design vectors. Normal letters (Xt,a or xa) are for scalar values. ## 2.2 Gittins Index Policy It is possible to compute an optimal policy fiú for Problem 1 in a reasonable amount of time using the so called Gittins indices: Gittins (1979) defines the *Gittins index* for any arm a in state xa œ Sa as $$\mathrm{GIndex}(x_{a})=\operatorname*{sup}_{\tau>0}{\frac{\mathbb{E}\left[\sum_{t=1}^{\tau}\beta^{t-1}r^{a}(Z_{t})\mid Z_{1}=x_{a}\right]}{\mathbb{E}\left[\sum_{t=1}^{\tau}\beta^{t-1}\mid Z_{1}=x_{a}\right]}},$$ $$\quad(3)$$ where Z is a Markov chain whose transitions are given by Qa and · can be any stopping time adapted to the natural filtration of (Zt)tØ1. So, Gittins index can be considered as the maximal reward density over time of an arm at the given state. Gittins (1979) shows that activating the arm having the largest current index is an optimal policy. Such a policy can be computed very eciently: The computation of the indices of an arm with S states can be done in O(S3) arithmetic operations, which means that the computation of Gittins index policy is linear in the number of arms as it takes O(nS3) arithmetic operations. For more details about Gittins indices and optimality, we refer to Gittins et al. (2011); Weber (1992). For a survey on how to compute Gittins indices, we refer to Chakravorty & Mahajan (2014), and to Gast et al. (2022) for a recent paper that shows how to compute Gittins index in subcubic time (*i.e.*, o(S3)) for each of the n arms). ## 3 Online Learning And Episodic Regret We now consider an extension of Problem 1 in which the decision maker does not know the transition matrices nor the rewards. Our goal is to design a reinforcement learning algorithm that learns the optimal policy from past observations. Similarly to what is done for finite-horizon reinforcement learning with deterministic horizon - see *e.g.*, Zanette & Brunskill (2019); Jin et al. (2018); Azar et al. (2017); Osband et al. (2013) – we consider a decision maker that faces a sequence of independent replicas of the same Markovian bandit problem, where the transitions and the rewards are drawn independently for each episode. What is new here is that the time horizon H is random and has a geometric distribution with expected value 1/(1 ≠ —). It is drawn independently for each episode. This implies that Gittins index policy is optimal for a decision maker that would know the transition matrices and rewards. In this paper, we consider *episodic learning algorithms*. Let H1*,...,H*k be the sequence of random episode lengths and let tk := 1+qk≠1 i=1 Hi be the starting time of the kth episode. Let Ok≠1 := {X1, A1, R1,..., Xtk≠1, Atk≠1, Rtk≠1} denote the observations made prior and up to episode k. An *Episodic* Learning Algorithm L is a function that maps observations Ok≠1 to L(Ok≠1), a probability distribution whose support is . At the beginning of episode k, the algorithm samples fik ≥ L(Ok≠1) and uses this policy during the whole kth episode. Note that one could also design algorithms where learning takes place inside each episode. We will see later that episodic learning as described here is enough to design algorithms that are essentially optimal, in the sense given by Theorem 1 and Theorem 2. For an instance M of a Markovian bandit problem and a total number of episodes K, we denote by Reg(K,L, M) the regret of a learning algorithm L, defined as $$\mathrm{Reg}(K,\mathcal{L},M):=\sum_{k=1}^{K}V_{M}^{\pi_{k}}(\mathbf{X}_{t_{k}})-V_{M}^{\pi_{k}}(\mathbf{X}_{t_{k}}).\tag{4}$$ It is the sum over all episodes of the value of the optimal policy fiú minus the value obtained by applying the policy fik chosen by the algorithm for episode k. In what follows, we will provide bounds on the expected regret. A no-regret algorithm is an algorithm L such that its expected regret E [Reg(K,L, M)] grows sub-linearly in the number of episodes K. This implies that the expected regret over episode k converges to 0 as k goes to infinity. Such an algorithm learns an optimal policy of Problem 1. Note that, for discounted MDPs, an alternative regret definition (used for instance by He et al. (2021)) is to use the non-episodic version qTt=1(V fiúM (Xt) ≠ V fitM (Xt)). In our definition at Equation 4, we use an episodic approach where the process is restarted according to fl after each episode of geometrically distributed length Hk. ## 4 Learning Algorithms For Markovian Bandits In what follows, we present three algorithms having a regret that grows like O˜(S ÔnK), that we call MB- PSRL, MB-UCRL2 and MB-UCBVI. As their names suggest, these algorithms are adaptation of PSRL, UCRL2 and UCBVI to Markovian bandit problems that intend to overcome the exponentiality in n of their regret. The structure of the three MB-* algorithms are similar and is represented in Algorithm 1. All algorithms are episodic learning algorithms. At the beginning of each episode, a MB-* learning algorithm computes a new policy fik that will be used during an episode of geometrically distributed length. The dierence between the three algorithms lies in the way this new policy fik is computed. MB-PSRL uses posterior sampling while MB-UCRL2 and MB-UCBVI use optimism. We detail the three algorithms below. Algorithm 1 Pseudo-code of the three MB-* algorithms. input Discount factor —, initial distribution fl (and a prior distribution {"a}aœ[n] for MB-PSRL) 1: for episodes k = 1, 2*,...* do 2: Compute a new policy fik (using posterior sampling or optimism). 3: Set tk Ω 1 + qk≠1 i=1 Hi, sample Xtk ≥ fl and Hk ≥ Geom(1 ≠ —). 4: for t Ω tk to tk + Hk ≠ 1 do 5: Activate arm At = fik(Xt). 6: Observe Rt and Xt+1. 7: **end for** 8: **end for** ## 4.1 Mb-Psrl MB-PSRL starts with a prior distribution "a over the parameters (ra, Qa). At the start of each episode k, MB-PSRL computes a posterior distribution of parameters "a(·|Ok≠1) for each arm a œ [n] and samples parameters (rak, Qak) from "a(·|Ok≠1) for each arm. Then, MB-PSRL uses {(rak, Qak)}aœ[n] to compute the Gittins index policy fik that is optimal for the sampled problem. The policy fik is then used for the whole episode k. Note that as fik is a Gittins index policy, it can be computed eciently. The dierence between PSRL and MB-PSRL is mostly that MB-PSRL uses a prior distribution tailored to Markovian bandit. The only hyperparameter of MB-PSRL is the prior distribution ". As we see in Appendix E, MB-PSRL seems robust to the choice of the prior distribution, even if a coherent prior gives a better performance than a misspecified prior, similarly to what happens for Thompson's sampling (Russo et al., 2018). ## 4.2 Mb-Ucrl2 At the beginning of each episode k, MB-UCRL2 computes the following quantities for each state xa œ Sa: Nk≠1(xa) the number of times that Arm a is activated before episode k while being in state xa, and rˆk≠1(xa), and Qˆk≠1(xa, ·) are the empirical means of r(xa) and Q(xa, ·). We define the confidence bonuses brk≠1(xa) := Ò log(2*SnKt*k) 2 max{1,Nk≠1(xa)} and b Q k≠1(xa) := Ò 2 log(SnK2S tk) max{1,Nk≠1(xa)} . This defines a confidence set Mk as follows: a Markovian bandit problem MÕ is in Mk if for all a œ [n] and xa œ Sa: |rÕ(xa) ≠ rˆk≠1(xa)| Æ brk≠1(xa) and ÎQÕ(xa, ·) ≠ Qˆk≠1(xa, ·)Î1 Æ b Q k≠1(xa). (5) MB-UCRL2 then chooses a policy fik that is optimal for the most optimistic problem Mk œ Mk: $$\pi_{k}\in\arg\operatorname*{max}_{\pi}\operatorname*{max}_{M^{\prime}\in\mathbb{M}_{k}}V_{M^{\prime}}^{\pi}(\rho).$$ V fiMÕ (fl). (6) $\left(5\right)$. $$(6)$$ Note that as we explain later in Section 6.1, we believe that there is no ecient algorithm to compute the best optimistic policy fik of Equation 6. Compared to a vanilla implementation of UCRL2, MB-UCRL2 uses the structure of the Markovian bandit problem: The constraints Equation 5 are on Q whereas vanilla UCRL2 uses constraints on the full matrix P (defined in Equation 1). This leads MB-UCRL2 to use the bonus term that scales as S/Nk≠1(xa) whereas vanilla UCRL2 would use the term in Sn/Nk≠1(x, a). ## 4.3 Mb-Ucbvi At the beginning of episode k, MB-UCBVI uses the same quantities Nk≠1(xa), rˆk≠1(xa), and Qˆk≠1(xa, ·) as MB-UCRL2. The dierence lies in the definition of the bonus terms. While MB-UCRL2 uses a bonus on the reward and on the transition matrices, MB-UCBVI defines a bonus bak≠1(xa):= 1 1≠— Ò log(2*SnKt*k) 2 max{1,Nk≠1(xa)} that is used on the reward only. MB-UCBVI computes the Gittins index policy fik that is optimal for the bandit problem {(rˆak≠1+bak≠1, Qˆak≠1)}aœ[n]. Similarly to the case of UCRL2, a vanilla implementation of UCBVI would use a bonus that scales exponentially with the number of arms. MB-UCBVI makes an even better use of the structure of the learned problem because the optimistic MDP {(rˆak≠1+bak≠1, Qˆak≠1)}aœ[n] is still a Markovian bandit problem. This implies that the optimistic policy fik is a Gittins index policy, and that can therefore be computed eciently. ## 5 Regret Analysis In this section, we first present upper bounds on the expected regret of the three learning algorithms. These bounds are sub-linear in the number of episodes (hence the three algorithms are no-regret algorithms) and sub-linear in the number of arms. We then derive a minimax lower bound on the Bayesian regret of any learning algorithm in the Markovian bandit problem. ## 5.1 Upper Bounds On Regret The theorem below provides upper bounds on the regret of the three algorithms presented in Section 4. Note that since MB-PSRL is a Bayesian algorithm, we consider its *Bayesian regret*, that is the expectation over all possible models. More precisely, if the unknown MDP M is drawn from a prior distribution ", the Bayesian regret of a learning algorithm L is BayReg(K,L, ") = E[Reg(K,L, M)], where the expectation is taken over all possible values of M ≥ " and all possible runs of the algorithm. The expected regret E [Reg(K,L, M)] is defined by taking the expectation over all possible runs of the algorithm. Theorem 1. Let f(*S, n, K,* —) = Sn (log K/(1≠—))2 + ÔSnK (log K/(1≠—))3/2*. There exists universal* constants C, CÕ and CÕÕ independent of the model (i.e., that do not depend on S, n, K and —*) such that:* - *For any prior distribution* ": $n\,\,\phi_{\vec{r}}$. BayReg(K, MB-PSRL, ") Æ C 3ÔS+ log SnK log K 1 ≠ - 4f(S, n, K, —), $$u n d i t\ m o d e l\ M:$$ - *For any Markovian bandit model* M: $$\mathbb{E}\left[\mathrm{{Reg}}(K,M\!B\!-\!U\!C\!R\!L^{2},M)\right]\leq C^{\prime}\left(\sqrt{S}\!+\!\log\frac{S n K\log K}{1-\beta}\right)f(S,n,K,\beta),$$ $$\mathbb{E}\left[\mathrm{{Reg}}(K,M\!B\!-\!U\!C\!B\!V\!I,M)\right]\leq C^{\prime\prime}\left(\frac{\sqrt{S}}{1-\beta}\right)\left(\log\frac{S n K\log K}{1-\beta}\right)f(S,n,K,\beta),$$ We provide a sketch of proof below. The detailed proof is provided in Appendix A in the supplementary material. This theorem calls for several comments. First, it shows that when K Ø Sn/(1≠—), the regret of MB-PSRL and MB-UCRL2 is smaller than $$\hat{O}\left(\frac{S\sqrt{n K}}{(1-\beta)^{3/2}}\right),$$ $$\left(7\right)$$ , (7) where the notation O˜ means that all logarithmic terms are removed. The regret of MB-UCBVI has an extra 1/(1 ≠ —) factor. Hence, the regret of the three algorithms is sub-linear in the number of episodes K which means that they all are no-regret algorithms. This regret bound is sub-linear in the number of arms which is very significant in practice when facing a large number of arms. Note that directly applying PSRL, UCRL2 or UCBVI would lead to a regret in O˜ 1SnÔnK2or O˜ 1ÔnSnK 2, which is exponential in n. Second, the upper bound on the expected regret of MB-UCRL2 (and of MB-UCBVI) is a guarantee for a specific problem M while the bound on Bayesian regret of MB-PSRL is a guarantee in average overall the problems drawn from the prior ". Hence, the bounds of MB-UCRL2 and MB-UCBVI are stronger guarantee compared to the one of MB-PSRL. Yet, as we will see later in the numerical experiments reported in Section 7, MB-PSRL seems to have a smaller regret in practice, even when the problem does not follow the correct prior. An interesting open question would be to find a prior that would guarantee that MB-PSRL has a good worst-case regret bound. We do not know if such a prior exists and to the best of our knowledge, this question is also open for the classical PSRL. Note that there exist Bayesian type algorithms with worst-case guarantees, see *e.g.*, (Ishfaq et al., 2021; Agrawal et al., 2021; Wang et al., 2020a; Agrawal & Jia, 2017) but they contain an optimistic part and it is not clear how to implement them in an ecient manner for Markovian bandits. Third, the result of Theorem 1 is the statistical evaluation of the three learning algorithms and does not require them to use Gittins index policy (in particular, MB-UCRL2 does not use Gittins index policy). What is required is that policy fik is optimal for the sampled problem Mk for MB-PSRL (so that Lemma 5 applies) or for the optimistic problem Mk for MB-UCBVI (so that (11) is valid). Indeed, instead of using Gittins index policy for MB-PSRL or MB-UCBVI, assume that we have access to an oracle that provides an optimal policy for any given Markovian bandit problem. Then, the upper bound on regret in Theorem 1 still holds when MB-PSRL and MB-UCBVI use the oracle to compute policy fik. Gittins index policy is required only for the runtime evaluation as we will see in Section 6. Finally, our bound in Equation 7 is linear in S, the state space size of each arm. Having a regret bound linear in the state space size is currently state-of-the-art for Bayesian algorithms, see *e.g.*, Agrawal & Jia (2017); Ouyang et al. (2017) and our discussion in Appendix A.3.4. For optimistic algorithms, the best regret bounds are linear in the square root of the state size because they use Bernstein's concentration bounds instead of Weissman's inequality (Azar et al., 2017), yet this approach does not work in our setting due to the randomness of episode's length and the bound of MB-UCBVI depends linearly on S. We discuss more about this in Appendix A.5.4. UCBVI has also been studied in the discounted case by He et al. (2021). They use, however, a dierent definition of regret, making their bound on the regret hardly comparable to ours. ## Sketch Of Proof A crucial ingredient of our proof is to work with the value function over a random finite time horizon (W defined below), instead of working directly with the discounted value function V . For a given model M, and a deterministic policy fi, a horizon H and a time step h Æ H, we define by WfiM,h:H(x) the value function of policy fi over the finite time horizon H ≠ h + 1 when starting in x at time h. It is defined as $$W_{M,h:H}^{\pi}(\mathbf{x}):=r^{\pi}(\mathbf{x})+\sum_{\mathbf{y}\in\mathcal{E}}P^{\pi}(\mathbf{x},\mathbf{y})W_{M,h+1:H}^{\pi}(\mathbf{y}),\tag{1}$$ with WfiM,H:H(x) := rfi(x) and where rfi and P fi are reward vector and state transition matrix when following policy fi. $$({\boldsymbol{8}})$$ By definitions of W in Equation 8 and V in Equation 2, for a fixed model M, a policy fi and a state x, and a time horizon H that is geometrically distributed, one has V fiM(x) = E \#WfiM,1:H(x) $. This characterization is important in our proof. Since the episode length Hk is independent of the observations available before episode k, Ok≠1, for any policy fik that is independent of Hk, one has $$\mathbb{E}\left[V_{M}^{\pi_{k}}\left(\mathbf{X}_{t_{k}}\right)\mid\mathcal{O}_{k-1},\pi_{k}\right]=\mathbb{E}\left[W_{M,1:H_{k}}^{\pi_{k}}\left(\mathbf{X}_{t_{k}}\right)\mid\mathcal{O}_{k-1},\pi_{k}\right].\tag{1}$$ $$({\mathfrak{g}})$$ In the above Equation 9, the expectation is taken over all initial state Xtk and all possible horizon Hk. Equation 9 will be very useful in our analysis as it allows us to work with either V or W interchangeably. While the proof of MB-PSRL could be done by only studying the function W, the proof of MB-UCRL2 and MB-UCBVI will use the expression of the regret as a function of V to deal with the non-determinism. Indeed, at episode k, all algorithms compare the optimal policy fiú (that is optimal for the true MDP M) and a policy fik chosen by the algorithm (that is optimal for a MDP Mk that is either sampled by MB-PSRL or chosen by an optimistic principle). The quantity k := WfiúM,1:Hk (Xtk ) ≠ WfikM,1:Hk (Xtk ) equals: $$\underbrace{W_{M,1:H_{k}}^{\pi_{k}}(\mathbf{X}_{t_{k}})-W_{M_{k},1:H_{k}}^{\pi_{k}}(\mathbf{X}_{t_{k}})}_{(A)}+\underbrace{W_{M_{k},1:H_{k}}^{\pi_{k}}(\mathbf{X}_{t_{k}})-W_{M,1:H_{k}}^{\pi_{k}}(\mathbf{X}_{t_{k}})}_{(B)}.\tag{10}$$ The analysis of the term (B) is similar for the three algorithms: it is bounded by the distance between the sampled MDP Mk and the true MDP M that can in turn be bounded by using a concentration argument (Lemma 1) based on Hoeding's and Weissman's inequalities. Compared with the literature (Azar et al., 2017; Ouyang et al., 2017), our proof leverages on taking conditional expectations, making all terms whose conditional expectation is zero disappear. One of the main technical hurdle is to deal with the random episodes lengths H1*,...,H*k. This is required in our approach and is not needed in the classical analysis of finite horizons problems. The analysis of (A) depends heavily on the algorithm used. The easiest case is PSRL: As our setting is Bayesian, the expectation of the first term (A) with respect to the model is zero (see Lemma 5). The case of MB-UCRL2 and MB-UCBVI are harder. In fact, our bonus terms are specially designed so that V fik Mk (x) is an optimistic upper bound of the true value function with high probability, that is: $$V_{M_{k}}^{\pi_{k}}(\mathbf{x})=\operatorname*{max}_{\pi}\operatorname*{max}_{M^{\prime}\in\mathbb{M}_{k}}V_{M^{\prime}}^{\pi}(\mathbf{x})\geq V_{M}^{\pi_{*}}(\mathbf{x}).$$ $$(11)$$ V fiMÕ (x) Ø V fiúM (x). (11) This requires the use of V and not W and it is used to show that the expectation of the term (A) of Equation 10 cannot be positive. ## 5.2 Bayesian **Minimax Lower Bound** After obtaining upper bounds on the regret, a natural question is: can we do better? Or in other terms, does there exist a learning algorithm with a smaller regret? To answer this question, the metric used in the literature is the notion of minimax lower bound: for a given set of parameters (*S, n, K,* —), a minimax lower bound is a lower bound on the quantity infL supM Reg(K,L, M), where the supremum is taken among all possible models that have parameters (*S, n, K,* —) and the infimum is taken over all possible learning algorithms. The next theorem provides a lower bound on the Bayesian regret. It is therefore stronger than a minimax bound for two reasons: First, the Bayesian regret is an average over models, which means that there exists at least one model that has a larger regret than the Bayesian lower bound; And second, in Theorem 2, we allow the algorithm to depend on the prior distribution " and to use this information. Theorem 2 (Lower bound). For any state size S, number of arms n, discount factor - and number of episodes K Ø 16S, there exists a prior distribution " *on Markovian bandit problems with parameters* (S, n, K, —) *such that, for any learning algorithm* L: BayReg(K,L, ") Ø 1 60ÛSnK (1 ≠ —) . (12) $$(12)$$ The proof is given in Appendix B and uses a counterexample inspired by the one of Jaksch et al. (2010). Note that for general MDPs, the minimax lower bound obtained by Osband & Van Roy (2016); Jaksch et al. (2010) says that a learning algorithm cannot have a regret smaller than !ÔS˜A˜T˜", where S˜ is the number of states of the MDP, A˜ is the number of actions and T˜ is the number of time steps. Yet, the lower bound of Osband & Van Roy (2016); Jaksch et al. (2010) is not directly applicable to our case with S˜ = Sn because Markovian bandit problems are very specific instances of MDPs and this can be exploited by the learning algorithm. Also note that this lower bound on the Bayesian regret is also a lower bound on the expected regret of any non-Bayesian algorithm for any MDP model M. Apart from the logarithmic terms, the lower bound provided by Theorem 2 diers from the bound of Theorem 1 by a factor ÔS/(1≠—). This factor is similar to the one observed for PSRL and UCRL2 (Osband et al., 2013; Jaksch et al., 2010). There are various factors that could explain this. We believe that the extra factor 1/(1 ≠ —) might be half due to the episodic nature of MB-PSRL and MB-UCRL2 (when 1/(1 ≠ —) is large, algorithms with internal episodic updates might have smaller regret) and half due to the fact that the lower bound of Theorem 2 is not optimal and could include a term 1/ Ô1 ≠ - (similar to the term O( ÔD) of the lower bound of Osband & Van Roy (2016); Jaksch et al. (2010)). The factor ÔS between our two bounds comes from our use of Weissman's inequality. It might be possible that our regret bounds are not optimal with respect to this term although such an improvement cannot be obtained using the same approach of Azar et al. (2017). ## 6 Scalability Of Learning Algorithms For Markovian Bandits Historically, Problem 1 was considered unresolved until Gittins (1979) proposed Gittins indices. This is because previous solutions were based on Dynamic Programming in the global MDP which are computationally expensive. Hence, after establishing regret guarantees, we are now interested in the computational complexity of our learning algorithms, which is often disregarded in the learning literature. ## 6.1 Mb-Psrl And Mb-Ucbvi Are Scalable If one excludes the simulation of the MDP, the computational cost of MB-PSRL and MB-UCBVI of each episode is low. For MB-PSRL, its cost is essentially due to three components: Updating the observations, sampling from the posterior distribution and computing the optimal policy. The first two are relatively fast when the conjugate posterior has a closed form: updating the observation takes O(1) at each time, and sampling from the posterior can be done in O(nS2) - more details on posterior distributions are given in Appendix D. When the conjugate posterior is implicit (*i.e.*, under the integral form), the computation can be higher but remains linear in the number of arms. For MB-UCBVI, the cost is due to two components: computing the bonus terms and computing the Gittins policy for the optimistic MDP. Computing the bonus is linear in the number of bandits and the length of the episode. As explained in Section 2.2, the computation of the Gittins index policy for a given problem can be done in O(nS3). Hence, MB-PSRL and MB-UCBVI have a regret and a runtime both linear in the number of arms. ## 6.2 Mb-Ucrl2 Is Not Scalable Because It Cannot Use An Index Policy While MB-UCRL2 has a regret equivalent to the one of MB-PSRL, its computational complexity, and in particular the complexity of computing an *optimistic* policy that maximizes Equation 6 does not scale with n. Such a policy can be computed by using *extended value iteration* (Jaksch et al., 2010). This computation is polynomial in the number of states of the global MDP and is therefore exponential in the number of arms, precisely O(nS2n). For MB-PSRL (or MB-UCBVI), the computation is easier because the sampled (optimistic) MDP is a Markovian bandit problem. Hence, using Gittins Theorem, computing the optimal policy can be done by computing local indices. In the following, we show that it is not possible to solve Equation 6 by using local indices. This suggests that MB-UCRL2 (nor any of the modifications of UCRL2's variants that would use extended value iteration) cannot be implemented eciently. More precisely, to find an optimistic policy (that satisfies Equation 11), UCRL2 and its variants, *e.g.*, KLUCRL (Filippi et al., 2010), compute a policy fik that is optimal for the most optimistic MDP in Mk. This can be done by using extended value iteration. We now show that this cannot be replaced by the computation of local indices. Let us consider that the estimates and confidence bounds for a given arm a are Bˆa := (rˆa, Qˆa, bra, bQa ). We say that an algorithm computes indices locally for Arm a if for each xa œ Sa, it computes an index IBˆa(xa) by using only Bˆa but not BˆaÕfor any aÕ "= a. We denote by fiI(Bˆ) the index policy that uses index IBˆafor arm a and by M(Bˆ) the set of Markovian bandit problems MÕ that satisfy Equation 5. Theorem 3. *For any algorithm that computes indices locally, there exists a Markovian bandit problem* M, an initial state x *and estimates* Bˆa := (rˆa, Qˆa, bra, bQa ) such that M œ M(Bˆ) and $$\operatorname*{sup}_{M^{\prime}\in\mathbb{M}(\mathcal{B})}V_{M^{\prime}}^{\pi^{I(\mathcal{B})}}(\mathbf{x})<\operatorname*{sup}_{\pi}V_{M}^{\pi}(\mathbf{x}).$$ Proof. The proof presented in Appendix C is obtained by constructing a set M and two MDPs M1 and M2 in M such that Equation 11 cannot hold simultaneously for both M1 and M2. This theorem implies that one cannot define local indices such that Equation 11 holds for all bandit problems M œ Mk. Yet, the use of this inequality is central in the regret analysis of UCRL2 (see the proof of UCRL2 (Jaksch et al., 2010)). This implies that the current methodology to obtain regret bounds for UCRL2 and its variants, *e.g.*, Bourel et al. (2020); Fruit et al. (2018); Talebi & Maillard (2018); Filippi et al. (2010), that use Extended Value Iteration is not applicable to bound the regret of their modified version that computes indices locally. Note that for any set M such that M œ M, there still exists an index policy fiind that is optimistic because all MDPs in M are Markovian bandit problems. This optimistic index policy satisfies $$\operatorname*{sup}_{M^{\prime}\in\mathbb{M}}V_{M^{\prime}}^{\pi^{\mathrm{ind}}}\geq\operatorname*{sup}_{\pi}V_{M}^{\pi}.$$ This means that restricting to index policies is not a restriction for optimism. What Theorem 3 shows is that an optimistic index policy can be defined only after the most optimistic MDP M œ M is computed and computing optimistic policy and M simultaneously depends on the confidence sets of all arms. Therefore, we believe that UCRL2 and its variants cannot compute optimistic policy locally: they should all require the joint knowledge of all {Bˆa}aœ[n]. ## 7 Numerical Experiments In complement to our theoretical analysis, we report, in this section, the performance of our three algorithms in a model taken from the literature. The model is an environment with 3 arms, all following a Markov chain that is obtained by applying the optimal policy on the river swim MDP. A detailed description is given in Appendix D, along with all hyperparameters that we used. Our numerical experiments suggest that MB-PSRL outperforms other algorithms in term of average regret and is computationally less expensive than other algorithms. To ensure reproducibility, the code and data of our experiments are available at https://gitlab.inria.fr/kkhun/learning-in-rested-markovian-bandit. Performance result We investigate the average regret and policy computation time of each algorithm. To do so, we run each algorithm for 80 simulations and for K = 3000 episodes per simulation. We arbitrarily choose the discount factor - = 0.99. In Figure 1(a), we show the average cumulative regret of the 3 algorithms. We observe that the average regret of MB-UCBVI is larger than those of MB-PSRL and MBUCRL2. Moreover, we observe that MB-PSRL obtains the best performance and that its regret seems to grow slower than O( ÔK). This is in accordance to what was observed for PSRL (Osband et al., 2013). Note that the expected number of time steps after K episodes is K/(1 ≠ —) which means that in our setting with K = 3000 episodes there are 300 000 time steps in average. In Figure 1(b), we compare the computation time of the various algorithms. We observe that the computation time (the y-axis is in log-scale) of MB-PSRL ![11_image_0.png](11_image_0.png) episodes. (b) Average runtime per episode. The vertical axis is in logscale. Figure 1: Experimental result for the three 4-state random walk arms given in Table 1. The x-axis is the number of episodes. Each algorithm is identified by a unique color for all figures. and MB-UCBVI, the index-based algorithms, are the fastest by far. Moreover, the computation time of these algorithms seem to be independent of the number of episodes. These two figures show that MB-PSRL has the smallest regret and computation time among all compared algorithms. Robustness (larger models and dierent priors) To test the robustness of MB-PSRL, we conduct two more sets of experiments that are reported in Appendix E. They confirm the superiority of MB-PSRL. The first experiment is an example from Du (1995) with 9 arms each having 11 states. This model illustrates the eect of the curse of dimensionality: the global MDP has 119 states which implies that the runtime of MB-UCRL2 makes it impossible to use, while MB-PSRL and MB-UCBVI take a few minutes to complete 3000 episodes. Also in this example, MB-PSRL seems to converge faster to the optimal policy than MBUCBVI. The second experiment tests the robustness of MB-PSRL to the choice of prior distribution. We provide numerical evidences that show that, even when MB-PSRL is run with a prior " that is not the one from which M is drawn, the regret of MB-PSRL remains acceptable (around twice the regret obtained with a correct prior). ## 8 Conclusion In this paper, we present MB-PSRL, a modification of PSRL for Markovian bandit problems. We show that its regret is close to the lower bound that we derive for this problem while its runtime scales linearly with the number of arms. Furthermore, and unlike what is usually the case, MB-PSRL does not have an optimistic counterpart that scales well: we prove that MB-UCRL2 also has a sub-linear regret but has a computational complexity exponential in the number of arms. This result generalizes to all the variants of UCRL2 that rely on extended value iteration. We nevertheless show that OFU approach may still be pertinent for Markovian bandit problem: MB-UCBVI, a version of UCBVI can use Gittins indices and does not suer from the dimensionality curse: it has a sub-linear regret in terms of the number of episodes and number of arms as well as a linear time complexity. However its regret remains larger than MB-PSRL. The broad implication of this work is that, on the one hand, if a weakly coupled MDP or factored MDP can be solved eciently when all the parameters are known, then PSRL can be adapted to have ecient regret and runtime. On the other hand, solving weakly coupled MDP or factored MDP eciently when all the parameters are known does not imply that all optimistic algorithms are computationally ecient. This is a major dierence between the Bayesian and the optimistic approach. ## References Priyank Agrawal, Jinglin Chen, and Nan Jiang. Improved worst-case regret bounds for randomized leastsquares value iteration. In *Proceedings of the AAAI Conference on Artificial Intelligence*, volume 35, pp. 6566–6573, 2021. Shipra Agrawal and Randy Jia. Posterior sampling for reinforcement learning: worst-case regret bounds. arXiv preprint arXiv:1705.07041, 2017. Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2):235–256, 2002. Konstantin E Avrachenkov and Vivek S Borkar. Whittle index based q-learning for restless bandits with average reward. *Automatica*, 139:110186, 2022. Mohammad Gheshlaghi Azar, Ian Osband, and Rémi Munos. Minimax regret bounds for reinforcement learning. In *International Conference on Machine Learning*, pp. 263–272. PMLR, 2017. Peter L Bartlett and Ambuj Tewari. Regal: A regularization based algorithm for reinforcement learning in weakly communicating mdps. *arXiv preprint arXiv:1205.2661*, 2012. Hippolyte Bourel, Odalric Maillard, and Mohammad Sadegh Talebi. Tightening exploration in upper confidence reinforcement learning. In *International Conference on Machine Learning*, pp. 1056–1066. PMLR, 2020. Sébastien Bubeck, Nicolo Cesa-Bianchi, et al. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends® *in Machine Learning*, 5(1):1–122, 2012. Jhelum Chakravorty and Aditya Mahajan. Multi-armed bandits, gittins index, and its calculation. *Methods* and applications of statistics in clinical trials: Planning, analysis, and inferential methods, 2(416-435): 455, 2014. Michael O Du. Q-learning for bandit problems. In *Machine Learning Proceedings 1995*, pp. 209–217. Elsevier, 1995. Sarah Filippi, Olivier Cappé, and Aurélien Garivier. Optimism in reinforcement learning and kullbackleibler divergence. In *2010 48th Annual Allerton Conference on Communication, Control, and Computing* (Allerton), pp. 115–122. IEEE, 2010. Daniel Fink. A compendium of conjugate priors. *See http://www. people. cornell.* edu/pages/df36/CONJINTRnew% 20TEX. pdf, 46, 1997. Ronan Fruit. *Exploration-exploitation dilemma in Reinforcement Learning under various form of prior* knowledge. PhD thesis, Université de Lille 1, Sciences et Technologies; CRIStAL UMR 9189, 2019. Ronan Fruit, Matteo Pirotta, Alessandro Lazaric, and Emma Brunskill. Regret minimization in mdps with options without prior knowledge. *Advances in Neural Information Processing Systems*, 30, 2017. Ronan Fruit, Matteo Pirotta, Alessandro Lazaric, and Ronald Ortner. Ecient bias-span-constrained exploration-exploitation in reinforcement learning. In *International Conference on Machine Learning*, pp. 1578–1586. PMLR, 2018. Jing Fu, Yoni Nazarathy, Sarat Moka, and Peter G Taylor. Towards q-learning the whittle index for restless bandits. In *2019 Australian & New Zealand Control Conference (ANZCC)*, pp. 249–254. IEEE, 2019. Nicolas Gast, Bruno Gaujal, and Kimang Khun. Computing whittle (and gittins) index in subcubic time. arXiv preprint arXiv:2203.05207, 2022. John Gittins, Kevin Glazebrook, and Richard Weber. *Multi-armed bandit allocation indices*. John Wiley & Sons, 2011. John C Gittins. Bandit processes and dynamic allocation indices. Journal of the Royal Statistical Society: Series B (Methodological), 41(2):148–164, 1979. Aditya Gopalan and Shie Mannor. Thompson sampling for learning parameterized markov decision processes. In *Conference on Learning Theory*, pp. 861–898. PMLR, 2015. Carlos Guestrin, Daphne Koller, Ronald Parr, and Shobha Venkataraman. Ecient solution algorithms for factored mdps. *Journal of Artificial Intelligence Research*, 19:399–468, 2003. Jiafan He, Dongruo Zhou, and Quanquan Gu. Nearly minimax optimal reinforcement learning for discounted mdps. *Advances in Neural Information Processing Systems*, 34, 2021. Haque Ishfaq, Qiwen Cui, Viet Nguyen, Alex Ayoub, Zhuoran Yang, Zhaoran Wang, Doina Precup, and Lin Yang. Randomized exploration in reinforcement learning with general value function approximation. In International Conference on Machine Learning, pp. 4607–4616. PMLR, 2021. Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11(51):1563–1600, 2010. URL http://jmlr.org/papers/v11/ jaksch10a.html. Chi Jin, Zeyuan Allen-Zhu, Sebastien Bubeck, and Michael I Jordan. Is q-learning provably ecient? Advances in neural information processing systems, 31, 2018. Young Hun Jung and Ambuj Tewari. Regret bounds for thompson sampling in episodic restless bandit problems. *Advances in Neural Information Processing Systems*, 32, 2019. Michael N Katehakis and Arthur F Veinott Jr. The multi-armed bandit problem: decomposition and computation. *Mathematics of Operations Research*, 12(2):262–268, 1987. Jackson A Killian, Andrew Perrault, and Milind Tambe. Beyond" to act or not to act": Fast lagrangian approaches to general multi-action restless bandits. In *Proceedings of the 20th International Conference* on Autonomous Agents and MultiAgent Systems, pp. 710–718, 2021. Kevin P Murphy. Conjugate bayesian analysis of the gaussian distribution. def, 1(2‡2):16, 2007. Ronald Ortner, Daniil Ryabko, Peter Auer, and Rémi Munos. Regret bounds for restless markov bandits. In *International conference on algorithmic learning theory*, pp. 214–228. Springer, 2012. Ian Osband and Benjamin Van Roy. Near-optimal reinforcement learning in factored mdps. Advances in Neural Information Processing Systems, 27, 2014. Ian Osband and Benjamin Van Roy. On lower bounds for regret in reinforcement learning. *arXiv preprint* arXiv:1608.02732, 2016. Ian Osband and Benjamin Van Roy. Why is posterior sampling better than optimism for reinforcement learning? In *International conference on machine learning*, pp. 2701–2710. PMLR, 2017. Ian Osband, Daniel Russo, and Benjamin Van Roy. (more) ecient reinforcement learning via posterior sampling. *Advances in Neural Information Processing Systems*, 26, 2013. Yi Ouyang, Mukul Gagrani, Ashutosh Nayyar, and Rahul Jain. Learning unknown markov decision processes: A thompson sampling approach. *Advances in neural information processing systems*, 30, 2017. Martin L Puterman. *Markov decision processes: discrete stochastic dynamic programming*. John Wiley & Sons, 2014. Jian Qian, Ronan Fruit, Matteo Pirotta, and Alessandro Lazaric. Concentration inequalities for multinoulli random variables. *arXiv preprint arXiv:2001.11595*, 2020. Aviv Rosenberg and Yishay Mansour. Oracle-ecient reinforcement learning in factored mdps with unknown structure. *arXiv preprint arXiv:2009.05986*, 2020. Daniel J Russo, Benjamin Van Roy, Abbas Kazerouni, Ian Osband, and Zheng Wen. A tutorial on thompson sampling. Foundations and Trends® *in Machine Learning*, 11(1):1–96, 2018. Mohammad Sadegh Talebi and Odalric-Ambrym Maillard. Variance-aware regret bounds for undiscounted reinforcement learning in mdps. In *Algorithmic Learning Theory*, pp. 770–805. PMLR, 2018. Cem Tekin and Mingyan Liu. Online learning of rested and restless bandits. *IEEE Transactions on Information Theory*, 58(8):5588–5611, 2012. William R Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. *Biometrika*, 25(3-4):285–294, 1933. Yi Tian, Jian Qian, and Suvrit Sra. Towards minimax optimal reinforcement learning in factored markov decision processes. *Advances in Neural Information Processing Systems*, 33:19896–19907, 2020. Roman Vershynin. *High-dimensional probability: An introduction with applications in data science*, volume 47. Cambridge university press, 2018. Ruosong Wang, Russ R Salakhutdinov, and Lin Yang. Reinforcement learning with general value function approximation: Provably ecient approach via bounded eluder dimension. *Advances in Neural Information* Processing Systems, 33:6123–6135, 2020a. Siwei Wang, Longbo Huang, and John Lui. Restless-ucb, an ecient and low-complexity algorithm for online restless bandits. *Advances in Neural Information Processing Systems*, 33:11878–11889, 2020b. Richard Weber. On the gittins index for multiarmed bandits. *The Annals of Applied Probability*, pp. 1024– 1033, 1992. Tsachy Weissman, Erik Ordentlich, Gadiel Seroussi, Sergio Verdu, and Marcelo J Weinberger. Inequalities for the l1 deviation of the empirical distribution. *Hewlett-Packard Labs, Tech. Rep*, 2003. Peter Whittle. *Optimal control: basics and beyond*. John Wiley & Sons, Inc., 1996. Ziping Xu and Ambuj Tewari. Reinforcement learning in factored mdps: Oracle-ecient algorithms and tighter regret bounds for the non-episodic setting. *Advances in Neural Information Processing Systems*, 33:18226–18236, 2020. Andrea Zanette and Emma Brunskill. Tighter problem-dependent regret bounds in reinforcement learning without domain knowledge using value function bounds. In *International Conference on Machine Learning*, pp. 7304–7312. PMLR, 2019. Zihan Zhang and Xiangyang Ji. Regret minimization for reinforcement learning by evaluating the optimal bias function. *Advances in Neural Information Processing Systems*, 32, 2019.
Review 1: Summary: This paper studies Markovian bandit problems where a) arm state transitions are restful; b) rewards come with an expoential discounting factor $\beta$; c) the time-horizen length in each episode is i.i.d. geometrically distributed with parameter $1-\beta$. In the paper, three new algorithms MB-PSRL, MB-UCRL and MB-UCBVI are presented, all achieving $\tilde O(S\sqrt {nK})$ regret, which is nearly optimal up to an $\sqrt S$ factor compared to a Bayesian minimax regret lower-bound given in the paper. Among the three proposed algorithms, MB-PSRL and MB-UCBVI can be implemented efficiently. Strengths and Weaknesses: Strength ======== The studied setting (restful bandit, reward discounting factor matching with the geometric time-horizon length) allows to efficiently compute the exact optimal policy when problem-instance parameters are completely known, by using the celebrated Gittins indices policy. Since we are able to efficiently solve the planning version problems, plugging the exact planning solutions to common UCB-optimistic frameworks and TS posterior-sampling frameworks leads to the proposed new algorithms. Hence the overall picture of this paper is clear and intuitive. The key proofs seem rigorous and convincing. The impossibility result in Section 6.2 is interesting. It does rule out some candidates for optimistic MB algorithms (computing local indices before picking an optimistic problem parameter instance won't have desired optimistic properties). Weekness and Concern ===================== The paper's approach heavily relies on exact planning via Gittins indices, which further heavily relies on the equivalence between discounted infinite time-horizons and finite geometric time horizons with a matching parameter. If the setting is slightly changed (e.g., all episodes have fixed uniform time-horizon lengths, or they are still geometrically i.i.d. but the parameter is no longer $1-\beta$), then Gittins indices policy is no longer optimal. I would like to see more discussion this. Intuitively, as long as the rewards are discounted, when time-horizon lengths are sufficiently large, Gittins indices policy should be very close to the optimal policy, so maybe the regret guarantees of MB-PSRL and MB-UCBVI can still hold after carefully analyzing the error between Gittins indices policy and OPT. Due to the above reason, I am afraid it is not very fair to claim advantages over prior works on finite-horizon settings when making comparisons in the literature review section, they are just different settings. Finally, I think it is better to emphasize more on the regret guarantee of MB-PSRL in the abstract and introduction section. The presented regret upper-bound of MB-PSRL is for Bayasian regret, not for worse-case regret. It is an interesting open problem to find a prior for MB-PSRL so that the posterier can be efficiently maintained (e.g., having conjugate distributions) and upon which we can also develop worst-case style regret guarantees. Requested Changes: The paper's approach heavily relies on exact planning via Gittins indices, which further heavily relies on the equivalence between discounted infinite time-horizons and finite geometric time horizons with a matching parameter. If the setting is slightly changed (e.g., all episodes have fixed uniform time-horizon lengths, or they are still geometrically i.i.d. but the parameter is no longer $1-\beta$), then Gittins indices policy is no longer optimal. I would like to see more discussion this. Due to the above reason, I am afraid it is not very fair to claim advantages over prior works on finite-horizon settings when making comparisons in the literature review section, they are just different settings. Finally, I think it is better to emphasize more on the regret guarantee of MB-PSRL in the abstract and introduction section. The presented regret upper-bound of MB-PSRL is for Bayasian regret, not for worse-case regret. It is an interesting open problem to find a prior for MB-PSRL so that the posterier can be efficiently maintained (e.g., having conjugate distributions) and upon which we can also develop worst-case style regret guarantees. Broader Impact Concerns: NA ================================================== Review 2: Summary: This paper is concerned with Markov bandits. Three algorithms MB-PSRL, MB-UCRL2, and MB-UCBVI are proposed. Theoretical guarantees and empirical investigations are provided. Strengths and Weaknesses: Strengths: Markovian bandits problem is interesting. But I’m not familiar with the literature in this specific setting. Weaknesses: Presentation could be improved. Literature/references seems to be outdated. Requested Changes: 1. I'm not familiar with the specific Markovian bandit setting and probably I'm missing something, could you provide some motivating examples? 2. "its number of dimensions" is unclear in the introduction. I guess here you mean the number of state is exponential in some dimensions. And I think tabular algorithms just pays the complexity about the size of the state space. The proposed algorithm computationally also has a dependence in n, so I don't quite understand the argument here. 3. Some clarification is needed about Bayesian regret vs frequentist regret. Bayesian regret is a weaker guarantee. Recently there is a line of research that studies the frequentist regret for Beyesian/posterior sampling RL algorithms. The refs also seems to be outdated. See the below ref and the refs therein. Refs: Worst-Case Regret Bounds for Exploration via Randomized Value Functions Improved worst-case regret bounds for randomized least-squares value iteration Randomized Exploration for Reinforcement Learning with General Value Function Approximation 4. I think MB-UCBVI should have a better bound, i.e., a root S bound which matches the lower bound. Could you comment on why the S dependence is loose in MB-UCBVI? This is different from the optimal S dependence in UCBVI. 5. Could you comment on why there is no similar length of horizon factor (H) appearing in the bound? I think the problem setting is also sort of episodic, and in the standard MDP we would have H dependence. 6. The beginning of the related work is not clear. It has an informal and vague description about the setting and I feel it does not help. I still do not see the definition after reading that. Maybe just drop this part since you formally introduce it later. 7. In Alg1, I think the update of policy pi is missing. Probably add a line and pointers to the specific equations afterwards. 8. “The situation is radically different when considering the processing time: the runtime of MB-PSRL is linear in the number of arms, while the runtime of MB-UCRL2 is exponential in n” It looks like n is not the number of arms, but it turns out yes. Probably be consistent. 9. "Hence, MB-PSRL and MB-UCBVI successfully escape from the curse of dimensionality." Can you comment on what they mean specifically? 10. I didn't check the proof, so no comment about its correctness. Broader Impact Concerns: N/A ================================================== Review 3: Summary: This paper proposes a general framework to solve the Markovian bandit problem and three algorithms under this framework. The authors provided regret guarantees for the three algorithms. The regret is linear in the size of the state space associated with each arm. If we naively apply the existing regret guarantees for MDP problems, the regret will be exponential. The authors also provided a lower bound as well as empirical results. Strengths and Weaknesses: Strengths: The claims in the paper are supported by the content. The authors claim that the three algorithms that they propose have regret guarantees that are linear in S and sublinear in K. The authors provided proof to support the results. I did not check the details but the theory part seems to be sound. The authors also claim that two algorithms MB-PSRL and MB-UCBVI are computationally scalable, whereas MB-UCRL2 is not. This is supported by empirical evidence. Overall, I think this is a solid work, the paper is overall well-written and easy to follow. Weaknesses: After reading the paper, I did not get why Markovian bandit is an important problem. What is the practical motivation to study this problem? I think some discussions would be helpful. Requested Changes: As mentioned above, I would like to see a better discussion on the motivation of studying this problem. Relatively minor changes: The authors use “markovian” and "bayesian" in many places. It should be “Markovian” and "Bayesian" Last paragraph on page 3: what is the difference between the symbol \mathcal{X} and \mathcal{E}? First paragraph of Section 4: “The structure of the three MB-* algorithm is similar” -> “The structures of the three MD-* algorithms are similar” I think it would be helpful to discuss the motivation of choosing geometrically distributed episode length. Broader Impact Concerns: I don't see any concerns on the ethical implications of this work. So I don't think a Broader Impact Statement is needed. ================================================== Metareview: Recommendation: Accept with minor revision Comment: The reviewers agree that the paper presents results that are supported by theoretical as well as empirical results. While two of the reviewers also consider the findings sufficiently interesting, one is a bit skeptical about the relevance of the setting. In that respect I agree with the authors in that the amount of literature on Markovian bandits shows that there is sufficient interest in research in that field and also provides several applications, that need not be further discussed in detail by the paper at hand. However, the reviews also point out that the paper does not adequately discuss the limitations of the work and is rather sloppy when comparing different settings. Thus, while I reommend to accept the paper, in the final version the following minor revisions shall be made: - Abstract as well as introduction shall point out the specific setting that is considered (i.e., rested bandits, episodic setting with a particular choice of the episodes). - The term 'regret' (without any further specification) should not be used unless it is completely clear from context which precise notion of regret (e.g., Bayesian or expected) is considered. This holds in particular for the abstract where currently regret bounds with a different meaning are mentioned in the same sentence in quite a misleading manner. - The limitations of the considered specific setting (as particularly pointed out by reviewer UZTB) should be adequately discussed. Beside these important revisions I also noted that you cite the conference version (Auer et al 2008) instead of the extended journal version (Jaksch et al, JMLR 2010) of the UCRL2 paper. ==================================================
# Dependency Structure Search Bayesian Optimization For Decision Making Models Anonymous authors Paper under double-blind review ## Abstract Many approaches for optimizing decision making models rely on gradient based methods requiring informative feedback from the environment. However, in the case where such feedback is sparse or uninformative, such approaches may result in poor performance. Derivative-free approaches such as Bayesian Optimization mitigate the dependency on the quality of gradient feedback, but are known to scale poorly in the high-dimension setting of complex decision making models. This problem is exacerbated if the model requires interactions between several agents cooperating to accomplish a shared goal. To address the dimensionality challenge, we propose a compact multi-layered architecture modeling the dynamics of agent interactions through the concept of role. We introduce Dependency Structure Search Bayesian Optimization to efficiently optimize the multi-layered architecture parameterized by a large number of parameters, and give the first improved regret bound in additive high-dimensional Bayesian Optimization since Mutny & Krause (2018). Our approach shows strong empirical results under malformed or sparse reward. ## 1 Introduction Decision Making Models choose sequences of actions to accomplish a goal. Multi-Agent Decision Making Models choose actions for multiple agents working together towards a shared goal. Multi-Agent Reinforcement Learning (marl) has emerged as a competitive approach for optimizing Decision Making Models in the multi-agent setting.1 marl optimizes a *policy* under the partially observable Markov Decision Process (pomdp) framework, where decision making happens in an *environment* determined by a set of possible states and actions, and the *reward* for an action is conditioned upon the partially observable state of the environment. A policy forms a set of decision-making rules capturing the most rewarding actions in a given state. marl utilizes gradient-based methods requiring informative gradients to make progress. This approach benefits from dense reward, which allows reinforcement learning methods to infer a causal relationship between individual actions and their corresponding reward. This feedback may not be present in the scenario of sparse reward(Pathak et al., 2017; Qian & Yu, 2021). In addition, gradient-based methods are susceptible to falling into local maxima. In contrast to optimization by marl, Bayesian Optimization (bo) offers an alternative approach to policy optimization. Since bo is a gradient-free optimizer capable of searching globally, applying bo to multi-agent policy search (maps) both ensures global searching of the policy, and overcomes poor gradient behavior in the reward function (Qian & Yu, 2021). The chief challenge in bo for maps is the high dimensionality of complex multi-agent interactions. A significant degree of high-dimensional multi-agent interactions exist in maps. For example, considering an autonomous drone delivery system, several agents (i.e., drones) must work together to maximize the throughput of deliveries. In doing so, these agents may separate themselves into different roles, for example, long-distance or short-distance deliveries. The optimal policy for each role may be significantly different due to distances to recharging base stations (e.g., drones must conserve battery). In forming the optimal policy, the *interaction* between agents must be considered to both optimally divide the task between the drones, as 1We include an overview of approaches in Decision Making Models in Section 3. well as coordinate actions between drones (e.g., collision avoidance). These interactions may change over time. For example, a drone must avoid collision with nearby drones, which changes as it moves through the environment. With many agents, these interactions become more complex. However, we propose the usage of bo for maps on memory-constrained devices which necessitates very compact policies which enables the possibility of overcoming the above limitation. In the context of memoryconstrained devices such as Internet of Things (IoT) devices (Merenda et al., 2020), small policies must be used. Secondly, in environments with sparse reward feedback, training these networks with rl presents significant challenges due to unhelpful policy gradients. Finally, the possibility of *globally optimizing* a compact policy for memory-constrained systems is appealing due to its strong performance guarantees. To allow for the construction of compact policies, we utilize specific multi-agent abstractions of *role* and role interaction. In role-based multi-agent interactions, an agent's policy depends on its current role and sparse interactions with other agents. By simplifying the policy space with these abstractions, we increase its tractability for global optimization by bo and inherit the strong empirical performance demonstrated by these approaches. We realize this simplification of the policy space by expressing the role abstraction and role interaction abstractions as immutable portions of the policy space, which are not searched over during policy optimization. To achieve this, we use a higher-order model (hom) which *generates* a policy model. The hom is divided into immutable instructions (i.e., algorithms) corresponding to the abstractions of the role and role interaction and mutable parameters that are used to generate (gen) a policy model during evaluation. To optimize our proposed hom, we specialize bo by exploiting task-specific structures. A promising avenue of High-dimensional Bayesian Optimization (hdbo) is through additive decomposition. Additive decomposition separates a high-dimensional optimization problem into several independent low-dimensional sub-problems (Duvenaud et al., 2011; Kandasamy et al., 2015). These sub-problems are independently solved thus reducing the complexity of high dimensional optimization. However, a significant challenge in additive decomposition is *learning the independence structure* which is unknown a-priori. Learning the additive decomposition is accomplished using stochastic sampling such as Gibbs sampling (Kandasamy et al., 2015; Rolland et al., 2018; Han et al., 2020) which is known to have poor performance in high dimensions (Johnson et al., 2013; Barbos et al., 2017). In our work, we overcome this shortcoming by observing the gen process of the hom. In particular, we can measure a surrogate Hessian during the gen process which significantly simplifies the task of learning the additive structure. This surrogate Hessian informs the dependency structure of the optimization problem due to the equivalence between a zero Hessian value, and independence between dimensions due to the linearity of addition. We term this approach Dependency Structure Search GP-UCB (dss-gp-ucb) and visualize our approach in Fig. 2. Our proposed bo approach is also applicable to policy-search in the single-agent setting, showing its general-purpose applicability in Decision Making Models. In this work, we make the following contributions: - We propose a parameter-efficient hom for maps which is both expressive and compact. Our approach is made feasible by using specific abstractions of *roles* and *role interactions*. - We propose dss-gp-ucb, a variant of bo that simplifies the learning of dependency structure and provides strong regret guarantees which scale with O(log(D)) under reasonable assumptions. - We validate our approach on several multi-agent benchmarks and show our approach outperforms related works for compact models fit for memory-constrained scenarios. Our dss-gp-ucb also overcomes sparse reward behavior in the reward function in multiple settings showing its effectiveness in Decision Making Models both in the single-agent and multi-agent settings. ## 2 Background Bayesian Optimization: Bayesian optimization (bo) involves sequentially maximizing an unknown objective function v : Θ → R. In each iteration t = 1*, . . . , T*, an input query θt is evaluated to yield a noisy observation yt ≜ v(θt) + ϵ with i. i. d. Gaussian noise ϵ ∼ N (0, σ2). bo selects input queries to approach the global maximizer θ ∗ ≜ arg maxθ∈Θ v(θ) as rapidly as possible. This is achieved by minimizing *cumulative* regret RT ≜PT t=1 r(θt), where r(θt) ≜ v(θ ∗) − v(θt). Cumulative regret is a key performance metric of bo methods. The probability distribution of v is modeled by a *Gaussian process* (GP), denoted GP(µ(θ), k(*θ, θ*′)), that is, every finite subset of {v(θ)}θ∈Θ follows a multivariate Gaussian distribution (Rasmussen & Williams, 2006). A GP is fully specified by its *prior* mean µ(θ) and covariance k(*θ, θ*′) for all *θ, θ*′ ∈ Θ, which are, respectively, assumed w.l.o.g. to be µ(θ) = 0 and k(*θ, θ*′) ≤ 1. Given a vector yT ≜ [yt] ⊤ t=1*,...,T* of noisy observations from evaluating v at input queries θ1*, . . . , θ*T ∈ Θ after T iterations, the GP posterior probability distribution of v at some input θ ∈ Θ is a Gaussian with the following *posterior* mean µ k T (θ) and variance [σ k T ] 2(θ): $$\mu^{\pm}_{T}(\theta)\triangleq{\bf k}^{\pm}_{T}(\theta)^{\top}({\bf K}^{\pm}_{T}+\sigma^{2}{\bf I})^{-1}{\bf y}_{T},\ \ \ \ \ \left[\sigma^{\pm}_{T}\right]^{2}(\theta)\triangleq k(\theta,\theta)-{\bf k}^{\pm}_{T}(\theta)^{\top}({\bf K}^{\pm}_{T}+\sigma^{2}{\bf I})^{-1}{\bf k}^{\pm}_{T}(\theta)\tag{1}$$ where KkT ≜ [k(θt, θt ′ )]t,t′=1*,...,T* and k k T (θ) ≜ [k(θt, θ)]⊤ t=1*,...,T* . In each iteration t of bo, an input query θt ∈ Θ is selected to maximize the GP-UCB acquisition function, θt ≜ arg maxθ∈Θ µt−1(θ) + √βtσt−1(θ) (Srinivas et al., 2010) where βt follows a well defined pattern. ## 3 Related Work Decision Making Models: Decision Making Models (Rizk et al., 2018; Roijers et al., 2013) determine actions taken by an agent or agents in order to achieve a goal. We focus on the pomdp setting and optimizing a policy to accumulate maximum reward while interacting with a partially observable environment (Shani et al., 2013). Many approaches exist which can be broadly categorized into direct policy search and reinforcement learning methods. Direct policy search (Heidrich-Meisner & Igel, 2008; Lizotte et al., 2007; Martinez-Cantin, 2017; Papavasileiou et al., 2021; Wierstra et al., 2008) searches the policy space in some efficient manner. Reinforcement learning (Arulkumaran et al., 2017; Fujimoto et al., 2018; Haarnoja et al., 2018; Lillicrap et al., 2015; Lowe et al., 2017; Mnih et al., 2015; Schulman et al., 2017) starts with a randomly initialized policy and *reinforces* rewarding behavior patterns to improve the policy. Bayesian Optimization for Decision Making Models: bo has been utilized for direct policy search in the low dimensional setting (Lizotte et al., 2007; Wilson et al., 2014; Marco et al., 2016; Martinez-Cantin, 2017; von Rohr et al., 2018). However, these approaches have not scaled to the high dimensional setting. In more recent works, bo has been utilized to aid in local search methods similar to reinforcement learning (Akrour et al., 2017; Eriksson et al., 2019a; Wang et al., 2020a; Fröhlich et al., 2021; Müller et al., 2021). However, these approaches require evaluation of an inordinate number of policies typical of local search methods and do not provide regret guarantees. Recently, combinations of local and global search methods have been proposed (McLeod et al., 2018; Shekhar & Javidi, 2021). However, these approaches rely on informative and useful gradient information and have not been shown to scale to the high dimensional setting. MARL for multi-agent decision making: A well-known approach for cooperative marl is a combination of centralized training and decentralized execution (CTDE) (Oliehoek et al., 2008). The multi-agent interactions of CTDE methods can be implicitly captured by learning approximate models of other agents (Lowe et al., 2017; Foerster et al., 2018) or decomposing global rewards (Sunehag et al., 2017; Rashid et al., 2018; Son et al., 2019). However, these methods do not focus on how interactions are performed between agents. In marl, the concept of *role* is often leveraged to enhance the flexibility of behavioral representation while controlling the complexity of the design of agents (Lhaksmana et al., 2018; Wang et al., 2020b; 2021b; Li et al., 2021). Our approach is related to the study of (Le et al., 2017) where the interactions are also captured by role assignment. However, the approach operates on an imitation learning scenario, and the role assignment depends on the heuristic from domain knowledge. Another related field is Comm-marl (Zhu et al., 2022; Shao et al., 2022; Liu et al., 2020; Peng et al., 2017; Das et al., 2019; Singh et al., 2019), where agents are allowed to communicate during policy execution to jointly decide on an action. In contrast, our approach utilizes both abstractions of role and role interaction in a hom for a decision making model. ## 4 Design We consider the problem of learning the joint policy of a set of n agents working cooperatively to solve a common task. During each interaction with the environment, each agent i is associated with a state s i ∈ Si with the global state represented as s ≜ [s i]i=1*,...,n*. Each agent i cooperatively chooses an action a i ∈ Ai with the global action represented by a ≜ [a i]i=1*,...,n*. Each state, action pair is associated with a *reward* function: ρ(s, a). In order to achieve the common task, a policy parameterized by θ: π θ ≜ *S → A* governs the action taken by the agents, after observing state s ∈ S. The goal of rl is to learn the optimal policy parameters that maximizes the accumulation of rewards during a predefined number of interactions with the environment,2 v(θ). In contrast to rl, which receives feedback on the reward of an action with every interaction, we treat v(θ) as an opaque function measuring the *value* of a policy. We utilize bo to optimize θ using solely the accumulated reward, v(θ), as feedback from the environment. ## 4.1 Architectural Design To achieve a compact and tractable policy space, we consider policies under the useful abstractions of *role* and *role interaction*. These abstractions have consistently shown strong performance in multi-agent tasks. Therefore, we can simplify the policy space by limiting it to only policies using these abstractions, but still have powerful and expressive policies suitable for multi-agent systems. As role and role interaction are immutable abstractions within our policy space, we express them as static algorithms which are not searched over during policy optimization. These algorithms take as input parameters which are mutable and searched over during policy optimization. This combination of immutable instructions, and mutable parameters reduces the size of the search space,3 yet is still able to express policies which conform to the role and role interaction abstractions. We term this approach a *higher-order model* (hom) which generates (gen) the model using instructions and parameters into a policy model during evaluation. This hom is separated into role assignment, and role interaction stages. We visualize an overview of this approach in Fig. 1, left. The hom parameters are interpreted in context of the current state by the instructions (Alg. 1, Alg. 2, Alg. 3) of the hom to form the policy model which dictates the resultant action. In our work, each hom component of role assignment and role interaction is implemented as a neural network. ## 4.2 Role Assignment Following the success of role based collaboration in multi-agent systems, we assume the interaction and decision making of each agent is governed by its assigned role. For example, in drone delivery, roles could be short-distance deliveries, and long-distance deliveries. In filling these roles, the state of each of the agents are considered. E.g., a drone with low battery may be limited to only performing short-distance deliveries. A straightforward approach to implement role based interaction is to permute agents into an equivalent number of roles.4 We assume that an optimal policy can be decomposed as follows: $$\pi(\mathbf{a}^{1},\ldots,\mathbf{a}^{n}\mid\mathbf{s}^{1},\ldots,\mathbf{s}^{n})\triangleq\pi_{r}(\mathbf{a}^{\alpha(1)},\ldots,\mathbf{a}^{\alpha(n)}\mid\mathbf{s}^{\alpha(1)},\ldots\mathbf{s}^{\alpha(n)})$$ where α is a permutation function dependent on the state, s 1*, . . . ,* s n. Our approach to role assignment is simple and general purpose, which is also well studied and theoretically principled. To capture this behavior, we utilize a per role affinity function: Λ θr,i (·) which is the affinity to take on role i and is parameterized by θr,i. This function evaluates the affinity of agent ℓ taking on role i using the state of agent: s ℓ. The optimal permutation maximizes the total affinity of an assignment: Pn i=1 Λ θr,i (s α(i)) where α represents a permutation. This problem can be efficiently solved using the Hungarian algorithm (Kuhn, 1955). We integrate the Hungarian algorithm in our hom approach during the gen process. We formalize this in Algorithm 1 which forms the instructions in the role assignment hom. Given Algorithm 1, during gen process, the agents' state, s 1*, . . . ,* s n is contextually interpreted to yield a permutation model: α. Going forward, we consider the problem of determining the joint policy πr(a α(1)*, . . . ,* a α(n)| s α(1)*, . . .* s α(n)) which enables collaborative interactions. 2Further rl overview can be found in Arulkumaran et al. (2017). 3This approach to efficiency is similar in spirit to the work of Lee et al. (1986). 4This is a common assumption in multi-agent systems, see, e.g., Le et al. (2017). $$\left(2\right)$$ ## 4.3 Role Interaction Capturing multiple roles working together is an important part of an effective multi-agent policy. For example in drone delivery, drones must both divide the available task among themselves, as well as use collision avoidance while executing deliveries. Modeling role interactions must accomplish two goals. Firstly, agent interactions may change over time. For example collision avoidance strategies involve the closest drones which change as the drone moves within the environment. Secondly, efficient parameterization is needed as the number of interactions can scale exponentially due to considering interactions between many agents. To overcome these challenges, we propose a hom which generates (gen) a graphical model. The usage of a graphical model decomposes the exponentially scaling interaction problem into a pairwise interaction model, along with a message passing approach to facilitate complex interactions between many agents.5 The gen process is conditioned on the agents' state, thus enabling dynamic role interactions; in addition the gen process allows for a more compact policy space with far fewer parameters. The resultant generated graphical model captures the state-dependent interaction between roles and yields the resultant actions for each role. After gen, the interaction between roles are captured by the resultant conditional random field. This is presented in Fig. 1, right. The MRF (Markov Random Field) represents arbitrary undirected connectivity between nodes a α(1)*, . . . ,* a α(n), which is denoted by G. This connectivity allows different roles to collaborate together to determine the joint action. To generate graphical models of the above form, our hom uses edge affinity functions, Λ θg,v (·), which enables dynamic arbitrary connectivity between roles. For all pairs of roles with state, s α(i), s α(ℓ) an edge is generated if the affinity between these two states is sufficiently high (i.e., > 0). This dynamic edge generation approach overcomes the quadratic parameter scaling if all pairs of agents were separately modelled. The graphical model gen process is presented in Algorithm 2 which yields a graphical model. GEN s α s 1*, ...,* s n θr Role Assignment a α n sα(1)*, ...,* sα(n) Role Interaction θg,v Graph N θg,η, θg,e MPNN π MRF n Figure 1: Left: hom architecture. gen uses θr and θg during evaluation to yield a model which represents the policy. θr and θg are optimized by bo. Right: Inferring a α given s α. To cooperatively determine a set of actions for roles given the graphical model, we perform inference over the graphical model presented in Fig. 1 using Message Passing Neural Networks (Gilmer et al., 2017) (MPNN). We present iterative message passing rules to map from s α to a α: $$m_{t+1}^{\alpha(t)}\triangleq\sum_{\alpha(t)\in N^{\alpha(t)}}M^{\theta,\sigma}\left(h_{t}^{\alpha(t)},h_{t}^{\alpha(t)},i,t\right);\ \ h_{t+1}^{\alpha(t)}\triangleq U^{\theta,\sigma}\left(\mathbf{s}^{\alpha(t)},h_{t}^{\alpha(t)},m_{t+1}^{\alpha(t)}\right);\ \ \mathbf{a}^{\alpha}\triangleq\left[h_{\tau}^{\alpha(t)}\right]_{i=1,\ldots,n}\tag{3}$$ where M is the message function parameterized by θg,η which enables interaction between connected nodes, U is the action update function parameterized by θg,e which updates the node's internal hidden state conditioned on the messages received, and Nα(i) denotes the neighbors of α(i). The message passing procedure allows for cooperative determination of all roles' actions using pairwise message passing. Roles which are not immediate neighbors of each other influence each other's behavior through intermediary connecting nodes. The message passing procedure concludes after τ iterations of message passing with the policy actions indicated by the hidden states, -h α(i) τi=1*,...,n* . Finally, Algorithm 3 drives the gen process. The gen process consists of permuting agents into roles, creating the graphical model to enable interactions between agents taking on their respective roles, and finally performing inference over the graphical model using a MPNN. 5We refer readers to Wang et al. (2013) for additional overview on graphical models. ## 4.4 Additive Decomposition Although our hom policy representation is compact, it is still of significant dimensionality which makes optimization with bo difficult. hdbo is challenging due to the curse of dimensionality with common kernels such as Matern or RBF.6 This curse of dimensionality stems directly from the difficulty of finding the global optima of a high-dimensional function (e.g., a value function v(θ) determining the value of a policy in some unknown environment). A common technique to overcome this is through assuming additive structural decomposition on v: v(θ) ≜PM i=1 v (i)(θ (i)) where v (i) are independent functions, and θ (i) ∈ Θ(i)(Duvenaud et al., 2011). The additive decomposition simplifies a high-dimensional optimization problem since the optima of a function constructed through addition of subfunctions can be found by independently optimizing each subfunction as visualized in Fig. 2. In the context of bo, additive decomposition significantly simplifies the optimization problem due to the properties of Multivariate Gaussian variables. In additive decomposition we denote the domain of the optimization problem, Θ ≜ Θ1 × *. . .* × ΘD for some dimensionality D, that is the domain is constructed through the Cartesian product of each of its dimensions. Each subfunction to optimize, v (i), corresponds to a subdomain restricted to some subset of these dimensions, Θ(i) ⊆ {Θ1*, . . . ,* ΘD}. Typically, it is assumed that each Θ(i)is of low dimensionality (i.e., v (i)is defined on only a few dimensions for each i). This structural assumption is combined with the assumption that each v (i)is sampled from a GP. Due to the properties of Multivariate Gaussians, if v (i) ∼ GP0, kΘ(i)(θ (i), θ(i) ′ ) then v ∼ GP0,Pi k Θ(i)(θ (i), θ(i) ′ )(Rasmussen & Williams, 2006), which follows from the addition of two Gaussian random variables is also a Gaussian random variable. This assumption decomposes a high dimensional GP surrogate model of v into a set of many low dimensional GPs, which is easier to jointly learn and optimize. Figure 2: Left, above, plot of f(*x, y*) = x ![5_image_0.png](5_image_0.png) y; below, plot of f(*x, y*) = x + y. The curvature of *additively constructed functions* is zero; *non-zero curvature* indicates dependency among input variables. Right, examining the Hessian learns the dependency structure which decomposes complex problems into simpler problems solved by GP-UCB. To contextualize an additive decomposition, we represent the decomposition by a dependency graph between the dimensions: Gd ≜ (Vd, Ed) where Vd ≜ {Θ1*, . . . ,* ΘD} and Ed ≜ {(Θa, Θb) | *a, b* ∈ Θ(i)for some i}. A simple decomposition of an additive function and its associated dependency graph is visualized in Fig. 2. We **highlight** that this graph is between the dimensions of the policy parameters, Θ*, and is unrelated to the* graphical model of role interactions presented in earlier sections. It is possible to accurately model v by a kernel k ≜Pi k Θ(i)where each Θ(i)corresponds to a *maximal clique* of the dependency graph (Rolland et al., 2018). Knowing the dependency graph greatly simplifies the complexity of optimizing v. However, learning the dependency graph in additive decomposition remains challenging as there are O(D2) possible edges each of which may be present or absent yielding 2 O(D2) possible dependency structures. This difficult problem is often approached using inefficient stochastic sampling methods such as Gibbs sampling. ## 4.5 Dependency Structure Search Bayesian Optimization We propose learning the dependency structure during the gen process. Our proposed approach is based on the following observation, which is illustrated in Fig. 2. Proposition 1. Let Gd = (Vd, Ed) represent an additive dependency structure with respect to v(θ)*, then the* following holds true: ∀*a, b* ∂ 2v ∂θa∂θb ̸= 0 =⇒ (Θa, Θb) ∈ Ed which is a consequence of v *formed through addition* 6A parallel area in hdbo is of computational efficiency of acquisition which is outside the scope of this work. We refer readers to the works of Mutny & Krause (2018), Wilson et al. (2020), and Ament & Gomes (2022). | Algorithm 1 RoleAssignment | | Algorithm 2 RoleInteraction | | |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| | Require: s 1 , . . . , s n 1: return arg maxα Pn i=1 Λ θr,i (s α(i) ) | | Require: s α(1) , . . . , s α(n) 1: for i ← 1, . . . , n do 2: for ℓ ← 1, . . . , n do ▷ Edge affinities. 3: if Λθg,v (s α(i) , s α(ℓ) ) > 0 then 4: Nα(i) .append(α(ℓ)) 5: return Nα(1), . . . , Nα(n) | | | Algorithm 4 dss-gp-ucb | | Algorithm 3 gen-P olicy | | | Require: v, H, k 1: for t ← 1, . . . , T0 do | | ▷ Sample Hessian T0 × C1 times for dependencies. | | | 2: | θt,h ∼ U(Θ) | ▷ Randomly sample over the domain. | | | 3: | for ℓ ← 1, . . . , C1 do ht,ℓ ← H(θt,h) | | | | 4: Eed ← Ph > ch; Ged ← ({Θ1 , . . . , ΘD}, Eed) | | ▷ Discriminate dependencies | | | | | i=1 k Θ(i) | ▷ Compute Max-Cliques | | 5: [Θ(i) ]i=1,...,M ← Max-Cliques(Ged); k ← PM 6: for t ← T0, . . . , T do ▷ Run GP-UCB with dependency structure 7: θt ← arg maxθ µ k (θ) + p βtσ k (θ) ▷ Max-Cliques additive kernel t−1 t−1 8: Query θt to observe yt = v(θt) + N (0, ϵ2 ) 9: Update posterior, µ, σ, with θt, yt Require: s 1 , . . . , s n 1: α ← RoleAssignment(s 1 , . . . , s n) 2: N ← RoleInteraction(s α(1) , . . . , s α(n) ) 3: a ← MPNN(s α, N) ▷ See Eq. 3 | | | | | | | 4: return [a α−1(i) ]i=1,...,n | | of independent sub-functions v (i)*, at least one of which must contain* θ a, θb *as parameters for* ∂ 2v ∂θa∂θb ̸= 0 which implies their connectivity within Ed. In practice, observing the Hessian of the value function, Hv, is not possible due to v being an opaque function. However, during the gen process we can observe the Hessian of the policy, Hπ. This surrogate Hessian is closely related to the Hv as v(θ) is determined through interaction of the policy with an unknown environment. Because the *value* of a policy is a function of the policy; it follows by the chain rule that Hπ is an important sub-component of Hv. We utilize the surrogate Hessian in our work and demonstrate its strong empirical performance in validation. Following this reasoning, we consider algorithms with noisy query access to the Hessian, Hv. Note that we assume that the surrogate Hessian, Hπ, can well serve as a noisy surrogate for the true Hessian, Hv. 7 Assumption 1. Let Gd = (Vd, Ed) *be sampled from an Erdős-Rényi model with probability* pg < 1: Gd ∼ G(D, pg). That is, each edge (Θa, Θb) *is i.i.d. sampled from a binomial distribution with probability,* pg. With [Θ(i)]i=1,...,M representing the maximal cliques of Gd*, we assume that* v ∼ GP0,Pi k Θ(i)(θ (i), θ(i) ′ ) for some kernel k *taking an arbitrary number of arguments (e.g., RBF). Noisy queries can be made to the* Hessian of v, Hv*. We define* H(θ) ≜ [∂ 2v ∂θa∂θb + ϵ (a,b) h]a,b=1,...,D *where* ϵ (a,b) h ∼ N (0, σ2n ) *i.i.d. Each query to* H has corresponding regret of r(θ). Under this assumption, we show that it's possible to learn the underlying dependency structure of Gd = (Vd, Ed) with a polynomial number of queries to the noisy Hessian. We present dss-gp-ucb in Algorithm 4 and prove theoretical results regarding its performance. In the first stage of dss-gp-ucb, we perform C1 queries to the Hessian if t ≤ T0. These Hessian queries are then averaged and compared to a cutoff constant ch to determine the dependency structure Eed. We show that after C1T0 queries to the Hessian, with high probability we have Eed = Ed, where Ed is the unknown ground truth dependency structure for v. This argument is formalized in the following theorem. Theorem 1. Suppose8*there exists* σ 2 h , ph s.t. ∀*i, j* Pθ∼U(Θ) -k ∂i∂j (*θ, θ*) ≥ σ 2 h ≥ ph and ∀i, j, θ, θ′ k ∂i∂j (θ, θ′) ≥ 0. Then for any δ1, δ2 ∈ (0, 1) after t ≥ T0 steps of dss-gp-ucb (lines 1-4) *we have:* Ti,j P(Eei,j d = E i,j d ) ≥ 1 − δ1 − δ2 *when* T0 = C1 > 8D2 δ 2 1log 2D2 δ1 σ 2 n σ 2 h + D2 phδ2 , ch ≜ T0σn q2 log 2D2 δ1 . Our Theorem 1 relies on repeatedly sampling the Hessian to determine whether an edge exists between Θa, and Θbin the sampled additive decomposition. The key challenge is determining this connectivity under a very noisy setting, and for extremely low values of σ 2 h ≪ σ 2 n where the Hessian is zero with high probability. We are able to overcome this challenge using a Bienaymé's identity, a key tool in our analysis. We defer all proofs to the Appendix. 7We revisit the validity of this assumption in Appendix H. 8RBF kernel satisfies these assumptions when Θ = [0, 1]D. ![7_image_0.png](7_image_0.png) $$\left(4\right)$$ Figure 3: Ablation study. Training curves of our hom and its ablated variants on different multi-agent environments. In the second stage of dss-gp-ucb, we extract the maximal cliques depending on Eed and construct the GP kernel, k =Pi k Θ(i), the sum of the aforementioned kernels and inference and acquisition proceeds same as GP-UCB (lines 6-9). To bound the cumulative regret, Rt ≜PT0 t=1 C1r(θt,h) + PT t=T0 r(θt), we follow the following process. First, we bound the number and size of cliques of graphs sampled from the Erdős-Rényi model with high probability. Second, we bound the *mutual information* of an additive decomposition given the mutual information of its constituent kernels using Weyl's inequality. Third, we use similar analysis as Srinivas et al. (2010) to complete the regret bound. Theorem 2. Let k *be the kernel as in Assumption 1, and Theorem 1. Let* γ k T (d) : N → R *be a monotonically* increasing upper bound function on the mutual information of kernel k taking d arguments. The cumulative regret of dss-gp-ucb *is bounded with high probability as follows:* $$R_{T}=\tilde{\mathcal{O}}\Big(\sqrt{T\beta_{T}D^{\log D+5}\gamma_{T}^{k}(4\log D+c_{\gamma})}\Big)$$ (4) where cγ *is an appropriately picked constant and the base of the logarithm is* 1 pg . Whereas for typical kernels such as Matern and RBF, cumulative regret of GP-UCB scales exponentially with D, our regret bounds scale with exponent O(log D). This improved regret bound shows our approach is a theoretically grounded approach to hdbo. ## 5 Validation We compare our work against recent algorithms in marl on several multi-agent coordination tasks and rl algorithms for policy search in novel settings. We also perform ablation and investigation of our proposed hom at learning roles and multi-agent interactions. We defer experimental details to Appendix A. ![8_image_0.png](8_image_0.png) Figure 4: Left two plots: Sparse reward drone delivery task. Rightmost: Comparison with hdbo approaches. The left two plots validate the same approaches on different environments. All presented figures are average of 5 runs with shading representing ± Standard Error, the y-axis represents cumulative reward, the x-axis displayed above represents interactions with the environment in rl*, x-axis* displayed below represents iterations of bo. Commensurate with our focus on memory-constrained devices, all policy models consist of < 500 *parameters*. ## 5.1 Ablation We investigate the impact of Role Assignment (RA) and Role Interaction (RI) as well as model capacity on training progress. We conduct ablation experiments on Multiagent Ant with 6 agents, PredPrey with 3 agents, and Heterogenous PredPrey with 3 agents (Peng et al., 2021). Multiagent Ant is a MuJoCo (Todorov et al., 2012) locomotion task where each agent controls an individual appendage. PredPrey is a task where predators must work together to catch faster, more agile prey. Het. PredPrey is similar, except the predators have different capabilities of speed and acceleration. In ablation experiments, our default configuration is Med - RA - RI which employs components of RA and RI parameterized by neural networks with three layers and four neurons on each layer (medium sized neural network). The Sm, small, model is instead parameterized with neural networks of 1 layer with 2 neurons each. When RA is ablated, the agents interact directly without taking on any role based specialization. When RI is ablated, the agents' action is determined without any coordination between agents. We present our ablation in Fig. 3. For a simpler coordination task such as Multiagent Ant, we observe limited improvement through RA or RI. In contrast, RI shows strong improvement in PredPrey and Het. PredPrey. It is because, in PredPrey, predators must work together to catch the faster prey. Since the agents in PredPrey are homogeneous, ablating RA makes the optimization simpler and more compact without losing expressiveness. Thus, ablating RA leads to a performance increase. In Het. PredPrey, the predator agents have heterogeneous capabilities in speed and acceleration. Thus, RA plays a critical role in delivering strong performance. We also show that overly shrinking the model size (*Sm - RA - RI*) can hurt performance as the policy model is no longer sufficiently expressive. This is evidenced in the Multiagent Ant task. We observed that using neural networks of three layers with four neurons each to be sufficiently balanced across a wide variety of tasks. In Fig. 3, we present the detected Hessian structure by dss-gp-ucb in the respective tasks. The detected Hessian structures generally show strong block-diagonal associativity in the hom parameters, i.e., [θr,i, θg,v, θg,η, θg,e]. This shows that our approach can detect the interdependence *within* the sub-parameters, but relative independence between the sub-parameters. We observe more off-diagonal connectivity in the complex coordination tasks of PredPrey and Het. PredPrey. The visualization of Hessian structure on PredPrey shows that our approach can detect the importance of *jointly optimizing* role assignment and | Ant-v3 | | Hopper-v3 | Swimmer-v3 | Walker2d-v3 | | | | | | | | | | | | |-----------------------------------------------------|---------|-----------------------------|----------------------------------------|----------------------------------|----------------------------------------|-----------------------------------------|---------------------------|---------------------------------------|-----------|----------------------------|------|-----|-----|-----|-----------| | DDPG | PPO | SAC | TD3 | Intrinsic | DDPG | PPO | SAC | TD3 | Intrinsic | DDPG PPO SAC TD3 Intrinsic | DDPG | PPO | SAC | TD3 | Intrinsic | | Baseline −90.77 | 1105.69 | 2045.24 2606.17 2144.00 | 604.20 1760.65 2775.66 1895.76 1734.00 | 44.45 121.38 58.73 48.78 1950.00 | 2203.80 892.81 4297.03 1664.46 2210.00 | | | | | | | | | | | | Sparse 2 −32.88 | 1007.80 | 2563.97 1407.40 1964.00 | 877.93 1567.14 3380.60 1570.84 2074.00 | 35.59 | 99.50 46.75 47.23 1758.80 | 1470.62 1471.33 1673.46 2297.43 1952.00 | | | | | | | | | | | Sparse 5 −2687.97 | 961.31 | 711.56 | 762.61 | 1916.00 | 814.59 1616.79 3239.20 2290.67 1972.00 | 26.66 | 68.69 43.84 40.12 1856.00 | 961.30 697.93 1697.25 2932.27 1924.00 | | | | | | | | | Sparse 20 −2809.89 | 624.07 | 694.30 | 379.12 | 1838.00 | 783.95 1629.28 2535.17 1436.33 1537.20 | 19.12 | 54.63 37.78 37.03 2108.00 | 663.04 365.39 1010.63 276.56 1810.00 | | | | | | | | | Sparse 50 −3067.37 −67.43 | 663.28 | 253.66 | 1091.20 | 816.25 1010.73 1238.03 551.43 | 642.00 | 23.73 | 51.52 38.78 30.01 812.00 | 572.12 428.29 349.47 298.28 | 834.75 | | | | | | | | Sparse 100 −3323.43 −4021.56 679.30 −115.43 450.40 | | 988.36 324.51 260.52 342.48 | 406.80 | 9.64 | 21.09 27.98 30.10 376.60 | 523.89 205.93 200.16 147.22 | 480.60 | | | | | | | | | | Sparse 200 −3098.37 −8167.98 −107.14 −147.86 258.60 | | 765.05 222.76 300.36 281.68 | 350.80 | −9.97 21.69 33.35 30.48 342.80 | 182.84 193.43 187.16 148.06 | 353.20 | | | | | | | | | | | dss-gp-ucb | 1147.21 | 1009.3 | 175.73 | | 1008.90 | | | | | | | | | | | Table 1: dss-gp-ucb typically outperforms rl with higher sparsity (e.g., Sparse-100, or Sparse-200). interaction to deliver a strong policy in this complex coordination task. We investigate the learning behavior of the hom further in Appendix B. ## 5.2 Comparison With Marl We compare our method with competing marl algorithms on several multi-agent tasks where the number of agents is increased. We validate both the hom with dss-gp-ucb (dss-gp-ucb (MM)) and neural network policies trained in the CTDE paradigm (dss-gp-ucb (CTDE)). In the CTDE paradigm, both RI and RA are ablated reducing the policy model to a neural network which is identical across all agents. We observe that on complex coordination tasks such as PredPrey and Het. PredPrey our approach delivers more performant policies when coordination is required between *a large number of agents*. This is presented9in Fig. 5. Although SOG (Shao et al., 2022), a Comm-marl approach shows compelling performance with a small number of agents, with 15 agents, both dss-gp-ucb (CTDE) and dss-gp-ucb (MM) outperform this strategy. We highlight that dss-gp-ucb (CTDE) outperforms Comm-marl approaches without communication during execution. We also note that dss-gp-ucb (MM) outperforms dss-gp-ucb (CTDE) showing the value of our hom approach in complex coordination tasks. We defer further experimental results in this setting to Appendix B. ## 5.3 Policy Optimization Under Malformed Reward We compare against several competing rl and marl algorithms under malformed reward scenarios. We train neural network policies with dss-gp-ucb and competing algorithms. We consider a sparse reward scenario where reward feedback is given every S environment interactions for varying S. Table 1 shows that the performance of competing algorithms is severely degraded with sparse reward and dss-gp-ucb outperforms competing approaches on most tasks with moderate or higher sparsity. Although intrinsic motivation (Singh et al., 2004; Zheng et al., 2018) has shown evidence in overcoming this limitation, we find that our approach outperforms competing approaches supported by intrinsic motivations at higher sparsity. This improvement is important as sparse and malformed reward structure scenarios can occur in real-world tasks (Aubret et al., 2019). We repeat this validation in Appendix B with marl algorithms in multi-agent settings and consider a delayed feedback setting with similar results. ## 5.4 Higher-Order Model Investigation We examined policy for Multiagent Ant with 6 agents for the role based policy specialization. The policy modulation plots were generated by examining the PredPrey and Het. PredPrey environments respectively. In Fig. 6 we investigate the learned hom policies. Our investigation shows that *role* is used to specialize agent policies while maintaining a common theme. *Role interaction* modulates the policy through graphical model inferences. Finally, role interactions are sparse, however noticeably higher for complex coordination tasks such as PredPrey. 9We plot with respect to total environment interactions for l, and total policy evaluations for bo. See Appendix J, Appendix K, and Appendix L for alternate presentations of data more favorable to rl and marl under which our conclusions still hold. ![10_image_0.png](10_image_0.png) The left column shows PredPrey with 6, 9, and 15 agents. The right column shows Het, PredPrey with 6, 9, and 15 agents. ## 5.5 Comparison With Hdbo Algorithms We compare with several related work in hdbo. This is presented in Fig. 4, rightmost plots. We compare against these algorithms at optimizing our hom policy. For more complex tasks that require role based interaction and coordination, our approach outperforms related work. TreeBO (Han et al., 2021) is also an additive decomposition approach to hdbo, but uses Gibbs sampling to learn the dependency structure. However, our approach of learning the structure through *Hessian-Awareness* outperforms this approach. Additional experimental results are deferred to Appendix B. ![11_image_0.png](11_image_0.png) Figure 6: Left: Action distributions of different roles showing diversity in the Multiagent Ant environment with 6 agents. Right above: Policy modulation with role interaction in PredPrey and Het. PredPrey environment with 3 agents. Arrows represent change after message passing. These plots are visualizations of the two principal components after Principal Component Analysis. Right below: Mean connectivity ratio between agents and standard deviation in role interaction in Multiagent Ant with 6 agents, PredPrey with 3 agents, and Het. PredPrey with 3 agents. ## 5.6 Drone Delivery Task We design a drone delivery task that is well aligned with our motivation of considering policy search in memory-constrained devices on tasks with *unhelpful or noisy gradient information*. In this task, drones must maximize the throughput of deliveries while avoiding collisions and conserving fuel. This task is challenging as a positive reward through completing deliveries is rarely encountered (i.e., sparse rewards). However, agents often receive negative rewards due to collisions or running out of fuel. Thus, gradient-based approaches can easily fall into local minima and fail to find policies that complete deliveries.10 We compare dss-gp-ucb against competing approaches in Fig. 4, leftmost two plots. We observe that marl based approaches fail to find a meaningfully rewarding policy in this setting, whereas our approach shows strong and compelling performance. Furthermore, dss-gp-ucb (MM) outperforms dss-gp-ucb (CTDE) through leveraging roles and role interactions. ## 6 Conclusion We have proposed a hom policy along with an effective optimization algorithm, dss-gp-ucb. Our hom and dss-gp-ucb are designed to offer strong performance in high coordination multi-agent tasks under sparse or malformed reward on memory-constrained devices. dss-gp-ucb is a theoretically grounded approach to bo offering good regret bounds under reasonable assumptions. Our validation shows dss-gp-ucb outperforms rl and marl at optimizing neural network policies in malformed reward scenarios. Our hom optimized with dss-gp-ucb outperforms marl approaches in high coordination multi-agent scenarios by leveraging the concepts of *role* and *role interaction*. Furthermore, we show through our drone delivery task, our approach outperforms marl approaches in multi-agent coordination tasks with sparse reward. We make significant progress on high coordination multi-agent policy search by overcoming challenges posed by malformed reward and memory-constrained settings. 10Further details on this task can be found in Appendix I. ## References Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www. tensorflow.org/. Software available from tensorflow.org. Riad Akrour, Dmitry Sorokin, Jan Peters, and Gerhard Neumann. Local bayesian optimization of motor skills. In *Proc. ICML*, 2017. Sebastian E. Ament and Carla P. Gomes. Scalable first-order bayesian optimization via structured automatic differentiation. In *Proc. ICML*, pp. 500–516, 2022. Kai Arulkumaran, Marc Peter Deisenroth, Miles Brundage, and Anil Anthony Bharath. Deep reinforcement learning: A brief survey. *IEEE Signal Process. Mag.*, 34(6):26–38, 2017. Arthur Aubret, Laëtitia Matignon, and Salima Hassas. A survey on intrinsic motivation in reinforcement learning. *CoRR*, abs/1908.06976, 2019. Andrei-Cristian Barbos, Francois Caron, Jean-François Giovannelli, and Arnaud Doucet. Clone MCMC: parallel high-dimensional gaussian gibbs sampling. In *Proc. NeurIPS*, 2017. Joel Berkeley, Henry B. Moss, Artem Artemev, Sergio Pascual-Diaz, Uri Granta, Hrvoje Stojic, Ivo Couckuyt, Jixiang Qing, Nasrulloh Loka, Andrei Paleyes, Sebastian W. Ober, and Victor Picheny. Trieste, 7 2022. URL https://github.com/secondmind-labs/trieste. Béla Bollobás and Paul Erdös. Cliques in random graphs. In *Proc. Cambridge Philosophical Society*, 1976. Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016. Shuyu Cheng, Guoqiang Wu, and Jun Zhu. On the convergence of prior-guided zeroth-order optimization algorithms. In *Proc. NeurIPS*, pp. 14620–14631, 2021. John T Chu. On bounds for the normal integral. *Biometrika*, 42:263–265, 1955. Abhishek Das, Théophile Gervet, Joshua Romoff, Dhruv Batra, Devi Parikh, Mike Rabbat, and Joelle Pineau. Tarmac: Targeted multi-agent communication. In *Proc. ICML*, pp. 1538–1546, 2019. Christian Schroeder de Witt, Bei Peng, Pierre-Alexandre Kamienny, Philip Torr, Wendelin Böhmer, and Shimon Whiteson. Deep multi-agent reinforcement learning for decentralized continuous cooperative control. arXiv preprint arXiv:2003.06709, 2020. Carlo D'Eramo, Davide Tateo, Andrea Bonarini, Marcello Restelli, and Jan Peters. Mushroomrl: Simplifying reinforcement learning research. 2021. Kevin Dorling, Jordan Heinrichs, Geoffrey G. Messier, and Sebastian Magierowski. Vehicle routing problems for drone delivery. *IEEE Trans. Syst. Man Cybern. Syst.*, 47(1):70–85, 2017. David Duvenaud, Hannes Nickisch, and Carl Edward Rasmussen. Additive gaussian processes. In Proc. NeurIPS, pp. 226–234, 2011. David Eriksson, Michael Pearce, Jacob R. Gardner, Ryan Turner, and Matthias Poloczek. Scalable global optimization via local bayesian optimization. In *Proc. NeurIPS*, 2019a. David Eriksson, Michael Pearce, Jacob R. Gardner, Ryan Turner, and Matthias Poloczek. Scalable global optimization via local Bayesian optimization. In *Proc. NeurIPS*, pp. 5497–5508, 2019b. Natalia Y. Ermolova and Sven-Gustav Häggman. Simplified bounds for the complementary error function. In Proc. Eurasip, pp. 1087–1090, 2004. Jakob Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. In *Proceedings of the AAAI conference on artificial intelligence*, volume 32, 2018. Lukas P. Fröhlich, Melanie N. Zeilinger, and Edgar D. Klenske. Cautious bayesian optimization for efficient and scalable policy search. In *Proc. L4DC*, 2021. Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actor-critic methods. In *International conference on machine learning*, pp. 1587–1596. PMLR, 2018. Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In *Proc. ICML*, pp. 1263–1272, 2017. Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In *International conference on machine* learning, pp. 1861–1870. PMLR, 2018. Eric Han, Ishank Arora, and Jonathan Scarlett. High-dimensional bayesian optimization via tree-structured additive models. *arXiv preprint arXiv:2012.13088*, 2020. Eric Han, Ishank Arora, and Jonathan Scarlett. High-dimensional Bayesian optimization via tree-structured additive models. In *Proc. AAAI*, pp. 7630–7638, 2021. Verena Heidrich-Meisner and Christian Igel. Evolution strategies for direct policy search. In *Proc. PPSN*, pp. 428–437, 2008. Matthew J. Johnson, James Saunderson, and Alan S. Willsky. Analyzing hogwild parallel gaussian gibbs sampling. In *Proc. NeurIPS*, 2013. Kirthevasan Kandasamy, Jeff G. Schneider, and Barnabás Póczos. High dimensional bayesian optimisation and bandits via additive models. In *Proc. ICML*, pp. 295–304, 2015. Johannes Kirschner, Mojmir Mutny, Nicole Hiller, Rasmus Ischebeck, and Andreas Krause. Adaptive and safe Bayesian optimization in high dimensions via one-dimensional subspaces. In *Proc. ICML*, pp. 3429–3438, 2019. Harold W Kuhn. The hungarian method for the assignment problem. *Naval research logistics quarterly*, 2 (1-2):83–97, 1955. Hoang Minh Le, Yisong Yue, Peter Carr, and Patrick Lucey. Coordinated multi-agent imitation learning. In Proc. ICML, pp. 1995–2003, 2017. YC Lee, Gary Doolen, HH Chen, GZ Sun, Tom Maxwell, and HY Lee. Machine learning using a higher order correlation network. Technical report, Los Alamos National Lab (LANL), Los Alamos, NM (United States); Univ. of Maryland, College Park, MD (United States), 1986. Benjamin Letham, Roberto Calandra, Akshara Rai, and Eytan Bakshy. Re-examining linear embeddings for high-dimensional Bayesian optimization. In *Proc. NeurIPS*, 2020. Kemas M Lhaksmana, Yohei Murakami, and Toru Ishida. Role-based modeling for designing agent behavior in self-organizing multi-agent systems. *International Journal of Software Engineering and Knowledge* Engineering, 28(01):79–96, 2018. Chenghao Li, Tonghan Wang, Chengjie Wu, Qianchuan Zhao, Jun Yang, and Chongjie Zhang. Celebrating diversity in shared multi-agent reinforcement learning. In *Proc. NeurIPS*, pp. 3991–4002, 2021. Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. *arXiv preprint arXiv:1509.02971*, 2015. Yong Liu, Weixun Wang, Yujing Hu, Jianye Hao, Xingguo Chen, and Yang Gao. Multi-agent game abstraction via graph attention neural network. In *Proc. AAAI*, pp. 7211–7218, 2020. Daniel J. Lizotte, Tao Wang, Michael H. Bowling, and Dale Schuurmans. Automatic gait optimization with gaussian process regression. In *Proc. IJCAI*, 2007. Ryan Lowe, Yi I Wu, Aviv Tamar, Jean Harb, OpenAI Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. *Advances in neural information processing* systems, 30, 2017. Eduardo Magalhães. On the properties of the hessian tensor for vector functions. *viXra preprint* viXra:2005.0044, 2020. Alonso Marco, Philipp Hennig, Jeannette Bohg, Stefan Schaal, and Sebastian Trimpe. Automatic LQR tuning based on gaussian process global optimization. In *Proc. ICRA*, 2016. Ruben Martinez-Cantin. Bayesian optimization with adaptive kernels for robot control. In *Proc. ICRA*, 2017. Alexander G. de G. Matthews, Mark van der Wilk, Tom Nickson, Keisuke. Fujii, Alexis Boukouvalas, Pablo León-Villagrá, Zoubin Ghahramani, and James Hensman. GPflow: A Gaussian process library using TensorFlow. *Journal of Machine Learning Research*, 18(40):1–6, apr 2017. URL http://jmlr.org/papers/ v18/16-537.html. David W Matula. *The largest clique size in a random graph*. Department of Computer Science, Southern Methodist University Dallas, Texas, 1976. Mark McLeod, Stephen J. Roberts, and Michael A. Osborne. Optimization, fast and slow: optimally switching between local and bayesian optimization. In *Proc. ICML*, 2018. Massimo Merenda, Carlo Porcaro, and Demetrio Iero. Edge machine learning for AI-Enabled IoT devices: A review. *Sensors*, 20(9):2533, 2020. Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. *nature*, 518(7540):529–533, 2015. Sarah Müller, Alexander von Rohr, and Sebastian Trimpe. Local policy search with Bayesian optimization. In *Proc. NeurIPS*, pp. 20708–20720, 2021. Mojmir Mutny and Andreas Krause. Efficient high dimensional bayesian optimization with additivity and quadrature fourier features. In *Proc. NeurIPS*, pp. 9019–9030, 2018. Frans A Oliehoek, Matthijs TJ Spaan, and Nikos Vlassis. Optimal and approximate q-value functions for decentralized pomdps. *Journal of Artificial Intelligence Research*, 32:289–353, 2008. Evgenia Papavasileiou, Jan Cornelis, and Bart Jansen. A systematic literature review of the successors of "neuroevolution of augmenting topologies". *Evolutionary Computation*, 29(1):1–73, 2021. Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In *International conference on machine learning*, pp. 2778–2787. PMLR, 2017. Bei Peng, Tabish Rashid, Christian Schroeder de Witt, Pierre-Alexandre Kamienny, Philip Torr, Wendelin Böhmer, and Shimon Whiteson. Facmac: Factored multi-agent centralised policy gradients. *Advances in* Neural Information Processing Systems, 34:12208–12221, 2021. Peng Peng, Ying Wen, Yaodong Yang, Quan Yuan, Zhenkun Tang, Haitao Long, and Jun Wang. Multiagent bidirectionally-coordinated nets: Emergence of human-level coordination in learning to play starcraft combat games. *arXiv preprint arXiv:1703.10069*, 2017. Victor Picheny, Henry B. Moss, Léeonard Torossian, and Nicolas Durrande. Bayesian quantile and expectile optimisation. In *Proc. UAI*, pp. 1623–1633, 2022. Hong Qian and Yang Yu. Derivative-free reinforcement learning: a review. *Frontiers of Computer Science*, 15 (6):1–19, 2021. Tabish Rashid, Mikayel Samvelyan, Christian Schroeder, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. Qmix: Monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 4295–4304. PMLR, 2018. Carl Edward Rasmussen and Christopher K. I. Williams. *Gaussian processes for machine learning.* MIT Press, 2006. Yara Rizk, Mariette Awad, and Edward W Tunstel. Decision making in multiagent systems: A survey. *IEEE* Transactions on Cognitive and Developmental Systems, 10(3):514–529, 2018. Diederik M Roijers, Peter Vamplew, Shimon Whiteson, and Richard Dazeley. A survey of multi-objective sequential decision-making. *Journal of Artificial Intelligence Research*, 48:67–113, 2013. Paul Rolland, Jonathan Scarlett, Ilija Bogunovic, and Volkan Cevher. High-dimensional bayesian optimization via additive models with overlapping groups. In *Proc. AISTATS*, pp. 298–307, 2018. John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. *arXiv preprint arXiv:1707.06347*, 2017. Guy Shani, Joelle Pineau, and Robert Kaplow. A survey of point-based POMDP solvers. *Autonomous Agents* and Multi-Agent Systems, 27:1–51, 2013. Jianzhun Shao, Zhiqiang Lou, Hongchang Zhang, Yuhang Jiang, Shuncheng He, and Xiangyang Ji. Selforganized group for cooperative multi-agent reinforcement learning. *Proc. NeurIPS*, pp. 5711–5723, 2022. Shubhanshu Shekhar and Tara Javidi. Significance of gradient information in bayesian optimization. In *Proc.* AISTATS, 2021. Amanpreet Singh, Tushar Jain, and Sainbayar Sukhbaatar. Learning when to communicate at scale in multiagent cooperative and competitive tasks. In *Proc. ICLR*, 2019. Satinder Singh, Andrew G. Barto, and Nuttapong Chentanez. Intrinsically motivated reinforcement learning. In *Proc. NeurIPS*, pp. 1281–1288, 2004. Maciej Skorski. Chain rules for hessian and higher derivatives made easy by tensor calculus. arXiv preprint arXiv:1911.13292, 2019. Kyunghwan Son, Daewoo Kim, Wan Ju Kang, David Earl Hostallero, and Yung Yi. Qtran: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 5887–5896. PMLR, 2019. Niranjan Srinivas, Andreas Krause, Sham M. Kakade, and Matthias W. Seeger. Gaussian process optimization in the bandit setting: No regret and experimental design. In *Proc. ICML*, 2010. Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, et al. Value-decomposition networks for cooperative multi-agent learning. *arXiv preprint arXiv:1706.05296*, 2017. Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012. Alexander von Rohr, Sebastian Trimpe, Alonso Marco, Peer Fischer, and Stefano Palagi. Gait learning for soft microrobots controlled by light fields. In *Proc. IROS*, 2018. Chaohui Wang, Nikos Komodakis, and Nikos Paragios. Markov random field modeling, inference & learning in computer vision & image understanding: A survey. *Comput. Vis. Image Underst.*, 117(11):1610–1627, 2013. Jianhao Wang, Zhizhou Ren, Terry Liu, Yang Yu, and Chongjie Zhang. QPLEX: Duplex dueling multi-agent Q-Learning. In *Proc. ICLR*, 2021a. Linnan Wang, Rodrigo Fonseca, and Yuandong Tian. Learning search space partition for black-box optimization using monte carlo tree search. In *Proc. NeurIPS*, 2020a. Tonghan Wang, Heng Dong, Victor Lesser, and Chongjie Zhang. Roma: Multi-agent reinforcement learning with emergent roles. *arXiv preprint arXiv:2003.08039*, 2020b. Tonghan Wang, Tarun Gupta, Anuj Mahajan, Bei Peng, Shimon Whiteson, and Chongjie Zhang. RODE: Learning roles to decompose multi-agent tasks. In *Proc. ICLR*, 2021b. Daan Wierstra, Tom Schaul, Jan Peters, and Jürgen Schmidhuber. Fitness expectation maximization. In Proc. PPSN, pp. 337–346, 2008. Aaron Wilson, Alan Fern, and Prasad Tadepalli. Using trajectory data to improve bayesian optimization for reinforcement learning. *JMLR*, 15(1), 2014. James T. Wilson, Viacheslav Borovitskiy, Alexander Terenin, Peter Mostowsky, and Marc Peter Deisenroth. Efficiently sampling functions from Gaussian process posteriors. In *Proc. ICML*, pp. 10292–10302, 2020. Zeyu Zheng, Junhyuk Oh, and Satinder Singh. On learning intrinsic rewards for policy gradient methods. In Proc. NeurIPS, pp. 4649–4659, 2018. Changxi Zhu, Mehdi Dastani, and Shihan Wang. A survey of multi-agent reinforcement learning with communication. *arXiv preprint arXiv:2203.08975*, 2022. ## A Experimental Details We used Trieste (Berkeley et al., 2022), Tensorflow (Abadi et al., 2015), and GPFLow (Matthews et al., 2017) to build our work and perform comparisons using MushroomRL (D'Eramo et al., 2021), MultiagentMuJoCo (de Witt et al., 2020), OpenAI Gym (Brockman et al., 2016), and Multi-agent Particle environment (Lowe et al., 2017). When comparing with related work, we used neural network policies of equivalent size. All of our tested policies are < 500 parameters, however the XL models are constructed using 3 layers of 400 neurons each. To estimate the Hessian, we used the Hessian-Vector product approximation. We relaxed the discrete portions of our hom policy into differentiable continuous approximation for this phase using the Sinkhorn-Knopp algorithm for the Role Assignment phase. For role interaction network connectivity, we used a sigmoid to create differentiable "soft" edges between each role. We pragmatically kept all detected edges in the Hessian while maintaining computational feasibility. We observed that our approach could support up to 1500 edges in the dependency graph prior to experiencing computational intractability. We used the Matern- 52 as the base kernel in all our models. ## A.1 Ablation And Investigation In the ablation, we perform experiments on MultiagentMuJoCo with environments Multiagent Ant with 6 segments, Multiagent Swimmer with 6 segments, Predator Prey with 3 predators, and Heterogeneous Predator Prey with 3 predators. In the Predator Prey environment, multiple predators must work together to capture faster and more agile prey. In Heterogeneous Predator Prey, each Predator has differing capabilities of speed and acceleration. This modification is challenging as a policy must not only coordinate between the Predators, but roles based specialization must be considered given the heterogeneous nature of each predator's capabilities. To generate Fig. 6, we examined policy for Multiagent Ant with 6 agents for the role based policy specialization. The policy modulation plots were generated by examining the PredPrey and Het. PredPrey environments respectively. ## A.2 Comparison With Marl For the marl setting, we compare against MADDPG (Lowe et al., 2017), FACMAC (Peng et al., 2021), COMIX (Peng et al., 2021), RODE (Wang et al., 2021b) and CDS (Li et al., 2021) using QPLEX (Wang et al., 2021a) as a base algorithm. We also compare against Comm-marl approaches SOG (Shao et al., 2022), and G2ANet (Liu et al., 2020). RODE and QPLEX are limited to discrete environments, thus we are unable to provide comparisons on continuous action space tasks such as Multiagent Ant or Multiagent Swimmer. All marl environments were trained for 2, 000, 000 timesteps. The neural network policies were 3-layers each with 15 neurons per layer, and were greater than or equal to the size of the compared hom policy. For Actor-Critic approaches, we did not reduce the size or expressivity of the critic. All used hyperparameters and Algorithmic configurations were as advised by the authors of the work. In the marl setting we use Multiagent Ant, Multiagent Swimmer, Predator-Prey, Heterogeneous PredatorPrey. Multiagent Ant, and Multiagent Swimmer are MuJoCo locomotion tasks where each agent controls a segment of an Ant or Swimmer. Predator-Prey (PredPrey N) environment is a cooperative environment where N of agents work together to chase and capture prey agents. In Heterogeneous Predator Prey, each Predator has differing capabilities of speed and acceleration. This modification is challenging as a policy must not only coordinate between the Predators, but roles based specialization must be considered given the heterogeneous nature of each predator's capabilities. We also validated related work on the drone delivery task under which a drone swarm of N agents (Drone Delivery-N) must complete deliveries of varying distances while avoiding collisions and conserving fuel. The code of which is available in supplementary materials and will be open sourced. We used batching (Picheny et al., 2022) in our comparisons with marl to allow for a large number of iterations of bo. We used a batch size of 15 in our comparison experiments. In this setting, all MuJoCo environments use the default epoch (total number of interactions with the environment for computing reward) length of 1000, for Predator-Prey environments, epoch length was 25, for Drone Delivery environment, epoch length was 150. ## A.3 Rl And Marl Under Malformed Reward For single agent rl we compared against SAC (Haarnoja et al., 2018), PPO (Schulman et al., 2017), TD3 (Fujimoto et al., 2018), and DDPG (Lillicrap et al., 2015) as well as an algorithm using intrinsic motivation (Zheng et al., 2018). In single agent setting, we trained related work for 200, 000 timesteps. In the marl setting, we trained for 2, 000, 000 timesteps. In both single-agent setting and multi-agent setting all policy networks for both dss-gp-ucb and related work was 3 layers of 10 neurons each. The tested environments were standard OpenAI Gym benchmarks of Ant, Hopper, Swimmer, and Walker2D. In the marl setting we compared against COVDN (Peng et al., 2021), COMIX, FACMAC, and MADDPG. Comparisons were not possible against other approaches as these do not support continuous action environments and are restricted to discrete action spaces. For all environments and algorithms, we used the recommended hyperparameter settings as defined by the authors. ## A.4 Comparison With Hdbo Algorithms For this comparison, we compared with several related works in hdbo. We compared with TurBO (Eriksson et al., 2019b), Alebo (Letham et al., 2020), TreeBO (Han et al., 2021), LineBO (Kirschner et al., 2019), and a recent variant of bo for policy search, GIBO (Müller et al., 2021). For computational efficiency, the epoch length for MuJoCo environments was reduced to 500. ## A.5 Drone Delivery Task The experimental details follow that of comparisons with marl. ## A.6 Compute All experiments were performed on commodity CPU and GPUs. Each experimental setting took no more than 2 days to complete on a single GPU. Table 2: Policy model sizes. Unfilled entries mean this environment was not considered during validation. Ant-v3 Hopper-v3 Swimmer-v3 Walker2d-v3 Ant-v3 (marl) Hopper-v3 (marl) Swimmer-v3 (marl) Walker2d-v3 (marl) | rl (Single Agent) 478 263 222 356 marl (CTDE) 310 267 267 353 | |-----------------------------------------------------------------| dss-gp-ucb (Single Agent) 478 263 222 356 dss-gp-ucb (CTDE) 310 267 267 353Table 3: Policy model sizes. Unfilled entries mean this environment was not considered during validation.Multiagent-Swimmer 4 Multiagent-Swimmer 8 Multiagent-Swimmer 12 Multiagent-Ant 8 Multiagent-Ant 12 Multiagent-Ant 16 PredPrey 6 PredPrey 9 PredPrey 15 Het. PredPrey 6 Het. PredPrey 9 Het. PredPrey 15marl (CTDE) 267 267 267 396 396 396 478 478 478 478 478 478dss-gp-ucb (CTDE) 267 267 267 396 396 396 478 478 478 478 478 478dss-gp-ucb (MM) 216 244 244 406 434 434 373 373 393 373 393 393 ## A.7 Policy Sizes We list the policy sizes of our models in Table 2 and 3. Of note is in each environment, the compared against policy of rl or marl is greater than or equal to in size vs. the policy optimized by dss-gp-ucb. ## A.8 Hyperparameter For Higher-Order Model For our hom we utilized simple grid search in order to pick the hyperparameter settings. Overly large neural networks suffered from difficulty of optimization by bo, whereas, overly small neural networks suffered from performance difficulty on several environments. We found that neural networks of 3 layers, and 4 neurons each performed well across a wide number of tested environments. ![21_image_0.png](21_image_0.png) Figure 7: Ablation study. Training curves of dss-gp-ucb and its ablated variants on different multi-agent environments. ## B Additional Experiments B.1 Ablation We present an expanded version of Fig. 3 in Fig. 7 including the ablation for Multiagent Swimmer. Multiagent Swimmer shows similar behavior as the simpler task Multiagent Ant, with stronger block-diagonal Hessian structure. ## B.2 Comparison With Marl We present an expanded version of Fig. 5 in Fig. 8 including the results for Multiagent-Ant and MultiagentSwimmer. We observe that in this relatively uncomplicated task not well-suited for our approach with dense reward, our hom approach shows comparable performance to marl approaches and far outperforms dss-gp-ucb (CTDE). This shows the overall value of our hom approach. ## B.3 Rl And Marl Under Malformed Reward We present additional experiments under malformed reward for both rl and marl. We formally define the Sparse reward scenario. Let v(θ) ≜PΓˆΓ=1 rΓ where the value of the policy is determined through Γˆ interactions with some unknown environment and each interaction is associated with the reward, rΓ. Typically, rl algorithms observe the reward, rΓ after every interaction with the environment. We consider a sparse reward scenario where reward feedback is given every S steps: ˜ r S Γ ≜PΓΓ−S rΓ if Γ ≡ 0 mod S and 0 o.w. In addition to the sparse reward setting described earlier, we also consider the setting of delayed reward. The delayed reward scenario is defined: ˜ r D Γ ≜ rΓ−D if Γ > D and 0 o.w. Thus in the delayed reward scenario, feedback on an action taken is *delayed*. This scenario is important as it arises in long term planning tasks where the value of an action is not immediately clear, but rather is ascertained after significant delays. We present the complete table comparing related works in rl with dss-gp-ucb in Table 4. As can be seen, similar to the Sparse reward scenarios, significant degradation can be observed across all tested rl algorithms with dss-gp-ucb outperforming rl algorithms with moderate to severe amount of sparsity or delay. This degradation cannot be overcome by increasing the size of the policy, as we verify with the "XL" models which are orders of magnitude larger with 3 layers of 400 neurons. ![22_image_0.png](22_image_0.png) We repeat these experimental scenarios in the marl setting with similar results in Table 5 where marl approaches are compared against dss-gp-ucb in the CTDE setting. Thus our validation shows that in both rl and marl strong performance requires dense, informative feedback which may not be present outside of simulator settings. In these settings, our approach of optimizing small compact policies using dss-gp-ucb outperforms related work in both rl and marl. ![24_image_0.png](24_image_0.png) Table 5: marl under sparse reward. Sparse n refers to sparse reward. Delay n refers to delayed reward. Averaged over 5 runs. Parenthesis indicatestandard error.Ant-v3 Hopper-v3 Swimmer-v3 Walker2d-v3COVDN COMIX MADDPG FACMAC COVDN COMIX MADDPG FACMAC COVDN COMIX MADDPG FACMAC COVDN COMIX MADDPG FACMAC ![24_image_1.png](24_image_1.png) ![25_image_0.png](25_image_0.png) Figure 9: Comparison with bo algorithms. dss-gp-ucb outperforms on complex multi-agent coordination tasks. ## B.4 Comparison With Hdbo Algorithms We compare with several related work in High-dimensional bo including TurBO (Eriksson et al., 2019b), AleBO (Letham et al., 2020), LineBO (Kirschner et al., 2019), TreeBO (Han et al., 2021), and GIBO (Müller et al., 2021). This is presented in Fig. 9. We experienced out-of-memory issues with AleBO after approximately 100 iterations, hence the AleBO plots are truncated. We compare against these algorithms at optimizing our hom policy for solving various multi-agent policy search tasks. We validated on Multiagent Ant with 6 agents, PredPrey with 3 agents, Het. PredPrey with 3 agents, Drone Delivery with 3 agents, and also Het. PredPrey with 6 agents. We observe that these competing works offer competitive performance for simpler tasks such as Multiagent Ant and PredPrey with 3 agents. However for more complex tasks that require role based interaction and coordination, our approach outperforms related work. This is evidenced in Het. PredPrey 3, Het. PredPrey 6 as well as the Drone Delivery task with 3 agents. Thus our validation shows that for simpler task, competing related works are able to optimize for simple policies of low underlying dimensionality. However, for more complex tasks which require sophisticated interaction using both Role and Role Interaction, related work is less capable of optimizing for strong policies due to the complexity of the high-dimensional bo *task*. In contrast, our work offers the capability of finding stronger policies for these complex tasks and scenarios. Table 6: Summary of key notations. ![26_image_0.png](26_image_0.png) [σkT v Λ Λ U θg,e The action update function parameterized by *θg,e* for the role interaction message passing neural network ## C Table Of Notations Table 6 provides a summary of notations that are used frequently in paper. ## D On The Applicability Of Our Assumptions To Rbf And Matern Kernel We show that our assumption is satisfied by the RBF Kernel when Θ = [0, 1]D, and is quasi-satisfied by the Matern− 5 2 kernel. We also show that in the setting where Θ = [0, r] D for some bounded r, our assumptions are quasi-satisfied as although these kernels may take on small negative values, these values decay exponentially with respect to the distance. These Lemmas show that our assumptions are reasonable. Lemma 1. Let k (*θ, θ*′) ≜ exp( −d 2 2 ) *be the RBF kernel with* d ≜ ||θ − θ ′||*, then* $$k^{\partial i\partial j}(\theta,\theta^{\prime})=k\left(\theta,\theta^{\prime}\right)\left(1-(\theta^{i}-\theta^{\prime i})^{2}\right)\left(1-(\theta^{j}-\theta^{\prime j})^{2}\right).$$ Proof. As shown in (Rasmussen & Williams, 2006) Section 9.4, the derivative of a Gaussian Process is also a Gaussian Process. Let GP(0, k (*θ, θ*′)) be the GP from which f is sampled. This implies: $$\frac{\partial f}{\partial\theta^{a}}\sim G P\left(0,\frac{\partial^{2}k\left(\theta,\theta^{\prime}\right)}{\partial\theta^{a}\partial\theta^{\prime a}}\right).$$ Applying this rule once more for the Hessian, we have: $$\frac{\partial^{2}f}{\partial\theta^{b}\theta^{a}}\sim G P\left(0,\frac{\partial^{4}k\left(\theta,\theta^{\prime}\right)}{\partial\theta^{b}\partial\theta^{\prime b}\partial\theta^{a}\partial\theta^{\prime a}}\right).$$ Given the above identities, we compute the partial derivatives for the RBF kernel: $$\frac{\partial^{2}k\left(\theta,\theta^{\prime}\right)}{\partial\theta^{a}\partial\theta^{\prime a}}=\exp\left(-\frac{||\theta-\theta^{\prime}||^{2}}{2}\right)\left(1-(\theta^{a}-\theta^{\prime a})^{2}\right).$$ Deriving once more we have: $$\frac{\partial^{4}k\left(\theta,\theta^{\prime}\right)}{\partial\theta^{b}\partial\theta^{b}\partial\theta^{a}\partial\theta^{\prime a}}=\exp\left(-\frac{||\theta-\theta^{\prime}||^{2}}{2}\right)\left(1-(\theta^{a}-\theta^{\prime a})^{2}\right)\left(1-(\theta^{b}-\theta^{\prime b})^{2}\right).$$ This completes the proof noting that k (*θ, θ*′) ≜ exp( −d 2 2 ) with d ≜ ||θ − θ ′||. Corollary 1. Let k (*θ, θ*′) ≜ exp( −d 2 2 ), and θ, θ′ ∈ [0, 1]D*, then* k ∂i∂j (*θ, θ*′) ≥ 0. Proof. The above is straightforward to see as exp (·) ≥ 0 and with *θ, θ*′ ∈ [0, 1]D we have 1 − (θ $$\theta^{a}-\theta^{r^{a}})^{2})\geq0$$ *Proof.* The above is str: $\bigg(1-(\theta^b-\theta^{rb})^2\bigg)\geq0$. Corollary 2. Let k (*θ, θ*′) ≜ exp( −d 2 2 ), and θ, θ′ ∈ [0, r] d*, then* k ∂i∂j (*θ, θ*′) ≥ c exp(−d 2) *for some constant* c dependent on r. Proof. The above is straightforward given the above Lemma. We note that although the RBF kernel may take on negative values in the domain Θ = [0, r] d, this values experience strong tail decay showing the quasi-satisfaction of our assumptions. The above Lemma and Corollary shows that our assumptions are satisfied by the RBF Kernel when Θ = [0, 1]D, and quasi satisfied when Θ = [0, r] D after choosing a suitable ph and σ 2 h . We show how these assumptions are quasi-satisfied by the Matern- 52 kernel. $$\square$$ $\square$ Lemma 2. Let k (*θ, θ*′) ≜ (1 + √5d + 5 3 d 2) exp(− √5d) *be the Matern-* 52 kernel with d ≜ ||θ − θ ′||*, then with* di ≜ θ i − θ ′i*we have* $$k^{\partial i\partial j}(\theta,\theta^{\prime})=\exp(-\sqrt{5}d)\left(\frac{5\sqrt{5}}{3}-\frac{25}{3d}d_{i}^{2}-\frac{25}{3d}d_{j}^{2}+\frac{25\sqrt{5}}{3d^{2}}d_{i}^{2}d_{j}^{2}+\frac{25}{3d^{3}}d_{i}^{3}d_{j}^{3}\right).$$ Proof. Following the proof of Lemma 1, we state the partial derivatives of the Matern- 52 kernel: $$\frac{\partial^{2}k\left(\theta,\theta^{\prime}\right)}{\partial\theta^{a}\partial\theta^{\prime a}}=\exp\left(-\sqrt{5}||\theta-\theta^{\prime}||\right)\left(\frac{5}{3}+\frac{5\sqrt{5}}{3}||\theta-\theta^{\prime}||-\frac{25}{3}(\theta^{a}-\theta^{\prime a})^{2}\right).$$ Differentiating one more we have $$\begin{array}{c}{{\frac{\partial^{4}k\left(\theta,\theta^{\prime}\right)}{\partial\theta^{b}\partial\theta^{a}\partial\theta^{\prime a}}=\exp\left(-\sqrt{5}||\theta-\theta^{\prime}||\right)}}\\ {{\left(\frac{5\sqrt{5}}{3}-\frac{25}{3d}(\theta^{a}-\theta^{\prime a})^{2}-\frac{25}{3d}(\theta^{b}-\theta^{\prime b})^{2}+\frac{25\sqrt{5}}{3d^{2}}(\theta^{a}-\theta^{\prime a})^{2}(\theta^{b}-\theta^{\prime b})^{2}\right)}}\\ {{\left.+\frac{25}{3d^{3}}(\theta^{a}-\theta^{\prime a})^{3}(\theta^{b}-\theta^{\prime b})^{3}\right).}}\end{array}$$ $$\square$$ $\square$ This completes the proof noting that di ≜ θ i − θ ′iand d ≜ ||θ − θ ′||. Corollary 3. Let k (*θ, θ*′) ≜ (1 + √5d + 5 3 d 2) exp(− √5d) and θ, θ′ ∈ [0, 1]D*. Then* k ∂i∂j (*θ, θ*′) ≥ exp(− √5d) 5 √5 3 − 25 3d − 25 3d − 25 3d3 . Proof. The above is an immediate consequence of Lemma 2 and noting that ||di*|| ≤* 1. Corollary 4. Let k (*θ, θ*′) ≜ (1 + √5d + 5 3 d 2) exp(− √5d) and θ, θ′ ∈ [0, r] d*. Then* k ∂i∂j (*θ, θ*′) ≥ c exp(−d) for some c *dependent on* r. Proof. The above is an immediate consequence of Lemma 2 and noting that ||di*|| ≤* r. Although the above corollary shows that the Matern- 52 kernel may take on negative values, we note that these values experience strong tail decay due to the presence of the exp − √5dterm. Thus, the negative values are likely to be extremely small, thus quasi-satisfying our assumptions. In our experiments, we observed no shortcoming in using the Matern- 52 kernel in dss-gp-ucb. $\square$ ## E Proof Of Proposition 1 We restate Proposition 1 for clarity. Proposition 1. Let Gd = (Vd, Ed) represent an additive dependency structure with respect to v(θ)*, then the* following holds true: ∀*a, b* ∂ 2v ∂θa∂θb ̸= 0 =⇒ (Θa, Θb) ∈ Ed which is a consequence of v formed through addition of independent sub-functions v (i)*, at least one of which must contain* θ a, θb *as parameters for* ∂ 2v ∂θa∂θb ̸= 0 which implies their connectivity within Ed. Proof. The above follows from the linearity of addition, which naturally implies a lack of curvature. In the multivariate case, this corresponds to zero or non-zero entries in the Hessian. To be precise, we prove the contrapositive: $$(\Theta^{a},\Theta^{b})\notin E_{d}\implies\frac{\partial^{2}v}{\partial\theta^{a}\partial\theta^{b}}=0.$$ Let *a, b* be arbitrary dimensions with (Θa, Θb) ∈/ Ed. As a consequence of the definition of the dependency graph, ∄Θ(i)s.t. {Θa, Θb} ⊆ Θ(i). That is, no subfunction v (i)takes both θ a and θ b as arguments. By the linearity of the partial derivative, we see that: $${\frac{\partial^{2}}{\partial\theta^{a}\partial\theta^{b}}}v(\theta)={\frac{\partial^{2}}{\partial\theta^{a}\partial\theta^{b}}}\sum_{i=1}^{M}v^{(i)}(\theta^{(i)})=\sum_{i=1}^{M}{\frac{\partial^{2}}{\partial\theta^{a}\partial\theta^{b}}}v^{(i)}(\theta^{(i)})=0$$ $\square$ where the last equality follows from no subfunction v (i)taking both θ a and θ b as arguments. ## F Proof Of Theorem 1 Our proof of Theorem 1 relies in being able to determine whether an edge does or does not exist in the dependency graph. To be able to do this, we examine the Hessian. As we have shown in Proposition 1, examining the Hessian answers this question. The challenge of Theorem 1 is detecting this dependency under noisy observations of the Hessian, as well as in domains where the variance of the second partial derivative is often zero, i.e., k ∂i∂j (*θ, θ*′) = 0 with high probability. To overcome this challenge, we sample the Hessian multiple times to both find portions of the domain where k ∂i∂j (*θ, θ*′) ≥ σ 2 h , and also reduce the effect of the noise on learning the dependency structure. To proceed with the analysis, we first prove a helper lemma showing that if we can construct two Normal variables of sufficiently different variances, then it's possible to accurately determine which Normal variable has low, and high variance by taking a singular sample from each. This helper lemma will be used later to help determine edges in the dependency graph. As we shall soon show, If an edge exists, we are able to construct a Normal variable with high variance. Correspondingly, if an edge does not exist, we are able to construct a Normal variable with low variance. Lemma 3. Let Xl ∼ N (0, σ2 l ) and Xh ∼ N (0, σ2h ) *be two random univariate gaussian variables. For* any δ ∈ (0, 1), ∃ ch s.t. |Xl| ≤ ch ≤ |Xh| with probability 1 − δ *when* σ 2 h σ 2 l >8 δ 2 log 2 δ and precisely when σhδ 2 > ch > σl q2 log 2 δ . Proof. First we note that |Xl| and |Xh| are Half-Normal random variables, with cumulative distribution function of Fl(x) = erf x σl √2 and Fh(x) = erf x σh √2 respectively. Thus to show that |Xl| ≤ σl q2 log 2 δ and |Xh| ≥ σhδ 2 with high probability, we utilize well known bounds on the erf and erfc function. The proofs of the below can be found in several places, e.g., Chu (1955) and Ermolova & Häggman (2004) respectively. $$\operatorname{erf}x\leq{\sqrt{1-\exp-2x^{2}}}\,;\,\,\operatorname{erfc}x\leq\exp-x^{2}.$$ σ 2 h σ 2 l > 8 δ 2 log 2 δ . Given the above, we show that p(ch ≤ |Xl|) ≤ δ 2 and p(ch ≥ |Xh|) ≤ δ 2 and utilizing the union bound completes the proof. ies the proof: $$c_h>\sigma_1\sqrt{2\log\frac{2}{\delta}}\implies c_h^2>2\sigma_l^2\log\frac{2}{\delta}\implies\frac{c_h^2}{2\sigma_l^2}>-\log\frac{\delta}{2}\implies-\frac{c_h^2}{2\sigma_l^2}<\log\frac{\delta}{2}$$ $$\implies\exp-\frac{c_h^2}{2\sigma_l^2}\leq\frac{\delta}{2}\implies\text{erfc}\frac{c_h}{\sqrt{2}\sigma_l}<\frac{\delta}{2}\implies1-\text{erf}\frac{c_h}{\sqrt{2}\sigma_l}\geq1-\frac{\delta}{2}\implies F_l(c_h)\geq1-\frac{\delta}{2}$$ $$\implies n\left(c_l\leq|X_l|\right)\leq\frac{\delta}{2}$$ $$\implies p\left(c_{h}\leq|X_{l}|\right)<{\frac{\delta}{2}}.$$ Following a similar line of reasoning we have: ch < σhδ 2=⇒ c 2 h σ 2 h < δ 2 4=⇒ −c 2 h σ 2 h > − δ 2 4=⇒ −c 2 h σ 2 h > log 1 − ϵ 2 4=⇒ exp − c 2 h σ 2 h > 1 − δ 2 4 =⇒ 1 − exp − c 2 h σ 2 h < δ 2 4=⇒ s 1 − exp − c 2 h σ 2 h < δ 2=⇒ erf ch σh √2 < δ 2=⇒ Fh(ch) < δ 2 =⇒ p(ch ≥ |Xh|) < δ 2 . Finally, to complete the proof, we show that the interval (σl q2 log 2 δ , σhδ 2 ) is not the empty set when $$\frac{\sigma_{h}^{2}}{\sigma_{l}^{2}}>\frac{8}{\delta^{2}}\log\frac{2}{\delta}\implies\frac{\sigma_{h}}{\sigma_{l}}>\frac{2\sqrt{2}}{\delta}\sqrt{\log\frac{2}{\delta}}\implies\frac{\sigma_{h}\delta}{2}>\sigma_{l}\sqrt{2\log\frac{2}{\delta}}.$$ $$\square$$ We are now ready to prove Theorem 1. Theorem 1. Suppose11 *there exists* σ 2 h , ph s.t. ∀*i, j* Pθ∼U(Θ) -k ∂i∂j (*θ, θ*) ≥ σ 2 h ≥ ph and ∀i, j, θ, θ′ k ∂i∂j (θ, θ′) ≥ 0. Then for any δ1, δ2 ∈ (0, 1) after t ≥ T0 steps of dss-gp-ucb (lines 1-4) *we have:* Ti,j P(Eei,j d = E i,j d ) ≥ 1 − δ1 − δ2 *when* T0 = C1 > 8D2 δ 2 1log 2D2 δ1 σ 2 n σ 2 h + D2 phδ2 , ch ≜ T0σn q2 log 2D2 δ1 . Proof. We prove the above for a single pair of variables, i.e., k ∂i∂j and utilize the union bound to complete the proof. The first challenge to overcome is to sufficiently sample enough points in the domain such that we are able to find enough points θ ∈ Θ where k ∂i∂j (*θ, θ*) ≥ σ 2 h . To achieve this we sample T0 different θ in the domain. After sampling T0 points if there exists an edge between Θa, and Θb, then with probability 1 − δ2 D2 we have sampled T0 − D2 phδ2 points where k ∂i∂j (*θ, θ*) ≥ σ 2 h . To show the above we use bounds on the cumulative distribution of the Binomial theorem. A well known bound is given T0 trials, with ph probability of success, the probability of having fewer than s successes is upper bounded as follows: $${\frac{p_{h}}{T_{0}-s}}.$$ Given the above, we use δ2 and derive: $$\frac{p_{h}}{T_{0}-(T_{0}-\frac{D^{2}}{p_{h}\delta_{2}})}\leq\frac{\delta_{2}}{D^{2}}.$$ Given the above, with at least (T0− D2 phδ2 ) points where k ∂i∂j (·, ·) ≥ σ 2 h , as well as our assumption k ∂i∂j (*θ, θ*) ≥ 0, we apply Bienaymé's identity which we restate for convenience: $$\mathrm{Var}\left[\sum_{\ell=1}^{C_{1}}h_{t,\ell}\right]=\sum_{\ell=1}^{C_{1}}\sum_{\ell^{\prime}=1}^{C_{1}}\mathrm{Cov}\left(h_{t,\ell},h_{t,\ell^{\prime}}\right).$$ Noting each of the (T0 − D2 phδ2 ) successes is sampled C1 = T0 times with Cov (ht,ℓ, ht,ℓ′ ) ≥ σ 2 h for each of the successes and Cov (ht,ℓ, ht,ℓ′ ) ≥ 0 for all samples by our assumption. Applying Bienaymé's identity and the sum of (correlated) Normal variables is also a normal variable, we have Var hPC1 t=1 PC1 ℓ=1 ht,ℓi≥ (T0− D2 pδ2 )T 2 0 σ 2 h . Compare this quantity with the variance if no edge exists between Θa, and Θb, where the variance results from i.i.d. noise: Var hPT0 t=1 PT0 ℓ=1 ht,ℓi= T 2 0 σ 2 n . Comparing these two quantities, with an appropriately picked ch determines the edge between Θa and Θb using Lemma 3. By Lemma 3, letting ch ≜ T0σn q2 log 2D2 δ1ensures that p(h i,j < ch) < δ1 D2 if edge E i,j dexists, and p(h i,j > ch) < δ1 D2 if edge E i,j ddoes not exist. Applying the union bound over D2 pairs of variables completes the proof with Ti,j P(Eei,j d = E i,j d ) ≥ 1 − δ1 − δ2. 11RBF kernel satisfies these assumptions when Θ = [0, 1]D. ## G Proof Of Theorem 2 Our proof of Theorem 2 is presented under the same setting and assumptions as the work of Srinivas et al. (2010). To prove Theorem 2, we rely on several helper lemmas. The high-level sketch of the proof is to use the properties of Erdős-Rényi graph to bound both the *size of the maximal clique* as well as *the number of* maximal cliques with high probability. Once these two quantities are bounded, we are able to analyze the mutual information of the kernel constructed by *summing the kernels corresponding to the maximal cliques* of the sampled Erdős-Rényi graph as indicated in Assumption 1. Finally, once this mutual information is bounded, we use similar analysis as Srinivas et al. (2010) to complete the regret bound. We begin by bounding the size of the maximal cliques. Lemma 4. Let Gd = (Vd, Ed) be sampled from a Erdős-Rényi model with probability pg: Gd ∼ G(D, pg)*, then* ∀δ ∈ (0, 1) the largest clique of Gd *is bounded above by* $$|M a x\mbox{-}C l i q u e({\mathcal G}_{d})|\leq2\log_{\frac{1}{p g}}|V_{d}|+2{\sqrt{\log_{\frac{1}{p g}}\frac{|V_{d}|}{\delta}+1}}$$ with probability at least 1 − δ. Proof. The above relies on well known upper bounds on the maximal clique size on a graph sampled from an Erdős-Rényi model. As shown in (Bollobás & Erdös, 1976) and (Matula, 1976) the expected number of Cliques of size k, E [Ck] is given by: $$\mathbb{E}\left[C_{k}\right]=\binom{|V_{d}|}{k}\frac{1}{p_{g}}^{-\binom{k}{2}}\leq|V_{d}|^{k}\frac{1}{p_{g}}^{-\frac{k(k-1)}{2}}=\frac{1}{p_{g}}^{\frac{k}{2}\left(2\log\frac{1}{p_{g}}\,|V_{d}|-k+1\right)}.$$ In the sequel, we omit the base of the log:1 pg for clarity. To bound the size of the maximal clique, we find a suitable k such that E [Ck] ≤ δ n and utilize the union bound over [Ci]i=*k,...,n* where we have |[Ci]i=k,...,n| ≤ n. Finally, we utilize Markov's inequality to complete the proof. Let $ k=2\log|V_d|+2\sqrt{\log\frac{|V_d|}{\delta}+1}$. We utilize the above bound on E [Ck]. $$\Longrightarrow\frac{k}{2}\left(2\log\frac{1}{p_{q}}\left|V_{d}\right|-k+1\right)=$$ $$\left(\log\!\left|V_{d}\right|+\sqrt{\log\frac{n}{\delta}}\right)\left(2\log\!\left|V_{d}\right|-2\log\!\left|V_{d}\right|-2\sqrt{\log\frac{n}{\delta}+1}+1\right)$$ $$\leq-\log\!\left|V_{d}\right|-\log\frac{n}{\delta}+1\leq\log\frac{\delta}{n}$$ $$\implies\mathbb{E}\left[C_{k}\right]\leq{\frac{1}{p_{g}}}^{\log{\frac{\delta}{n}}}={\frac{\delta}{n}}.$$ The proof is complete by noting that by Markov inequality, p(Ck ≥ 1) ≤ E [Ck] and taking the union bound over at most n members of [Ci]i=*k,...,n*. Next, we bound the total number of maximal cliques: Lemma 5. Let Gd = (Vd, Ed) be sampled from a Erdős-Rényi model with probability p: Gd ∼ G(D, pg)*, then* ∀δ ∈ (0, 1) the number of total maximal cliques in Gd *is bounded above by* $${\frac{1}{\delta}}{\sqrt{|V_{d}|^{\log_{\frac{1}{P g}}|V_{d}|+5}}}$$ with probability at least 1 − δ. Proof. We prove the above by bounding maxk Ck with high probability and noting that the number of maximal cliques is bounded by Pk Ck ≤ n maxk Ck with high probability. To bound max Ck, we first consider maxk E [Ck]. $$\operatorname*{max}_{k}\mathbb{E}\left[C_{k}\right]=\operatorname*{max}_{k}{\frac{1}{p_{g}}}^{\frac{k}{2}}{\binom{2\log{\frac{1}{p_{g}}}\left|V_{d}\right|-k+1}{p_{g}}}={\frac{1}{p_{g}}}^{\operatorname*{max}_{k}{\frac{k}{2}}{\binom{2\log{\frac{1}{p_{g}}}\left|V_{d}\right|-k+1}{p_{g}}}}.$$ Taking the partial derivative of k 2 2 log 1 pg |Vd| − k + 1with respect to k we determine the maximum: $$\arg\operatorname*{max}_{k}{\frac{k}{2}}\left(2\log{\frac{1}{p_{g}}}\left|V_{d}\right|-k+1\right)=\log{\frac{1}{p_{g}}}\left|V_{d}\right|+1.$$ Thus we are able to bound: $${\frac{\log_{\frac{1}{p_{2}}}|V_{d}|+1}{2}}\left(2\log_{\frac{1}{p_{2}}}|V_{d}|-\log_{\frac{1}{p_{2}}}|V_{d}|-1+1\right)=$$ $${\frac{\log_{\frac{1}{p_{2}}}|V_{d}|+1}{2}}\left(\log_{\frac{1}{p_{2}}}|V_{d}|\right)={\frac{1}{2}}\log_{\frac{1}{p_{2}}}^{2}|V_{d}|+{\frac{1}{2}}\log_{\frac{1}{p_{2}}}|V_{d}|+1.$$ Which yields the bound: $$\mathbb{E}\left[C_{k}\right]\leq{\frac{1}{p_{g}}}{\frac{{\frac{1}{2}}\log_{\frac{1}{p_{d}}}^{2}|V_{d}|+{\frac{1}{2}}\log{\frac{1}{p_{g}}}\,|V_{d}|}{p_{g}}}={\sqrt{|V_{d}|}}^{\log{\frac{1}{p_{g}}}\,|V_{d}|+1}.$$ To complete the proof, we utilize Markov's inequality with p $\left(\begin{matrix}C_k\geq\frac{|V_d|}{\delta}\sqrt{|V_d|^{\log\frac{1}{p_g}\,|V_d|+1}}\\ \end{matrix}\right)\leq\frac{\delta}{|\overline{V_d}|}$ an. and utilize the union bound over n choices of k: $$\sum_{k}C_{k}\leq\sum_{k}{\frac{|V_{d}|}{\delta}}{\sqrt{|V_{d}|^{\log{\frac{1}{p_{g}}}\,|V_{d}|+1}}}={\frac{1}{\delta}}{\sqrt{|V_{d}|^{\log{\frac{1}{p_{g}}}\,|V_{d}|+5}}}$$ with probability 1 − δ. Now that we have bounded both the number of cliques, as well as the sizes of the maximal cliques with high probability, we now consider the mutual information of the kernel constructed by summing the kernels corresponding to the maximal cliques of the dependency graph. Lemma 6. Define I(yA; v) ≜ H(yA) − H(yA | v) as the mutual information between yA and v with H(N (µ, Σ)) ≜12 log|2πeΣ| *as the entropy function. Define* γ k T ≥ maxA⊂Θ:|A|=T I(yA; v) *when* v ∼ GP(0, k (θ, θ′)). Let [ki]i=1,...,M be arbitrary kernels defined on the domain Θ *with upper bounds* on mutual information [γ ki T ]i=1,...,M*, then the following holds true:* $\square$ $$\gamma_{T}^{\sum_{i}k_{i}}\leq M^{2}\operatorname*{max}{[\gamma_{T}^{k_{i}}]}_{i=1,\ldots,M}.$$ To prove the above, we first state Weyl's inequality for convenience: Lemma 7. Let *H, P* ∈ R n×n be two Hermitian matrices and consider the matrix M = H + P*. Let* µi, νi, ρi, i = 1, . . . , n *be the eigenvalues of M, H, and P respectively in decreasing order. Then, for all* i ≥ r + s − 1 *we have* µi ≤ νr + ρs. The above has an immediate Corollary as noted by Rolland et al. (2018): Corollary 5. Let Ki ∈ R n×n *be Hermitian matrices for* i = 1, . . . , M with K ≜PM i Ki*. Let* [λ Ki ℓ]ℓ=1*,...,n* denote the eigenvalues of Ki in decreasing order. Then for all ℓ ∈ N0 *such that* ℓM + 1 ≤ n *we have* $$\lambda_{\ell M+1}^{K}\leq\sum_{i=1}^{M}\lambda_{\ell+1}^{K_{i}}.$$ We are now ready to prove Lemma 6 using Weyl's inequality and its corollary as a key tool. Proof. Given the definition of I(yA; v) ≜ 1 2 log|I + σ −2KkA| (Srinivas et al., 2010) we bound the eigenvalues of MI + σ −2 PM i Kki A using the eigenvalues of [I + σ −2Kki A ]i=1*,...,M* where k ≜PM i=1 ki. Using the above Corollary we see that: $$\lambda_{\ell}^{M\mathbf{I}+\sigma^{-2}K}\leq\sum_{i=1}^{M}\lambda_{\lceil{\frac{\ell}{M}}\rceil}^{I+\sigma^{-2}K_{i}}.$$ $\square$ Given the above, we see that M2 max[γ ki T ]i=1*,...,M* ≥12 log|I + σ −2KkA| as PM i M γki T ≥12 log|MI + σ −2 PM i Kki A |. Finally, we require an additional helper lemma to bound the supremum and infimum of a function sampled from a GP. This helper lemma helps bound the regret during the first phase of dss-gp-ucb where we randomly sample the Hessian over the domain. Lemma 8. Let k (θ, θ′) *be four times differentiable on the continuous domain* Θ ≜ [0, r] D *for some bounded* r (i.e., compact and convex) with f ∼ GP(0, k (θ, θ′)) then for all δ ∈ (0, 1) *the following holds true:* $$\operatorname*{sup}_{\theta\in[0,r]^{D}}f\leq c_{b}{\sqrt{D\log\delta^{-1}}}={\mathcal{O}}\left({\sqrt{D\log\delta^{-1}}}\right).$$ $$\operatorname*{inf}_{\theta\in[0,r]^{D}}f\geq-c_{b}{\sqrt{D\log\delta^{-1}}}=\Omega\left(-{\sqrt{D\log\delta^{-1}}}\right).$$ for some constant cb dependent on δ and r*, with probability* 1 − δ. Proof. We refer readers to Srinivas et al. (2010) Lemma 5.8 for the proof of the above. We are now ready to prove Theorem 2. Theorem 2. Let k *be the kernel as in Assumption 1, and Theorem 1. Let* γ k T (d) : N → R be a monotonically increasing upper bound function on the mutual information of kernel k taking d *arguments. The cumulative* regret of dss-gp-ucb *is bounded with high probability as follows:* $$R_{T}=\widetilde{\mathcal{O}}\Big(\sqrt{T\beta_{T}D^{\log D+5}\gamma_{T}^{k}(4\log D+c_{\gamma})}\Big)$$ $$\left(4\right)$$ (4) where cγ *is an appropriately picked constant and the base of the logarithm is* 1 pg . We restate the above theorem with more precision: Theorem 2. Let k be the kernel as in Assumption 1, and Theorem 1 and for some constants *a, b*, $P\left[\sup_{\theta\in\Theta}\left|\frac{\partial v}{\partial\theta_{i}}\right|>L\right]\leq ae^{-(L/b)^{2}},i=1,\ldots,D.$ Let γ k T (d) : N → R *be a monotonically increasing upper bound function on the* mutual information *of kernel* k taking d arguments. Let k (θ, θ′) be four times differentiable on the continuous domain Θ ≜ [0, r] dfor some bounded r (i.e., compact and convex). For any δ1, δ2, δ3, δ4, δ5, δ6 ∈ (0, 1). Let, t˜≜ t − T0C1 *and let* $$\beta_{t}=2\log(\vec{t}^{2}2\pi^{2}/3\delta_{6}^{2})+2D\log(\vec{t}^{2}D b r\sqrt{\log(4D a/\delta_{6})})$$ The cumulative regret of dss-gp-ucb *is bounded:* $$P\left[R_{T}\leq2C_{1}^{2}c_{6}\sqrt{D\log\delta_{5}^{-1}}+\sqrt{C_{2}T\beta_{T}\gamma_{T}}+2\ \ \ \forall T\geq1\right]\geq1-\delta_{1}-\delta_{2}-\delta_{3}-\delta_{4}-\delta_{5}-\delta_{6}$$ _when $C_{1}=\frac{8D^{2}}{2^{2}}\log\frac{2D^{2}}{b_{1}}\frac{\sigma_{0}^{2}}{\sigma_{0}^{2}}+\frac{D^{2}}{p_{2}\delta_{1}}+1$, $C_{2}=8/\log(1+\sigma^{-2})$, and $\gamma_{T}=\frac{1}{8\lambda}D^{\log_{1/p_{p}}D+\delta_{3}\lambda_{T}}\left(2\log_{1/p_{p}}D+2\sqrt{\log_{1/p_{p}}D/\delta_{3}+1}\right)$ where $c_{k}$ is some constant dependent on $\delta_{5}$._ Proof. The proof is a consequence of the helper lemmas and theorems we have proved. First we consider Phase 1 of dss-gp-ucb where t ≤ T0. By Theorem 1, at most T0C1 = C 2 1 queries will be made during Phase 1, and Lemma 8 indicates the maximum regret for any query. Consulting the respective Theorem and Lemma, we are able to bound the cumulative regret during Phase 1 by: $$2C_{1}^{2}c_{b}\sqrt{D\log\delta_{5}^{-1}}={\mathcal{O}}(D^{4.5}\log^{2}D).$$ Considering Phase 2, we utilize Lemma 4, Lemma 5, Lemma 6 to bound the mutual information of the sampled kernel with high probability. The number of cliques is given by: $${\frac{1}{\delta_{4}}}{\sqrt{D^{\log_{1/p_{g}}D+5}}}.$$ The size of the largest clique is given by: $$2\log_{1/p_{\theta}}D+2{\sqrt{\log_{1/p_{\theta}}D/\delta_{3}+1}}\leq2(\log_{1/p_{\theta}}D+\log_{1/p_{\theta}}D/\delta_{3}+1)\leq4\log_{1/p_{\theta}}D/\delta_{3}+2\log_{1/p_{\theta}}D/\delta_{3}+1$$ Following Lemma 6, we see that $$\gamma_{T}^{\sum_{i}k_{i}}\leq M^{2}\operatorname*{max}{[\gamma_{T}^{k_{i}}]_{i=1,\ldots,M}}\leq\frac{1}{\delta_{4}^{2}}D^{\log_{1/p_{g}}D+5}\gamma_{T}^{k}(4\log_{1/p_{g}}D/\delta_{3}+2).$$ Let cγ = 4 log 1 pg 1/δ3 + 2 which yields the following information on the mutual information: $$\gamma_{T}^{\sum_{i}k_{i}}\leq D^{\log_{1/p_{g}}D+5}\gamma_{T}^{k}(4\log_{1/p_{g}}D+c_{\gamma}).$$ The proof is complete by leveraging the connection between mutual information and cumulative regret as shown by Srinivas et al. (2010) where Oe is the same as O with the log factors suppressed. ## H On The Surrogate Hessian, Hπ In Section 4.5 we remarked that although we cannot observe Hv, we can observe a surrogate Hessian, Hπ which is related to Hv by the chain rule. We justify our choice here with showing how Hπ is an important sub-component of Hv (Skorski, 2019). Although the reasoning we give is in one dimension, an analogous argument can be made in arbitrary dimensions using the chain rule for vector-valued functions yielding the Hessian tensor (Magalhães, 2020). We have v : Θ → R is a function of the policy π and can be expressed as a composition of functions: $$v:\Theta\rightarrow\mathbb{R}={\hat{v}}\left(\pi\left(\theta\right)\right).$$ v : Θ → R = ˆv (π (θ)). (5) In the above we use π (θ) as shorthand for π (s α, a α; θ) with vˆ representing some unknown function. Using the definition of the Hessian we have: $$\mathbf{H}_{v}\triangleq\left[{\frac{\partial^{2}v}{\partial\theta^{a}\partial\theta^{b}}}\right]_{a,b=1,...,D}=\left[{\frac{\partial^{2}}{\partial\theta^{a}\partial\theta^{b}}}\ {\hat{v}}\left(\pi\left(\theta\right)\right)\right]_{a,b=1,...,D}$$ Where the above identity follows from the definition of v in Eq. 5. We can now apply chain rule to express: $$\frac{\partial^{2}}{\partial\theta^{a}\partial\theta^{b}}\ \hat{v}\left(\pi\left(\theta\right)\right)=\underbrace{\left[\mathbf{H}_{\mathrm{c}}(\pi(\theta))\frac{\partial\pi}{\partial\theta^{a}}(\theta)\right]}_{r(\theta)}\cdot\underbrace{\frac{\partial\pi}{\partial\theta^{b}}(\theta)}_{\mathbf{H}_{\mathrm{w}}(\theta)}+\underbrace{\frac{\partial^{2}\pi}{\partial\theta^{a}\partial\theta^{b}}(\theta)}_{g(\theta)}\cdot\underbrace{\nabla\hat{v}(\pi(\theta))}_{g(\theta)}\tag{6}$$ $\left(\frac{5}{9}\right)^{\frac{1}{3}}$ As we see in the above as a consequence of the chain rule, ∂ 2π ∂θa∂θb forms an important sub-component ∂ 2v ∂θa∂θb . Given the above, we can simplify the above in the following manner: $$\mathbf{H}_{v}=r+\mathbf{H}_{\pi}\circ g$$ where *r, g*, and Hπ arise from the corresponding highlighted terms in Eq. 6 with r representing some unknown remainder term and ◦ representing the Hadamard product. Given the above, it is straightforward to see how Hπ serves as a surrogate Hessian for Hv. Indeed if r ̸= −Hπ ◦ g and g has no zero entries then Hπ ̸= 0 =⇒ Hv = 0 ̸ . In our use case, we are most concerned with non-zero entries in the Hessian, Hv, and the surrogate Hessian, Hπ is well served for determining Hv ̸= 0 due to the above. Since π (θ) is shorthand for π (s α, a α; θ), to approximate Hπ we average Hπ(sα,aα;θ) over state action pairs, (s α, a α) formed through interaction of the policy with the unknown task environment. A possible avenue of overcoming this limitation is considering Hessian estimation through zero'th order queries. Several works along this direction have recently appeared using Finite Differences (Cheng et al., 2021), as well as Gaussian Processes (Müller et al., 2021). We consider removing this dependency on the surrogate Hessian for future work. ## I Drone Delivery Task Our drone delivery task was inspired by recent research work in studying unique problems in drone delivery vehicle routing problems (Dorling et al., 2017). Drones fly from delivery point to delivery point where completing a delivery gives a large amount of reward, but running out of fuel and collisions give a small amount of negative reward. After completing a delivery, the delivery point is randomly removed within the environment. A collision gives a small amount of negative reward and momentarily stops the drone. Completing a delivery refills the drone fuel and allows it to continue to make more deliveries. The amount of reward given increases quadratically with the distance of the delivery to highly reward long distance deliveries which require long term planning. To compound this requirement for long term planning, fuel consumption also dramatically increases at high velocities to encourage long-term fuel efficiency planning. In this complex scenario requiring long term planning, rl approaches can easily fall into local minima of completing short distance, low reward deliveries and fail to sufficiently explore (under sparse reward) policies which complete long distance deliveries with careful planning. Implementation code of this task can be found in supplementary materials. ![39_image_0.png](39_image_0.png) Figure 10: Comparison with marl approaches with varying number of agents. ## J Replot With Timesteps We replot the relevant figures in Fig. 12 and Fig. 13 while maintaining total environment interactions as the singular independent variable. We note that there is no significant change to our conclusions as a consequence of this replotting. We also highlight that although total environment interactions is considered the important independent variable in rl and marl, in bo typically the total evaluated policies is considered the more important independent variable as each evaluation is assumed to be costly. ![40_image_0.png](40_image_0.png) Figure 11: Comparison with marl approaches on the drone delivery task. ## K Replot With "Best Found Policy So Far" In Rl We replot the relevant figures in Fig. 12 and Fig. 13 where both bo and marl approaches show the value of the "best found policy so far." We note that there is no significant change to our conclusions as a consequence of this replotting. ![41_image_0.png](41_image_0.png) ![41_image_1.png](41_image_1.png) Figure 13: Comparison with marl approaches on the drone delivery task. ## L Tables With "Best Found Policy So Far" In Rl We generate new tables investigating rl and marl under sparse or malformed reward. In Table 7 and 8 we show the value of the best found policy during the training process for rl and marl. Our observations and conclusions remain the same where rl and marl performance severely degrades under sparse and malformed reward and is often outperformed by our dss-gp-ucb approach. ![43_image_0.png](43_image_0.png) ![43_image_1.png](43_image_1.png)
Review 1: Summary: The authors utilize Bayesian optimization (BO) for high-dimensional multi-agent policy search (MAPS), as gradient-based methods can suffer from excessive computational requirements and sparse rewards, as well as the existence of local maxima. The authors mitigate the computational complexity of such an undertaking by relying on the abstractions of "role" and "role interaction"; they also assume an additive structure for the reward function, the exact structure of which they estimate using a surrogate for the parameters' Hessian. Strengths and Weaknesses: ### Strengths - The authors tackle an important problem that is likely to become more important as increased automation requires more lightweight and efficient solutions for MAPS. - The authors present a promising solution that addresses the problems they associate with alternative methods. They provide empirical results as well as theoretical findings that support the usefulness of their method. ### Weaknesses - The authors' method assumes the existence of a small number of roles that cover the roles of the agents. Further discussion into when this assumption is reasonable and when it is not is important to have in the main text. Their experiments indeed show that for some tasks it might be preferable to not have this component. The maximum number of agents they include in their experiments is 15, one would expect their method to be relevant in scenarios where num. roles << num. agents. - A similar assumption is made for the value function. A better justification for this decision in realistic MAPS problems should be provided, and the resulting behavior when this assumption does not hold should be discussed. - Hyperparameter selection for the two central assumptions described above is not described in detail. More guidance regarding the choice of number of roles and number of additive components should be provided. Requested Changes: - Addressing the weaknesses mentioned above would strengthen the authors' arguments and exposition. - The introduction is hard to follow and it takes a while to figure out the authors' contributions. E.g. the connection between the paragraph starting with "To optimize the HOM..." and the previous paragraph is not immediately clear. Figure 1 is not very helpful without the relevant context. I think a slightly longer introduction that includes a mathematical overview of the authors' method would be more helpful (Table 1 can be moved to Appendix), but I am happy with this structure as well if it does a better job of onboarding the reader. - The concept of belief $\nu$ is not introduced. - The letter $r$ is used to denote both the reward function and role. - How are the cutoff constant $c_h$ determined? - Please explicitly introduce that "Med" in "Med - RA - RI" refers to medium size. Broader Impact Concerns: In my estimation the present work does not require a broader impact statement. ================================================== Review 2: Summary: This paper presents DSS-GP-UCB, a role-based hierarchical Bayesian optimization (BO) method for cooperative multi-agent tasks. The authors introduce a role assignment and interaction model using role affinities and a graphical model, and a learning process for learning an additive decomposition of the observation dimensions. The authors state a regret bound, noting an improvement in the asymptotic complexity w.r.t. the number of dimensions. They also include experimental results on a few open multiagent environments and a synthetic drone delivery environment, comparing DSS-GP-UCB to a number of existing Bayesian Optimization and RL algorithms. Strengths and Weaknesses: Strengths The paper presents a BO setup and method with an improved regret bound. The experiments demonstrate that BO can be competitive with (or even better than) RL on at least some non-trivial environments. Weaknesses I understand there’s a lot of background information, and BO is not my general area of expertise, but I found the paper hard to follow. On the positive side, the authors do present examples and diagrams giving an overview in the spots where I would expect to see this, but the text / diagrams are following different conventions than I would expect or are assuming knowledge I don’t have. For one concrete example, Figure 2 has state, Algorithm 2, and theta_r feeding into GEN to produce s^alpha(i). This, Alg 2, and theta_g are then feeding into GEN to produce pi. My immediate expectation from that diagram is that GEN is the same. At first impression, it’s also not clear what it means for Alg 1 to be an input of GEN. The text talks about a two stage process with an algorithm for the lower layer, so seeing a diagram with an algorithm as an input is not unexpected, even though it is in fact just the fixed step taken to generate the permutation. The diagram I would have expected to see is maybe something like ``` (s^1, …) theta_r \ / Role Assignment | (s^alpha(1), …) / \ Role Interaction | | | Graph N theta_g | \ | / MPNN | pi ``` with the whole process being labeled as GEN. At the point in 4.1 where Figure 2 is included, the choice to have “role” be entirely synonymous with permutation has not yet been introduced. Given an expectation of everyday use where we might expect to have a many to one mapping from index to some set of roles, having a permutation (s^alpha(1),...) is unexpected. I found much of the explanation to have a similar problem: unexpected way of describing things, using things before describing them, or incomplete description – again noting that some of that incomplete description might just be assumed knowledge for someone more familiar with BO. Requested Changes: Appendices don’t seem to be included. Introduction: “This restriction requires the usage of large gradient-friendly policy representations”. Do the authors have a specific sense of large they mean here, and an argument to support that? Otherwise, I’m not sure it requires large representations: I think it would be reasonable to say many RL algorithms -do- use larger NN to get empirically stronger performance, but not that they require large models. Smaller models – either small NN or linear weights on something like tile coding – can also have surprisingly competitive performance on some non-trivial problems. “... and informative reward feedback from the environment.” This should be expanded to be more clear: without more context, observing the rewards for the trajectory an agent takes seems like a reasonably low requirement. Section 4.3: “the number of interactions scales quadratically due to considering interactions between all pairs of agents.” Isn’t pairwise interaction already a generalization, as interactions are possible between all agents? E.g., something doesn’t happen unless three (or more) agents coordinate on a decision. “To generate graphical models of the above form, our HOM uses edge affinity functions… Edge affinity functions Lambda…” Provide a (short description) of how: this is part of the contribution of this work, don’t just point at the algorithm. Section 4.4: “Specifically Theta defeq Theta^1 x … x Theta^D for some dimensionality D, and Theta(i) … is of low dimensionality.” This definition seems to be general and allows for decomposition into multi-dimensional spaces. For the subsequent theory and bounds, are each of Theta^i assumed to be 1-dimensional spaces? Section 4.5: “We utilize the surrogate Hessian in our work” Given the introductory motivation noting a limitation of MARL methods being they require gradient-friendly policy representations, it seems odd to see the proposed alternative computing any sort of Hessian. Section 5: “interactions with the environment in l” what is l? Section 5.1: References for Multiagent Ant, PredPrey, and Mujoco What exactly are the ablated agents? E.g., what does it mean to consider role interaction without role assignment? Figure 4: label doesn’t seem to match. There are left, middle, and right, and all seem to be comparisons. Left plot is unlabeled. Middle plot is largely obscured by the labels. What exactly is Sm compared to Med? Section 5.2: What exactly is DSS-GP-UCB (CTDE)? Section 5.3, Table 2: What is the setup? How long are agents trained? What does running DSS-GP-UCB mean if there are no rewards received on some steps? Given there is only a single line in Table 2 for DSS-GP-UCB, the authors are presumably saying there is absolutely no difference whatsoever between receiving rewards every step, or every 200 steps. How is this possible? Figure 6: What are the axes? Broader Impact Concerns: n/a ================================================== Review 3: Summary: This paper introduces Dependency Structure Search Bayesian Optimization (DSS-GP-UCB), a novel method that efficiently optimizes multi-agent decision-making models by leveraging role-based abstractions. This approach addresses the scalability issues in high-dimensional settings, making the optimization process more tractable and effective. Their method demonstrates strong empirical performance, particularly in environments with malformed or sparse rewards, and provides an improved regret bound under reasonable assumptions. Strengths and Weaknesses: **Strengths:** The content of this paper is substantial, and its structure is clear. The proposed DSS-GP-UCB method addresses the scalability issue in high-dimensional settings of complex decision-making models, which is a significant challenge for traditional Bayesian Optimization approaches. Moreover, the experiments presented in this paper are also comprehensive. **Weaknesses:** There are some confusing aspects in this paper, primarily in the algorithm description and theoretical guarantees. Regarding the algorithm description, Algorithm 4 is not described in sufficient detail, making it unfriendly to those unfamiliar with the GP-UCB algorithm. As for the theoretical guarantees, the use of O-notation twice in Theorem 2 is quite unusual. Requested Changes: * The formatting of Algorithms 1-4 needs to be revised, and additional descriptions should be provided for these algorithms. * In the experimental results, the legend in Figure 4 should not obscure the Sparse reward curve. Broader Impact Concerns: N/A ==================================================
# Read Between The Layers: Leveraging Multi-Layer Representations For Rehearsal-Free Continual Learning With Pretrained Models Kyra Ahrens∗kyra.ahrens@uni-hamburg.de University of Hamburg Hans Hergen Lehmann∗hergen.lehmann@studium.uni-hamburg.de University of Hamburg Jae Hee Lee jae.hee.lee@uni-hamburg.de University of Hamburg Stefan Wermter stefan.wermter@uni-hamburg.de University of Hamburg Reviewed on OpenReview: *https: // openreview. net/ forum? id= ZTcxp9xYr2* ## Abstract We address the Continual Learning (CL) problem, wherein a model must learn a sequence of tasks from non-stationary distributions while preserving prior knowledge upon encountering new experiences. With the advancement of foundation models, CL research has pivoted from the initial learning-from-scratch paradigm towards utilizing generic features from large-scale pre-training. However, existing approaches to CL with pre-trained models primarily focus on separating class-specific features from the final representation layer and neglect the potential of intermediate representations to capture low- and mid-level features, which are more invariant to domain shifts. In this work, we propose LayUP, a new prototype-based approach to CL that leverages second-order feature statistics from multiple intermediate layers of a pre-trained network. Our method is conceptually simple, does not require access to prior data, and works out of the box with any foundation model. LayUP surpasses the state of the art in four of the seven class-incremental learning benchmarks, all three domain-incremental learning benchmarks and in six of the seven online continual learning benchmarks, while significantly reducing memory and computational requirements compared to existing baselines. Our results demonstrate that fully exhausting the representational capacities of pre-trained models in CL goes well beyond their final embeddings. ## 1 Introduction Continual Learning (CL) is a subfield of machine learning dedicated to developing models capable of learning from a stream of data while striking the balance between adapting to new concepts and retaining previously acquired knowledge without forgetting (Parisi et al., 2019; Chen & Liu, 2018). While traditional works on CL primarily focus on the learning-from-scratch paradigm, the introduction of large foundation models has initiated a growing interest in developing CL methods upon the powerful representations resulting from large-scale pre-training. Continual learning with pre-trained models builds on the assumption that a large all-purpose feature extractor provides strong knowledge transfer capabilities and great robustness to catastrophic forgetting (McCloskey & Cohen, 1989) during incremental adaptation to downstream tasks. *Equal contribution. ![1_image_0.png](1_image_0.png) Figure 1: **Overview of LayUP.** Prior works on CL with pre-trained models use only final representation layer features for classification. LayUP enhances the last layer representations of pre-trained models by incorporating features from intermediate layers, resulting in more accurately calibrated similarity measures for prototype-based classification and greater robustness to domain gaps in the CL setting. Stars (⋆) denote class prototypes. Recent approaches to CL with pre-trained models primarily adopt three main strategies (Wang et al., 2024; McDonnell et al., 2023): (i) carefully fine-tuning the parameters of the pre-trained model (full body adaptation), (ii) keeping the pre-trained parameters fixed while learning a small set of additional parameters such as prompts (Lester et al., 2021; Liu et al., 2023; Jia et al., 2022), adapters (Rebuffi et al., 2017a; Houlsby et al., 2019; Hu et al., 2022; Chen et al., 2022; 2023), or others (Ke et al., 2021; Marullo et al., 2023; Lian et al., 2022), or (iii) extracting class prototypes from pre-trained representations without further fine-tuning. All three strategies share the beneficial property of not relying on rehearsal from past data to perform well, unlike many of the top-performing CL strategies used for models trained from scratch. The optimal strategy for balancing the trade-offs between effectively utilizing pre-trained features, ensuring resource efficiency, and maintaining robustness to domain shifts in CL settings remains an open question. Full body adaptation, as done with strategy (i), is expensive with respect to computational resources and required training data. Parameter-Efficient Transfer Learning (PETL), as implemented in strategy (ii), updates a fully connected classification head (*linear probe*) via iterative gradient methods during training and inference, which is subject to task-recency bias (Mai et al., 2021; Rymarczyk et al., 2023; Wang et al., 2023) and catastrophic forgetting (Zhang et al., 2023; Ramasesh et al., 2021). Class-prototype methods (Zhou et al., 2023b; Janson et al., 2022; McDonnell et al., 2023) that follow strategy (iii), in contrast, offer a promising alternative, as they utilize extracted features directly, making them more resource-efficient than full body adaptation and demonstrating greater robustness compared to PETL methods applied to the trainable linear probe. Despite their effectiveness, contemporary class-prototype methods for CL extract only the features obtained from the last layer of the backbone for prototype construction. However, as the discrepancy between the pre-training and fine-tuning domains widens, the high-level features from the last layer may not generalize sufficiently to ensure adequate class separability in the target domain. Thus, the challenge lies in developing a prototype-based classifier that utilizes the representations of a pre-trained feature extractor in a holistic manner, ideally with low memory and computational costs. In this work, we hypothesize that representations are most effectively leveraged from multiple layers to construct a classifier based on first-order (class prototypes) and second-order (Gram matrix) feature statistics. Such a strategy is inspired by works on Neural Style Transfer (Gatys et al., 2016; Jing et al., 2020), which involve applying the artistic style of one image to the content of another image, a problem that can be viewed through the lens of domain adaptation (Li et al., 2017). To achieve neural style transfer, a model has to disentangle image information into content and style (e.g., textures, patterns, colors). While content information is expressed in terms of activations of features at different layers (which translates to calculating multi-layer class prototypes in our case), style information is expressed as correlations between features of different layers (which corresponds to calculating multi-layer Gram matrices). fi fi fl fl We thus propose Multi-Layer Universal Prototypes (**LayUP**), a class-prototype method for CL that is based on the aforementioned strategy to disentangle style and content information of images at multiple layers of a pre-trained network. An overview of our method is given in Fig. 1. LayUP obtains rich and fine-grained information about images to perform a more informed classification that is less sensitive to domain shifts. We additionally experiment with different parameter-efficient fine-tuning strategies to further refine the intermediate representations obtained by LayUP. Across various CL benchmarks and learning settings, our method enhances performance and narrows the gap to the upper bound by as much as 80% (Stanford Cars-196 in the CIL setting, cf. Sec. 5.2) compared to the next best baseline, while also reducing its memory and compute requirements by 81% and up to 90% (cf. Sec. 4.3), respectively. Beyond that, our method can serve as a versatile plug-in to enhance existing class-prototype methods, consistently yielding an absolute performance gain of up to 31.1% (cf. Sec. 5.7). Our contributions are threefold: (1) We present and examine in detail the CL strategy with pre-trained models and show why it benefits from extracting intermediate representations directly for classification. We further demonstrate the advantages of leveraging cross-correlations of features within and between multiple layers to decorrelate class prototypes. (2) Building on our insights, we propose LayUP, a novel class-prototype approach to CL that leverages second-order statistics of features from multiple layers of a pre-trained model. Inspired by prior works (Zhou et al., 2023a; McDonnell et al., 2023), we experiment with different methods for parameter-efficient model tuning and extend our method towards first session adaptation. Our final approach is not only conceptually simple, but also benefits from low memory and computational requirements, and integrates seamlessly with any pre-trained model. (3) We report performance improvements with a pre-trained ViT-B/16 (Dosovitskiy et al., 2021) backbone on the majority of benchmarks the Class-Incremental Learning (CIL) and Domain-Incremental Learning (DIL) settings (Van De Ven et al., 2022) as well as in the challenging Online Continual Learning (OCL) setting. We show that LayUP is especially effective under large distributional shifts and in the low-data regime. Our results highlight the importance of taking a deeper look at the intermediate layers of pre-trained models to better leverage their powerful representations, thus identifying promising directions for CL in the era of large foundation models. The source code is available at https://github.com/ky-ah/LayUP. ## 2 Related Work 2.1 Continual Learning Traditional approaches to CL consider training a model from scratch on a sequence of tasks, while striking a balance between adapting to the currently seen task and maintaining high performance on previous tasks. They can be broadly categorized into the paradigms of *regularization* (Kirkpatrick et al., 2017; Zenke et al., 2017; Li & Hoiem, 2018; Aljundi et al., 2018; Dhar et al., 2019), which selectively restricts parameter updates, (pseudo-)rehearsal (Rebuffi et al., 2017b; Chaudhry et al., 2019; Buzzega et al., 2020; Prabhu et al., 2020), which recovers data either from a memory buffer or from a generative model, and *dynamic architectures* (Rusu et al., 2016; Yoon et al., 2018; Serra et al., 2018), which allocate fully or partially disjoint parameter spaces for each task. ## 2.2 Continual Learning With Pre-Trained Models Leveraging the powerful representations from large foundation models for downstream continual learning has shown to not only facilitate knowledge transfer, but also to increase robustness against forgetting (Ramasesh et al., 2022; Ostapenko et al., 2022). L2P (Wang et al., 2022c) and DualPrompt (Wang et al., 2022b) outperform traditional CL baselines by training a pool of learnable parameters (i.e., prompts), which serve as queries to guide a Vision Transformer (ViT) (Dosovitskiy et al., 2021) towards adapting to downstream tasks. These approaches provide the foundation for numerous more recent prompt learning methods, such as S-Prompt (Wang et al., 2022a), DAP (Jung et al., 2023), and CODA-Prompt (Smith et al., 2023a), which further enhance performance. Contrary to prompt learning methods that keep the backbone parameters fixed while updating a small set of additional parameters, some parallel works explore methods for making careful adjustments to the backbone parameters. SLCA (Zhang et al., 2023) uses a small learning rate for updates to the ViT backbone while training a linear probing layer with a larger learning rate. L2 (Smith et al., 2023b) applies regularization to the self-attention parameters of a ViT during continual fine-tuning. First Session Adaptation (FSA) (Panos et al., 2023) makes adjustments to the parameters of the backbone only during first task training to bridge the gap between pre-training and downstream CL domains. As an alternative to the methods above that adjust the feature space via cross-entropy loss and backpropagation, constructing prototypes directly from the pre-trained features emerges as a cost-efficient alternative to overcome forgetting during CL. Janson et al. (2022) and Zhou et al. (2023b) find that a conceptually simple Nearest Mean Classifier (NMC) outperforms various prompt learning methods. ADAM (Zhou et al., 2023b) combines NMC with FSA and concatenates the features from the initial pre-trained ViT and the adapted parameters. Other methods leverage second-order feature statistics, i.e., covariance information, for class prototype accumulation: FSA+LDA (Panos et al., 2023) applies an incremental version of linear discriminant analysis to a pre-trained ResNet encoder (He et al., 2016). RanPAC (McDonnell et al., 2023) uses high-dimensional random feature projections to decorrelate class prototypes of a pre-trained ViT backbone. All the aforementioned approaches have in common that they consider only the last layer representations (or, features) for classification. We provide a different perspective to the prototype-based approach to CL and show that intermediate representations can add valuable information to the linear transformation of class prototypes (cf. Eq. (6)), which leads to better class separability and increased robustness to large distributional shifts. ## 3 Preliminaries 3.1 Continual Learning Problem Formulation We consider a feature extractor ϕ(·) composed of L consecutive layers and a sequence of training datasets D = {D1*, . . . ,* DT }, where the t th task Dt = {(xt,n, yt,n)} Nt n=1 contains pairs of input samples xt,n ∈ Xt and their ground-truth labels yt,n ∈ Yt. The total number of classes observed in D (i.e., the number of unique elements in Y) is denoted with C. Given an arbitrary input sample x ∈ X , the dl-dimensional encoded features from the l th layer of model ϕ(·) are represented as ϕl(x) ∈ R dl. Thus, the features from the last (or representation) layer of the model are given by ϕL(x) ∈ R dL . Our focus in this work is rehearsal-free CL, where historical data cannot be fetched for replay. In the Class-Incremental Learning (CIL) setting, label spaces are partially disjoint between tasks. Conversely, in the Domain-Incremental Learning (DIL) setting, label spaces are kept across tasks, but samples within a label space are subject to distributional shifts. *Online Continual Learning* (OCL) is a more stringent definition of the aforementioned settings, where each datum in the stream of tasks is observed only once. All three CL settings prohibit the model from accessing task identifiers during testing; notably, our method does not require access to task-specific information during training either. ## 3.2 Class-Prototype Methods For Cl With Pre-Trained Models To leverage the powerful representations from large-scale pre-training while overcoming the limitations of full body adaptation and linear probing (cf. Sec. 1), *class-prototype* methods extract and accumulate features from the last layer of a pre-trained model to construct representatives for each class. The most straightforward class-prototype method is the Nearest Mean Classifier (NMC), which aggregates for each class y ∈ Y training sample features via averaging to obtain class prototype cy: $${\overline{{c}}}_{y}={\frac{1}{K}}\sum_{t=1}^{T}\sum_{n=1}^{N_{t}}\mathbb{I}(y=y_{t,n})\phi_{L}(x_{t,n}),$$ 1(y = yt,n)ϕL(xt,n), (1) with 1(·) denoting the indicator function and K =PT t=1 $$\stackrel{\mathrm{T}}{=1}\sum_{n=1}^{N_{t}}\mathbb{1}\,(y=y_{t,n}).$$ During inference, NMC selects for each test sample's feature vector the class with the smallest Euclidean distance (Janson et al., 2022) or highest cosine similarity (Zhou et al., 2023b) with its class prototype. $$(1)$$ ![4_image_0.png](4_image_0.png) Figure 2: **Classification performance of intermediate layers.** Comparison for two different pre-training paradigms of a ViT-B/16 (Dosovitskiy et al., 2021) backbone and split ImageNet-R (*left*) and CIFAR-100 (*right*) datasets. For each intermediate layer l ∈ {1*, . . . , L* − 1} (where L = 12 denotes the final representation layer), the bars represent the percentage of classes for which a classifier, utilizing Eq. (3) at layer l, surpasses the accuracy of the classifier at the L th layer. Considering the cosine similarity measure and some x ∈ Dtest, the predicted class label is obtained by: $$\hat{y}=\operatorname*{arg\,max}_{y\in\{1,\ldots,C\}}s_{y},\quad s_{y}:=\frac{\phi_{L}(\mathbf{x})^{T}\ \overline{{{\mathbf{c}}}}_{y}}{\|\phi_{L}(\mathbf{x})\|\cdot\|\overline{{{\mathbf{c}}}}_{y}\|},$$ $$\mathbf{\partial}\mathbf{\partial}(t)$$ where ∥·∥ denotes the L 2-norm. However, it was found that the assumption of an isotropic covariance of features (i.e., features are mutually uncorrelated) that is made under Eq. (2) does not hold for pretrained models. To account for correlations between features as a means to better "calibrate" similarity measures, class-prototype methods that leverage second-order statistics are proposed (Panos et al., 2023; McDonnell et al., 2023). One such method is based on the closed-form ordinary least square solution to ridge regression (Murphy, 2012), which is very effective in decorrelating class prototypes in CL (McDonnell et al., 2023). It takes Gram matrix G and class prototypes (or, regressands) cy that are aggregated via summation (instead of averaging to obtain cy, cf. Eq. (1) with 1K omitted) to yield: $$\hat{y}=\operatorname*{arg\,max}_{y\in\{1,\ldots,C\}}s_{y},\quad s_{y}:=\phi_{L}(\mathbf{x})^{T}\ (\mathbf{G}+\lambda\mathbf{I})^{-1}\ \mathbf{c}_{y}\tag{1}$$ for a regression parameter λ ≥ 0, dL-dimensional identity matrix I, and G expressed as summation over outer products as $$\mathbf{G}=\sum_{t=1}^{T}\sum_{n=1}^{N_{t}}\phi_{L}(\mathbf{x}_{t,n})\otimes\phi_{L}(\mathbf{x}_{t,n})$$ $$\left({\boldsymbol{3}}\right)$$ $$\left(4\right)$$ Although Eq. (2) and Eq. (3) are defined with respect to the maximum number of classes C after observing all T tasks, they can be applied after seeing any task t ≤ T or any sample n ≤ Nt. When denoting the extracted features of some input datum xt,n ∈ Dt as ft,n = ϕL(xt,n) and considering F ∈ R N×dL as concatenated row-vector features ft,n of all N training samples, Eq. (4) is reduced to G = F TF, which corresponds to the original definition of a Gram matrix as used in the closed-form ridge estimator (Hoerl & Kennard, 1970). ## 4 Layup 4.1 Class Prototyping From Second-Order Intermediate Features We argue that a combination of (i) enriching the last layer representations with hierarchical multi-layer features and (ii) decorrelating multi-layer features—which represent image properties such as content and style—via Gram matrix transformation increases robustness to domain shifts and thus improves generalizability to ![5_image_0.png](5_image_0.png) Figure 3: **Comparison of techniques to integrate intermediate representations.** LayUP implementations for different values of k using a shared representation and Gram matrix as in Eq. (6) versus averaging over separate ridge (or, Gram) classifiers for each layer using Eq. (3). Results are reported as average accuracy scores over CL training on split ImageNet-R (*left*) and CIFAR-100 (*right*) datasets following phase B of Alg. 1. downstream continual tasks. To this end, we propose to integrate embeddings from multiple layers via concatenation into a ridge regression estimator as defined in Eq. (3). Let $\Phi_{-k}$:$(\mathbf{a})=(\phi_{L-k+1}(\mathbf{a}),\ldots,\phi_{L-1}(\mathbf{a}),\phi_{L}(\mathbf{a}))$ Φ−k:(x) = (ϕL−k+1(x), . . . , ϕL−1(x), ϕL(x)) (5) denote the concatenated input features of some input sample x ∈ Dtest, extracted from the last k layers of the pre-trained model ϕ(·). Such features can be, e.g., classification token embeddings ([CLS]) of a transformer (Vaswani et al., 2017) encoder or flattened feature maps of a ResNet (He et al., 2016) encoder. This yields a modified estimator $$s_{y}:=\Phi_{-k}(\mathbf{x})^{T}\;\left(\mathbf{G}+\lambda\mathbf{I}\right)^{-1}\;\mathbf{c}_{y}$$ −1cy (6) with d(k) = (dL−k+1 + *· · ·* + dL−1 + dL)-dimensional identity matrix I and $$\mathbf{G}=\sum_{t=1}^{T}\sum_{n=1}^{N_{t}}\Phi_{-k:}(\mathbf{x}_{t,n})\otimes\Phi_{-k:}(\mathbf{x}_{t,n})$$ $\left(5\right)$ . $$({\mathfrak{h}})$$ $$\left(7\right)$$ Φ−k:(xt,n) ⊗ Φ−k:(xt,n) (7) We first motivate our approach by showing that intermediate representations capture expressive class statistics for prototype-based classification. For the split CIFAR-100 (Krizhevsky, 2009) and ImageNet-R (Hendrycks et al., 2021a) datasets and two ViT models, we construct one prototype-based classifier using Eq. (3) per layer l ∈ {1*, . . . , L* − 1} and measure the percentage of classes that layer l predicts better than the last layer L (L = 12 for ViT-B/16). The results are provided in Fig. 2. Across both datasets, the classifiers from the last five intermediate layers outperform the representation layer classifier in up to 32% of the classes. The advantage of multi-layer classifiers is more pronounced in the ViT model pre-trained on 21 000 different ImageNet classes and additionally fine-tuned on 1 000 different ImageNet classes (IN1K) compared to the ViT model only pre-trained on 21 000 different ImageNet classes (IN21K). The results indicate that representations derived from intermediate layers generally provide meaningful knowledge to more effectively distinguish classes at various hierarchical levels. There are two intuitive ways to integrate intermediate representations into the class-prototype classifier: Averaging over k separate classifiers per Eq. (3) or concatenating representations from the last k layers to obtain shared class prototypes per Eq. (6). Fig. 3 shows average accuracies for two split datasets and different values of k. For each k, transforming shared class-specific information via Gram matrix inversion, as described in Eq. (6), proves to be superior to averaging across separate classifiers. This finding indicates that the correlations across layers, captured in the shared Gram matrix (cf. Eq. (7)), add meaningful information to enhance class separability. While performance generally benefits from higher values of k, the difference in performance between k = 4 and k = 6 is more pronounced than that between k = 6 and k = 12. Considering that a higher k corresponds to increased computational and memory demands as G and cy increase in dimension, this substantiates k = 6 as a reasonable choice for maximum representation depth. Although concatenating representations from multiple consecutive layers results in higher memory demands compared with using a final-layer classifier or averaging over layer-wise classifiers, we will demonstrate in Sec. 4.3 that our method remains significantly lighter in memory and computational requirements than other competitive class-prototype methods for CL. Interestingly, the performance of the final-layer classifier k = 1, as illustrated in Fig. 3, is approximately equivalent to that achieved by averaging over separate classifiers for k = 4 and k = 6. This observation challenges the argument that class embeddings from multiple consecutive layers, which are individually strong at predicting specific classes (cf. Fig. 2), might introduce noise that impairs performance when combined via averaging. ## 4.2 Combination With Parameter-Efficient Model Adaptation A benefit of class-prototype methods for CL is that they can be orthogonally combined with adaptation techniques to refine the pre-trained representations. As accumulated class prototypes are subject to discrepancy upon distributional shifts during supervised fine-tuning, any adaptation strategies to the latent representations should be carefully tailored to the class-prototype method used. Previous works (Panos et al., 2023; Zhou et al., 2023b) find adaptation to downstream continual tasks during First Session Adaptation (FSA) on D1 as sufficient to bridge the domain gap while maintaining full compatibility with CL. To maintain the powerful generic features of the pretrained backbone, we choose to apply FSA to an additional set of learnable PETL parameters while keeping the backbone frozen throughout. To update PETL parameters during FSA, we train a linear classification head with as many output neurons as the number of unique labels in the first task via Adam optimizer (Kingma & Ba, 2015) and cross-entropy loss only during the first CL stage and discard the classification head afterward. During the CL phase, we keep all model parameters frozen and update G and cy only. We follow prior works (Zhou et al., 2023b; McDonnell et al., 2023) and experiment with Visual Prompt Tuning (VPT) (Jia et al., 2022), Scaling and Shifting of Features (SSF) (Lian et al., 2022), and AdaptFormer (Chen et al., 2022) as PETL methods and refer to the cited papers for details. The pseudocode of the LayUP algorithm for the CIL setting is presented in Alg. 1. It is noteworthy that both G and cyt can be updated incrementally, one sample at a time, and Eq. (6) can be applied after every sample, thereby ensuring full compatibility with online (or, streaming) learning settings. For the OCL comparison, the FSA stage is omitted, and a fixed λ is utilized, since a dynamic search for λ necessitates multiple passes over the input data. | Algorithm 1 LayUP Training | |------------------------------| Require: Pre-trained network ϕ(·) Require: PETL parameters Require: Data D = {D1*, . . . ,* DT } Require: k \# Initialization of class prototypes G ← 0 ∈ R d(k)×d(k) cy ← 0 ∈ R d(k) ∀ y ∈ Y \# Phase A: First Session Adaptation with PETL for every sample (x, y) ∈ D1 do Collect ϕL(x) Update PETL parameters \# Phase B: Continual Learning with LayUP for task t = 1*, . . . , T* do for every sample (x, y) ∈ Dt do Collect Φ−k:(x) (Eq. (5)) G ← G + Φ−k:(x) ⊗ Φ−k:(x) cy ← cy + Φ−k:(x) \# Cf. Appendix A.1 Optimize λ to compute (G + λI) −1 ## 4.3 Memory And Runtime Complexity Comparisons We compare the memory and runtime requirements of LayUP with the three competitive CL methods ADAM (Zhou et al., 2023b), SLCA (Zhang et al., 2023), and RanPAC (McDonnell et al., 2023) for a typical class count of C = 200 and AdaptFormer (Chen et al., 2022) as PETL method. We neglect the memory cost of the ViT backbone, the fully connected classification layer, and the class prototypes, as they are similar to all 7 baselines. LayUP stores ∼1M PETL parameters and an additional multi-layer Gram matrix in memory. The size of this layer depends on the choice of k and has d 2 (k) = (dL−k+1 + *· · ·* + dL−1 + dL) 2entries (note that for the ViT-B/16 (Dosovitskiy et al., 2021) architecture, every layer outputs tokens of the same dimensionality, such that dl = 768 ∀ l ∈ {1*, . . . , L*}). For k = 6, which we use in our final experiments, the matrix stores ∼21M values. RanPAC with random projection dimension M = 10 000, as used throughout the original paper, updates a Gram matrix of size 100M and requires an additional ∼11M parameters for the random projection layer and PETL parameters. SLCA stores C additional covariance matrices of size d 2 L with a total of ∼118M entries. Finally, ADAM stores a second copy of the feature extractor, necessitating 84M additional parameters. Assuming a comparable memory cost for model parameters and matrix entries, our method reduces additional memory requirements by 81%, 82%, and 75% compared with RanPAC, SLCA, and ADAM, respectively. Considering runtime complexity during training, ADAM makes updates to all parameters of a ViT-B/16 model during first task adaptation. SLCA performs full body adaptation of a ViT-B/16 backbone during slow learning and additionally performs Cholesky decomposition (Cholesky, 1924) on the class-wise covariance matrices for pseudo-rehearsal, which requires C·d 3 L ≈ 1011 operations. RanPAC and LayUP only make updates to PETL parameters during training and perform matrix inversion during inference, albeit with differently constructed and sized Gram matrices. For k = 6, the matrix inversion needs (dL−k+1+*· · ·*+dL−1+dL) 3 ≈ 1011 operations for LayUP and 10 0003 = 1012 for RanPAC, thus LayUP reduces RanPAC's runtime complexity during inference by up to 90%. ## 5 Experiments In what follows, we conduct a series of experiments to assess our approach under various CL settings. We start with an overview of the datasets and implementation details in Sec. 5.1, followed by empirical comparisons of our method against recent strong baselines under CIL, DIL, and OCL settings in Sec. 5.2 and Sec. 5.3. Ablation studies are presented in Sec. 5.4. We explore the impact of different configurations of the last k layers on classifier performance in Sec. 5.5 and investigate the range of classes that benefit from hidden features in Sec. 5.6. We conclude our empirical analysis by evaluating LayUP as a plug-in for other class-prototype methods in Sec. 5.7. ## 5.1 Datasets And Implementation Details Following prior works (Wang et al., 2022b;c; Zhou et al., 2023b; Zhang et al., 2023; McDonnell et al., 2023), we experiment with two ViT-B/16 (Dosovitskiy et al., 2021) models, the former (**ViT-B/16-IN21K**) with self-supervised pre-training on the ImageNet-21K dataset (Ridnik et al., 2021), the latter (**ViT-B/16-** IN1K) with additional supervised fine-tuning on the ImageNet-1K dataset (Krizhevsky et al., 2012). During adaptation in the CIL and DIL settings, PETL parameters are trained using a batch size of 48 for 20 epochs, Adam (Kingma & Ba, 2015) with momentum for optimization, and learning rate scheduling via cosine annealing, starting with 0.03. We train five prompt tokens for VPT and use a bottleneck dimension of 16 for AdaptFormer. All baselines are rehearsal-free and trained on the same aforementioned ViT backbones. For the CIL and OCL settings, the seven representative split datasets are CIFAR-100 (**CIFAR**) (Krizhevsky, 2009), ImageNet-R (**IN-R**) (Hendrycks et al., 2021a), ImageNet-A (**IN-A**) (Hendrycks et al., 2021b), CUB-200 (CUB) (Wah et al., 2011), OmniBenchmark (OB) (Zhang et al., 2022), Visual Task Adaptation Benchmark (**VTAB**) (Zhai et al., 2020), and Stanford Cars-196 (**Cars**) (Krause et al., 2013). We use T = 10 for all datasets, except VTAB, which has a commonly used task count of T = 5. Additional results for task counts T = 5 and T = 20 can be found in Appendix C.4. For the DIL setting, baselines are trained on Continual Deepfake Detection Benchmark Hard (**CDDB-H**) (Li et al., 2023) with T = 5, a sub-sampled version of DomainNet (**S-DomainNet**) (Peng et al., 2019) with T = 6, and the domain-incremental formulation of ImageNet-R (**IN-R (D)**) with T = 15. Detailed descriptions and summary statistics of all datasets can be found in Appendix B. For comparison, we use the average accuracy (Lopez-Paz & Ranzato, 2017) metric At = 1 t Pt i=1 Rt,i, with Rt,i denoting the classification accuracy on the i th task after training on the t th task. Based on the | Method | CIFAR | IN-R | IN-A | CUB | OB | VTAB | Cars | |---------------------------------|---------|--------|--------|-------|-------|--------|--------| | Joint FT (full) | 93.6 | 86.6 | 71.0 | 91.1 | 80.3 | 92.5 | 83.7 | | Joint FT (linear probe) | 87.9 | 71.2 | 56.4 | 89.1 | 78.8 | 90.4 | 66.4 | | L2P (Wang et al., 2022c) | 84.6 | 72.5 | 42.5 | 65.2 | 64.7 | 77.1 | 38.2 | | DualPrompt (Wang et al., 2022b) | 81.3 | 71.0 | 45.4 | 68.5 | 65.5 | 81.2 | 40.1 | | CODA-P (Smith et al., 2023a) | 86.3 | 75.5 | 74.5 | 79.5 | 68.7 | 87.4 | 43.2 | | NMC+FSA (Janson et al., 2022) | 87.8 | 70.1 | 49.7 | 85.4 | 73.4 | 88.2 | 40.5 | | ADAM (Zhou et al., 2023b) | 87.6 | 72.3 | 52.6 | 87.1 | 74.3 | 84.3 | 41.4 | | SLCA (Zhang et al., 2023) | 91.5 | 77.0 | 59.8∗ | 84.7 | 73.1∗ | 89.2∗ | 67.7 | | RanPAC (McDonnell et al., 2023) | 92.2 | 78.1 | 61.8 | 90.3 | 79.9 | 92.6 | 77.7 | | LayUP | 92.0 | 81.4 | 62.2 | 88.1 | 77.6 | 93.3 | 82.5 | | Ablations k = 1 | 90.8 | 78.8 | 60.4 | 86.7 | 72.0 | 92.4 | 74.9 | | w/o FSA | 88.7 | 73.1 | 57.7 | 86.2 | 77.0 | 92.6 | 78.6 | | k = 1, w/o FSA | 86.5 | 69.4 | 55.4 | 85.4 | 70.7 | 91.6 | 69.1 | | LayNMC | 88.1 | 59.3 | 50.0 | 82.5 | 68.9 | 86.5 | 40.0 | | NMC | 83.4 | 61.2 | 49.3 | 85.1 | 73.1 | 88.4 | 37.7 | | Method | CDDB-H | S-DomainNet | IN-R (D) | |---------------------------------|----------|---------------|------------| | Joint FT (full) | 92.9 | 62.8 | 86.6 | | Joint FT (linear probe) | 74.0 | 57.2 | 71.2 | | NMC+FSA (Janson et al., 2022) | 49.8 | 44.0 | 76.3 | | ADAM (Zhou et al., 2023b) | 70.7 | - | - | | RanPAC (McDonnell et al., 2023) | 86.2 | 58.8 | 77.2 | | LayUP | 88.1 | 59.4 | 80.0 | | Ablations k = 1 | 84.0 | 54.2 | 77.8 | | w/o FSA | 86.7 | 58.3 | 73.3 | | k = 1, w/o FSA | 77.7 | 53.7 | 69.0 | | LayNMC | 61.4 | 34.4 | 59.1 | | NMC | 57.6 | 43.5 | 64.1 | Table 1: Comparison of prompting, backbone fine-tuning, and class-prototype methods for the CIL setting. Results are taken from McDonnell et al. (2023) except results for SLCA marked with (∗), which are reproduced using the officially released code. Best results per dataset are highlighted in bold. Table 2: **Comparison of class-prototype methods for the DIL setting.** Results for ADAM and RanPAC on CDDB-H are taken from McDonnell et al. (2023). observations detailed in Sec. 4.1, utilizing features from the second half of the network layers for prototype construction emerges as an effective yet cost-efficient strategy in terms of memory and computational resources. Consequently, all experiments are conducted with k = 6, unless specified otherwise. For a comprehensive comparison of performance across different choices of k for all datasets, refer to Sec. 5.5. In all experiments in the main paper, the reported metric is average accuracy AT after learning the last task for random seed 1993 and the best combination of PETL method and ViT backbone (similar to McDonnell et al. (2023); Zhou et al. (2023b)). We refer to Appendix C.1 for analysis of each At, forgetting measures, and variability across random initialization, and to Appendix C.3 for average accuracy over training for different PETL methods and pre-trained backbones in the CIL setting. | Method | CIFAR | IN-R | IN-A | CUB | OB | VTAB | Cars | |------------------------------------|---------|--------|--------|-------|------|--------|--------| | Sequential FT | 12.8 | 5.3 | 6.9 | 5.1 | 3.3 | 7.3 | 10.9 | | NMC (Janson et al., 2022) | 83.4 | 61.2 | 49.3 | 85.1 | 73.1 | 88.4 | 37.7 | | RanPACλ=0 (McDonnell et al., 2023) | 88.7 | 70.6 | 1.4 | 0.9 | 76.9 | 9.3 | 0.6 | | RanPACλ=1 (McDonnell et al., 2023) | 88.7 | 70.6 | 0.9 | 0.7 | 76.9 | 9.0 | 0.6 | | LayUPλ=0 | 88.7 | 73.4 | 40.9 | 86.4 | 77.0 | 10.4 | 66.3 | | LayUPλ=1 | 88.7 | 73.4 | 51.6 | 86.9 | 77.0 | 92.9 | 77.5 | | Ablations k = 1, λ = 0 | 86.5 | 69.6 | 55.6 | 85.4 | 72.8 | 92.2 | 69.2 | | k = 1, λ = 1 | 86.5 | 69.6 | 55.6 | 85.4 | 76.3 | 92.3 | 69.2 | Table 3: **Comparison of class-prototype methods for the OCL setting.** Results for RanPAC and NMC are reproduced according to the officially released code in McDonnell et al. (2023). ## 5.2 Performance In The Cil And Dil Settings In the CIL setting, we compare LayUP with several prompt learning, fine-tuning, and class-prototype methods for CL. We additionally report results for joint fine-tuning (FT) of the full backbone and a linear probe. As shown in Tab. 1, LayUP surpasses all baselines for four of the seven split datasets. The four datasets—IN-R, IN-A, VTAB, and Cars—on which LayUP consistently outperforms all baseline models, exhibit two distinct characteristics: First, they possess a high domain gap relative to the pre-training ImageNet domain, as detailed in Sec. 5.5. Second, with the exception of IN-R, they contain significantly less training data compared to CIFAR, OB, and CUB (cf. Appendix B). The former confirms our initial hypothesis that intermediate representations are more domain-invariant and consequently more robust to large distributional shifts from the source to the target domain. The latter indicates that especially in the low-data regime, in contrast to other methods that tend to overfit to the target domain, LayUP constructs class prototypes and decision boundaries that generalize well even if the amount of training data is scarce compared with the data used for ViT pre-training. It is further noteworthy that RanPAC, which is the only baseline that LayUP does not consistently outperform, is considerably more expensive regarding both memory and computation (cf. Sec. 4.3). Results for the DIL setting are reported in Tab. 2. We compare our method with several strong class-prototype methods for CL and, similar to the CIL comparison, we additionally report results for joint fine-tuning of the backbone and a linear probe. LayUP consistently outperforms all baselines. These results confirm that our method effectively utilizes the domain-invariant information contained in the low- and mid-level intermediate features of the pre-trained model, thereby enhancing its robustness to domain shifts. ## 5.3 Performance In The Ocl Setting We are interested in assessing the performance of our method in the challenging OCL setting, where only a single pass over the continual data stream is allowed. All baselines are class-prototype methods for continual learning on a frozen embedding network (thus we omit FSA stages for NMC, RanPAC, and our approach), except for sequential fine-tuning, where we update the parameters of the pre-trained ViT via cross-entropy loss and Adam optimizer during a single epoch. Note that NMC exhibits identical behavior in both CIL and OCL settings, as it uses each training sample only once for running-mean calculation, consequently producing the same outcomes as the ablation baseline in Tab. 1. Given that the choice of the ridge regression parameter λ, as utilized in RanPAC and our method, necessitates prior knowledge about the downstream continual data—a requirement unmet in realistic streaming learning settings—we opt for comparison with two simplified versions of Gram matrix inversion (G + λI) −1(cf. Eq. (3) and Eq. (6)): In the first variant, we omit λ-based regularization completely, such that λ = 0 and the Gram matrix is inverted without regularization (i.e., G−1). In the second variant, e.g., as used in Panos et al. (2023), we choose λ = 1, such that we linearly transform identity-regularized class prototypes (i.e., (G + I) −1). | k | CIFAR | IN-R | IN-A | CUB | OB | VTAB | Cars | |-----|---------|--------|--------|-------|------|--------|--------| | 1 | 89.2 | 79.2 | 60.8 | 85.3 | 71.6 | 92.7 | 75.5 | | 2 | 90.1 | 79.9 | 62.2 | 86.9 | 73.9 | 90.7 | 78.7 | | 3 | 90.2 | 80.7 | 62.5 | 87.3 | 74.5 | 93.2 | 81.4 | | 4 | 90.4 | 81.1 | 62.0 | 87.6 | 76.7 | 93.1 | 81.7 | | 5 | 90.7 | 81.5 | 62.8 | 87.3 | 77.0 | 93.0 | 82.4 | | 6 | 91.0 | 81.2 | 62.2 | 87.3 | 77.5 | 92.2 | 82.5 | | 7 | 90.9 | 81.6 | 63.4 | 87.5 | 77.7 | 93.4 | 82.6 | | 8 | 90.8 | 81.4 | 62.8 | 87.7 | 77.2 | 92.1 | 82.3 | | 9 | 91.0 | 81.5 | 62.1 | 87.4 | 78.3 | 92.0 | 82.6 | | 10 | 90.9 | 81.4 | 63.4 | 87.9 | 77.4 | 94.0 | 81.5 | | 11 | 91.1 | 81.5 | 62.0 | 87.6 | 78.1 | 93.7 | 81.4 | | 12 | 90.8 | 80.8 | 62.8 | 88.0 | 77.8 | 93.9 | 82.3 | Table 4: **Comparison of maximum representation depths.** LayUP performance for different values of k for a pre-trained ViT-B/16-IN1K and FSA with AdaptFormer. The 1 st, 2 nd , and 3 rd highest scores and the 1 st, 2 nd , and 3 rd lowest scores are highlighted. As indicated in Tab. 3, unrestricted fine-tuning of the backbone is detrimental to the generalizability of the pre-trained embeddings and leads to forgetting and low performance. Consequently, the sequential FT baseline is outperformed by class-prototype methods in the OCL setting for most benchmarks. With the exception of VTAB, LayUP is largely robust to missing regularization (λ = 0) and maintains a high performance across all benchmarks for regularization with λ = 1. On the contrary, RanPAC exhibits high variability in performance across benchmarks, occasionally resulting in near-zero accuracy. This outcome is likely due to the high-dimensional prototypes and Gram matrix in RanPAC, obtained after random projections, overfitting the training data, which consequently hampers their ability to generalize. LayUP's superior robustness in the online learning setting renders it a more favorable approach for continual learning scenarios where the length of the input stream and the nature of the data might not be known in advance. ## 5.4 Ablation Study The purpose of the following ablation study is to demonstrate the advantages of leveraging multi-layer representations over solely utilizing features from the final representation layer (i.e., k = 1) for class-prototype construction in CL. As LayUP integrates multi-layer representations with second-order statistics via Gram matrix inversion as well as first session adaptation in the CIL and DIL settings, we consider three configurations for ablating multi-layer representations: (i) in the standard setting with both FSA and second-order statistics (LayUP vs. k = 1), (ii) excluding the FSA stage, i.e., omitting phase A in Alg. 1 (w/o FSA vs. k = 1, w/o FSA), and (iii) excluding FSA and second-order statistics, which corresponds to traditional nearest-mean classifiers (LayNMC vs. NMC). Results for the baselines constructed for settings (i)-(iii) can be found in the bottom sections of Tab. 1 and Tab. 2. For (i), enriching the final layer with intermediate features consistently results in absolute performance gains ranging from 1.2% to 5.7% (CIL) and 2.2% to 5.2% (DIL). For (ii), except for the VTAB dataset in the CIL setting, leveraging multi-layer features yields absolute accuracy improvements of up to 9.5% (CIL) and 9.0% (DIL). Lastly, for (iii), LayNMC does not show superior performance to the NMC baseline. Such results indicate that the benefits of intermediate features diminish when not decorrelated via Gram matrix inversion, as they contain more lower-level noisy information than final layer representations. In the lower section of Tab. 3, further comparisons are made between ablated versions of LayUP and prototypes using final representations (k = 1) in the OCL setting for two selected values of the regularization parameter λ. LayUP generally outperforms its ablated versions, although it demonstrates decreased performance in low-data benchmarks such as IN-A and VTAB, particularly when omitting regularization (λ = 0). This decline in performance may stem from the increased dimensionality of class prototypes and the Gram matrix due to the addition of intermediate representations, thereby elevating the risk of overfitting. Consequently, the ![11_image_0.png](11_image_0.png) Figure 4: Choice of k **for different dataset characteristics.** Multi-layer representation depth k that yields highest accuracy vs. normalized MMD between each dataset and the ImageNet pre-training domain, represented by *mini*ImageNet dataset (*left*), intra-class similarity (*center*), and inter-class similarity (*right*). absence of regularization, combined with limited training data, may render multi-layer features detrimental. However, in any other case, they enhance classification accuracy by 0.6% to 8.3%. ## 5.5 Analysis Of Multi-Layer Representation Depth To provide more insights into the impact of the multi-layer representation depth on LayUP performance, we plot in Tab. 4 the average accuracy after training for different choices of k using a ViT-B/16-IN1K backbone and AdaptFormer as PETL method. The final-layer classifier (k = 1) exhibits the lowest performance in comparison to all other k values across all datasets, except for the split VTAB dataset. Conversely, LayUP configurations with medium or large k values almost consistently outperform those with small k values, demonstrating the broad advantages of leveraging representations from multiple intermediate layers for class-prototype construction. While the optimal choice of k varies across datasets, the performance gains generally diminish with increasing k values. For instance, the average accuracy gain from choosing k = 6 over k = 1 is 2.7%, whereas it is only 0.4% when choosing k = 12 over k = 6. This confirms the findings made in Sec. 4.1, suggesting that a value of k = 6 might generally suffice to achieve a significant performance gain over last-layer class-prototype methods while requiring significantly less computational and memory resources compared with k = 12. We further aim to determine whether prior knowledge about the characteristics of downstream CL data can inform the optimal choice of maximum multi-layer representation depth with respect to overall performance. Specifically, we identify the value of k that maximizes accuracy on the test set after running Alg. 1 with AdaptFormer as PETL method for each split dataset used in Sec. 5.2 and for each pre-trained ViT model. We plot the highest performing k per dataset against three measures: (i) the degree of domain gap to the pre-training ImageNet domain, measured by Maximum Mean Discrepancy (MMD); (ii) the intra-class similarity, measured by the average pairwise cosine similarity between training image feature vectors of the same class; and (iii) the inter-class similarity, measured by the average pairwise cosine similarity between image feature vectors of disjoint classes. For (i), we follow Panos et al. (2023) and use the *mini*ImageNet dataset (60K images) as a proxy for the ImageNet-1K (1.3M images) and ImageNet-21K (14M images) pre-training datasets to reduce computational overhead when calculating pairwise distances. A large MMD value indicates that two datasets have significantly different statistical properties, thus signifying a large domain gap between the source and target domains. As shown in Fig. 4, there is no clear relationship between the MMD and the optimal choice of k. This suggests that the degree of domain gap from the source domain of a pre-trained model is not a reliable indicator for determining the multi-layer representation depth that maximizes performance. However, a positive trend is observed between the optimal k and both intra-class and inter-class similarity. First, datasets with high intra-class and inter-class similarity (e.g., Cars and CUB) benefit from a high value of k. These datasets typically focus on fine-grained classification of natural images within a specific domain. Second, datasets with medium intra-class similarity and low inter-class similarity (e.g., VTAB, OB, or CIFAR) benefit from a medium-to-high value of k. These datasets are usually composed of multiple specialized natural-image datasets, which can belong to very distinct domains, thus explaining the low inter-class similarity. Finally, datasets with low intra-class and inter-class similarity (e.g., IN-A or IN-R) benefit from a medium value of k. These datasets often consist of atypical or stylized image examples that differ from the natural images in ImageNet and are thus prone to be distributed unsystematically in the feature space. Although the maximum performance for most configurations in Fig. 4 is achieved by concatenating features from the majority of layers in the pre-trained model, the performance differences between various choices of k can be minimal in some cases (as shown in Tab. 4) and may fluctuate with different random initializations. Furthermore, as previously discussed, performance gains tend to saturate as k increases. Concurrently, larger k values are associated with higher memory usage and increased runtime complexity during inference. Therefore, selecting an appropriate k requires careful consideration of the specific demands and constraints across different dimensions. ## 5.6 How Universal **Are Multi-Layer Prototypes?** We aim to assess the universality of multi-layer prototypes for classification, specifically, the breadth of classes benefiting from LayUP. To this end, we report the proportion of classes for each dataset whose test accuracy scores are higher, equal, or lower with LayUP compared to the final-layer ridge classifier (cf. Eq. (3)). Beyond merely counting the classes that are better predicted by either method, we also examine the extent of the benefit one method has over the other per improved class. Consequently, we calculate the average difference in accuracy scores between LayUP and the final-layer classifier (k = 1), and vice versa, for each class that shows improvement. ![12_image_0.png](12_image_0.png) Figure 5: **LayUP vs. classification from the final representation layer.** *Left:* Percentage of classes per dataset that are better classified with LayUP (with k = 6) compared with the last layer ridge classifier (equivalent to LayUP with k = 1). *Right:* Difference of absolute accuracy per improved class between LayUP and the final-layer classifier (k = 1), and vice versa. Fig. 5 illustrates that a higher percentage of classes (between 18% and 72%) is more effectively classified upon introducing intermediate representations to class-prototype construction. Although the difference in the number of improved classes is not as pronounced for IN-A and CUB compared with all other benchmarks, the relative difference in accuracy per improved class between LayUP and the final representation layer classifier reaches as high as 39% for IN-A and 22% for CUB. This indicates that for these two datasets, the introduction of intermediate representations significantly benefits a few classes rather than slightly benefiting a large number of classes, as observed with the other benchmarks. Despite the variability with respect to the number of classes per dataset that benefit from LayUP and the extent of the benefit, our results demonstrate the universal applicability of multi-layer prototypes across a broad spectrum of tasks, classes, or domains. | Method | CIFAR | IN-R | IN-A | CUB | OB | VTAB | Cars | |--------------------------|---------------------------------------|--------|--------|-------|------|--------|--------| | ADAM | 87.6 | 72.3 | 50.5 | 87.1 | 74.3 | 84.3 | 51.3 | | ADAM w/ LayUP (k = 4) | 91.0 | 81.8 | 63.3 | 87.5 | 78.1 | 93.9 | 82.4 | | ADAM w/ LayUP (k = 6) | 91.4 | 81.7 | 63.8 | 87.8 | 79.0 | 94.7 | 82.2 | | ADAM w/ LayUP (k = 12) | 91.3 | 82.0 | 63.8 | 87.5 | 78.1 | 94.6 | 81.7 | | | (a) LayUP + ADAM (Zhou et al., 2023b) | | | | | | | | Method | CIFAR | IN-R | IN-A | CUB | OB | VTAB | Cars | | RanPAC | 90.7 | 78.0 | 58.2 | 88.5 | 76.9 | 92.6 | 67.5 | | RanPAC w/ LayUP (k = 4) | 91.1 | 82.4 | 61.5 | 88.7 | 79.0 | 94.0 | 81.9 | | RanPAC w/ LayUP (k = 6) | 91.1 | 82.8 | 63.4 | 88.6 | 78.3 | 93.4 | 82.3 | | RanPAC w/ LayUP (k = 12) | 91.1 | 82.4 | 64.1 | 88.9 | 78.3 | 94.1 | 81.7 | (a) LayUP + ADAM (Zhou et al., 2023b) (b) LayUP + RanPAC (McDonnell et al., 2023) Table 5: **Combination of LayUP with other class-prototype methods.** The reported average accuracy scores (%) pertain to the CIL setting as detailed in Sec. 5.1. All baselines were trained using ViT-B/16-IN1K as the pre-trained model and AdaptFormer as the PETL method. Results for RanPAC and ADAM, which were not reported for this specific configuration, have been reproduced using their officially released code repositories. Note that the results for RanPAC and ADAM may differ slightly from those presented in Tab. 1, as the latter reports the best among all configurations of PETL methods and ViT models. ## 5.7 Combination With Other Class-Prototype Methods We aim to investigate the effectiveness of using intermediate representations, as employed in LayUP, as a plugin to enhance other prototype-based methods for CL. Specifically, we incorporate multi-layer representations into two class-prototype methods: ADAM and RanPAC. Details on these methods can be found in Zhou et al. (2023b) and McDonnell et al. (2023). For LayUP combined with ADAM, we aggregate concatenated features from the last k layers of both the pre-trained and first session adapted ViT to construct prototypes. During inference, instead of using cosine similarity matching as done in ADAM (cf. Eq. (2)), we apply Gram matrix inversion following the approach in LayUP (cf. Eq. (6)). This decision is informed by the results from Sec. 5.4, which suggest that multi-layer representations are insufficiently effective for prototype matching when relying solely on first-order feature statistics. For LayUP combined with RanPAC, concatenated features from the last k layers of the first session adapted ViT are fed to the random projection layer, which has an output dimensionality of M = 10 000. The results for the combinations with ADAM and RanPAC are shown in Tab. 5a and Tab. 5b, respectively. Integrating LayUP with other class-prototype methods consistently improves performance across all datasets. However, the magnitude of these improvements varies, with the CUB and CIFAR datasets showing the least pronounced enhancements (↑ 0.4% for LayUP integrated with RanPAC) and the Cars dataset exhibiting the most substantial gains (↑ 31.1% for LayUP integrated with ADAM). Although the optimal value of k for maximizing performance differs across datasets, the overall performance does not significantly vary with different k values. This suggests that a small, resource-efficient choice of k is sufficient to enhance existing class-prototype methods when integrated with LayUP. ## 6 Conclusion In this paper, we propose LayUP, a simple yet effective rehearsal-free class-prototype method for continual learning with pre-trained models. LayUP leverages multi-layer representations of a pre-trained feature extractor to increase robustness and generalizability, especially under large domain gaps and in low-data regimes. It further computes second-order feature statistics to decorrelate class prototypes, combined with parameter-efficient first session adaptation. Extensive experiments across a range of image classification datasets and continual learning settings demonstrate that LayUP performs strongly against competitive baselines while requiring significantly less memory and computational complexity. Beyond that, our method can be used as a versatile plug-in to improve existing class-prototype methods. In future work, we will further investigate integrating class-prototype methods with continual adaptation of pre-trained models beyond first session adaptation, which is particularly beneficial for learning under multiple distributional shifts. Multi-layer representations serve as a potent source of knowledge that is inherently available in pre-trained models. Based on the findings made in this work, we encourage further exploration into making explicit use of these representations (i.e., *reading between the layers*) in future approaches to continual learning. ## References Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018. Pietro Buzzega, Matteo Boschini, Angelo Porrello, Davide Abati, and Simone Calderara. Dark Experience for General Continual Learning: a Strong, Simple Baseline. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), *Advances in Neural Information Processing Systems*, volume 33, pp. 15920–15930. Curran Associates, Inc., 2020. Arslan Chaudhry, Puneet K. Dokania, Thalaiyasingam Ajanthan, and Philip H. S. Torr. Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigence. In *Proceedings of the European* Conference on Computer Vision (ECCV), September 2018. Arslan Chaudhry, Marc'Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient Lifelong Learning with A-GEM. In *International Conference on Learning Representations*, 2019. Shoufa Chen, Chongjian GE, Zhan Tong, Jiangliu Wang, Yibing Song, Jue Wang, and Ping Luo. AdaptFormer: Adapting Vision Transformers for Scalable Visual Recognition. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh (eds.), *Advances in Neural Information Processing Systems*, volume 35, pp. 16664–16678. Curran Associates, Inc., 2022. Zhe Chen, Yuchen Duan, Wenhai Wang, Junjun He, Tong Lu, Jifeng Dai, and Yu Qiao. Vision Transformer Adapter for Dense Predictions. In *The Eleventh International Conference on Learning Representations*, 2023. Zhiyuan Chen and Bing Liu. Lifelong Machine Learning, Second Edition. *Synthesis Lectures on Artificial* Intelligence and Machine Learning, 12(3), 2018. doi: 10/gd8g2p. Gong Cheng, Junwei Han, and Xiaoqiang Lu. Remote Sensing Image Scene Classification: Benchmark and State of the Art. *Proceedings of the IEEE*, 105(10):1865–1883, October 2017. ISSN 0018-9219, 1558-2256. doi: 10.1109/JPROC.2017.2675998. André-Louis Cholesky. Note sur une méthode de résolution des équations normales provenant de l'application de la méthode des moindres carrés à un système d'équations linéaires en nombre inférieur à celui des inconnues. Application de la méthode à la résolution d'un système défini d'équations linéaires. *Bulletin* Géodésique, 2(1):67–77, April 1924. ISSN 0007-4632, 1432-1394. doi: 10.1007/BF03031308. Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing Textures in the Wild. In *Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition* (CVPR), June 2014. Prithviraj Dhar, Rajat Vikram Singh, Kuan-Chuan Peng, Ziyan Wu, and Rama Chellappa. Learning Without Memorizing. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition* (CVPR), June 2019. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. In *International Conference* on Learning Representations, 2021. Leon Gatys, Alexander Ecker, and Matthias Bethge. A Neural Algorithm of Artistic Style. *Journal of Vision*, 16(12):326, September 2016. ISSN 1534-7362. doi: 10.1167/16.12.326. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In *Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)*, June 2016. Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. EuroSAT: A Novel Dataset and Deep Learning Benchmark for Land Use and Land Cover Classification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 12(7):2217–2226, July 2019. ISSN 1939-1404, 2151-1535. doi: 10.1109/JSTARS.2019.2918242. Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, Dawn Song, Jacob Steinhardt, and Justin Gilmer. The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 8340–8349, October 2021a. Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural Adversarial Examples. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)*, pp. 15262–15271, June 2021b. Arthur E. Hoerl and Robert W. Kennard. Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics, 12(1):55–67, February 1970. ISSN 0040-1706, 1537-2723. doi: 10.1080/00401706.1970. 10488634. Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-Efficient Transfer Learning for NLP. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), *Proceedings of the 36th International Conference* on Machine Learning, volume 97 of *Proceedings of Machine Learning Research*, pp. 2790–2799. PMLR, June 2019. Edward J. Hu, yelong shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-Rank Adaptation of Large Language Models. In International Conference on Learning Representations, 2022. Paul Janson, Wenxuan Zhang, Rahaf Aljundi, and Mohamed Elhoseiny. A Simple Baseline that Questions the Use of Pretrained-Models in Continual Learning. In *NeurIPS 2022 Workshop on Distribution Shifts:* Connecting Methods and Applications, 2022. Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual Prompt Tuning. In Shai Avidan, Gabriel Brostow, Moustapha Cissé, Giovanni Maria Farinella, and Tal Hassner (eds.), *Computer Vision - ECCV 2022*, pp. 709–727, Cham, 2022. Springer Nature Switzerland. ISBN 978-3-031-19827-4. Yongcheng Jing, Yezhou Yang, Zunlei Feng, Jingwen Ye, Yizhou Yu, and Mingli Song. Neural Style Transfer: A Review. *IEEE Transactions on Visualization and Computer Graphics*, 26(11):3365–3385, November 2020. ISSN 1077-2626, 1941-0506, 2160-9306. doi: 10.1109/TVCG.2019.2921336. Dahuin Jung, Dongyoon Han, Jihwan Bang, and Hwanjun Song. Generating Instance-level Prompts for Rehearsal-free Continual Learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 11847–11857, October 2023. Zixuan Ke, Hu Xu, and Bing Liu. Adapting BERT for Continual Learning of a Sequence of Aspect Sentiment Classification Tasks. In *Proceedings of the 2021 Conference of the North American Chapter* of the Association for Computational Linguistics: Human Language Technologies, pp. 4746–4755, Online, June 2021. Association for Computational Linguistics. doi: 10/gk9m6d. Diederik P Kingma and Jimmy Lei Ba. Adam: A Method for Stochastic Optimization. In *International* Conference on Learning Representations, 2015. James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 114(13):3521–3526, March 2017. ISSN 0027-8424, 1091-6490. doi: 10/gfvjcp. Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3D Object Representations for Fine-Grained Categorization. In Proceedings of the IEEE International Conference on Computer Vision (ICCV) Workshops, June 2013. Alex Krizhevsky. Learning Multiple Layers of Features from Tiny Images. *Master's thesis, University of* Toronto, 2009. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet Classification with Deep Convolutional Neural Networks. In F. Pereira, C. J. Burges, L. Bottou, and K. Q. Weinberger (eds.), *Advances in Neural* Information Processing Systems, volume 25. Curran Associates, Inc., 2012. Brian Lester, Rami Al-Rfou, and Noah Constant. The Power of Scale for Parameter-Efficient Prompt Tuning. In *Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing*, pp. 3045–3059, Online and Punta Cana, Dominican Republic, 2021. Association for Computational Linguistics. doi: 10/gqfkxd. Chuqiao Li, Zhiwu Huang, Danda Pani Paudel, Yabin Wang, Mohamad Shahbazi, Xiaopeng Hong, and Luc Van Gool. A Continual Deepfake Detection Benchmark: Dataset, Methods, and Essentials. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pp. 1339–1349, January 2023. Yanghao Li, Naiyan Wang, Jiaying Liu, and Xiaodi Hou. Demystifying Neural Style Transfer. In *Proceedings* of the 26th International Joint Conference on Artificial Intelligence, IJCAI'17, pp. 2230–2236. AAAI Press, 2017. ISBN 978-0-9992411-0-3. Place: Melbourne, Australia. Zhizhong Li and Derek Hoiem. Learning without Forgetting. *Transactions on Pattern Analysis and Machine* Intelligence, 40(12), 2018. doi: 10/gfwmxw. Dongze Lian, Daquan Zhou, Jiashi Feng, and Xinchao Wang. Scaling & Shifting Your Features: A New Baseline for Efficient Model Tuning. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh (eds.), *Advances in Neural Information Processing Systems*, volume 35, pp. 109–123. Curran Associates, Inc., 2022. Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing. ACM Computing Surveys, 55(9):1–35, September 2023. ISSN 0360-0300, 1557-7341. doi: 10/gq5fh2. David Lopez-Paz and Marc' Aurelio Ranzato. Gradient Episodic Memory for Continual Learning. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. Zheda Mai, Ruiwen Li, Hyunwoo Kim, and Scott Sanner. Supervised Contrastive Replay: Revisiting the Nearest Class Mean Classifier in Online Class-Incremental Continual Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, pp. 3589–3599, June 2021. Simone Marullo, Matteo Tiezzi, Marco Gori, Stefano Melacci, and Tinne Tuytelaars. Continual Learning with Pretrained Backbones by Tuning in the Input Space. In *2023 International Joint Conference on* Neural Networks (IJCNN), pp. 1–9, Gold Coast, Australia, June 2023. IEEE. ISBN 978-1-66548-867-9. doi: 10.1109/IJCNN54540.2023.10191069. Michael McCloskey and Neal J. Cohen. Catastrophic Interference in Connectionist Networks: The Sequential Learning Problem. *Psychology of Learning and Motivation - Advances in Research and Theory*, 24(C), 1989. doi: 10/ckpftf. Mark D. McDonnell, Dong Gong, Amin Parveneh, Ehsan Abbasnejad, and Anton van den Hengel. RanPAC: Random Projections and Pre-trained Models for Continual Learning. In *Advances in Neural Information* Processing Systems. Curran Associates, Inc., 2023. Kevin P. Murphy. *Machine learning: a probabilistic perspective*. Adaptive computation and machine learning series. MIT Press, Cambridge, MA, 2012. ISBN 978-0-262-01802-9. M.-E. Nilsback and A. Zisserman. A Visual Vocabulary for Flower Classification. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition - Volume 2 (CVPR'06), volume 2, pp. 1447–1454, New York, NY, USA, 2006. IEEE. ISBN 978-0-7695-2597-6. doi: 10.1109/CVPR.2006.42. Oleksiy Ostapenko, Timothee Lesort, Pau Rodriguez, Md Rifat Arefin, Arthur Douillard, Irina Rish, and Laurent Charlin. Continual Learning with Foundation Models: An Empirical Study of Latent Replay. In Sarath Chandar, Razvan Pascanu, and Doina Precup (eds.), *Proceedings of The 1st Conference on Lifelong* Learning Agents, volume 199 of *Proceedings of Machine Learning Research*, pp. 60–91. PMLR, August 2022. Aristeidis Panos, Yuriko Kobe, Daniel Olmeda Reino, Rahaf Aljundi, and Richard E. Turner. First Session Adaptation: A Strong Replay-Free Baseline for Class-Incremental Learning. In *Proceedings of the IEEE/CVF* International Conference on Computer Vision (ICCV), pp. 18820–18830, October 2023. German I. Parisi, Ronald Kemker, Jose L. Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. *Neural Networks*, 113:54–71, 2019. ISSN 0893-6080. doi: https://doi.org/10.1016/j.neunet.2019.01.012. O. M. Parkhi, A. Vedaldi, A. Zisserman, and C. V. Jawahar. Cats and dogs. In *2012 IEEE Conference* on Computer Vision and Pattern Recognition, pp. 3498–3505, Providence, RI, June 2012. IEEE. ISBN 978-1-4673-1228-8 978-1-4673-1226-4 978-1-4673-1227-1. doi: 10.1109/CVPR.2012.6248092. Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment Matching for Multi-Source Domain Adaptation. In *Proceedings of the IEEE/CVF International Conference on Computer* Vision (ICCV), October 2019. Ameya Prabhu, Philip H. S. Torr, and Puneet K. Dokania. GDumb: A Simple Approach that Questions Our Progress in Continual Learning. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm (eds.), *Computer Vision - ECCV 2020*, pp. 524–540, Cham, 2020. Springer International Publishing. ISBN 978-3-030-58536-5. Vinay Venkatesh Ramasesh, Ethan Dyer, and Maithra Raghu. Anatomy of Catastrophic Forgetting: Hidden Representations and Task Semantics. In *International Conference on Learning Representations*, 2021. Vinay Venkatesh Ramasesh, Aitor Lewkowycz, and Ethan Dyer. Effect of scale on catastrophic forgetting in neural networks. In *International Conference on Learning Representations*, 2022. Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), *Advances in Neural Information Processing Systems*, volume 30. Curran Associates, Inc., 2017a. Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H. Lampert. iCaRL: Incremental Classifier and Representation Learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017b. Tal Ridnik, Emanuel Ben-Baruch, Asaf Noy, and Lihi Zelnik-Manor. ImageNet-21K Pretraining for the Masses. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1), 2021. Andrei A. Rusu, Neil C. Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive Neural Networks. *arXiv:1606.04671*, September 2016. arXiv: 1606.04671. Dawid Rymarczyk, Joost van de Weijer, Bartosz Zieliński, and Bartlomiej Twardowski. ICICLE: Interpretable Class Incremental Continual Learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 1887–1898, October 2023. Joan Serra, Didac Suris, Marius Miron, and Alexandros Karatzoglou. Overcoming Catastrophic Forgetting with Hard Attention to the Task. In Jennifer Dy and Andreas Krause (eds.), *Proceedings of the 35th* International Conference on Machine Learning, volume 80 of *Proceedings of Machine Learning Research*, pp. 4548–4557. PMLR, July 2018. James Seale Smith, Leonid Karlinsky, Vyshnavi Gutta, Paola Cascante-Bonilla, Donghyun Kim, Assaf Arbelle, Rameswar Panda, Rogerio Feris, and Zsolt Kira. CODA-Prompt: COntinual Decomposed AttentionBased Prompting for Rehearsal-Free Continual Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 11909–11919, June 2023a. James Seale Smith, Junjiao Tian, Shaunak Halbe, Yen-Chang Hsu, and Zsolt Kira. A Closer Look at Rehearsal-Free Continual Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, pp. 2409–2419, June 2023b. Gido M. Van De Ven, Tinne Tuytelaars, and Andreas S. Tolias. Three types of incremental learning. Nature Machine Intelligence, 4(12):1185–1197, December 2022. ISSN 2522-5839. doi: 10.1038/s42256-022-00568-3. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is All you Need. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), *Advances in Neural Information Processing Systems*, volume 30. Curran Associates, Inc., 2017. Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The Caltech-UCSD Birds-200-2011 Dataset. Technical report, California Institute of Technology, 2011. Publisher: California Institute of Technology. Liyuan Wang, Xingxing Zhang, Hang Su, and Jun Zhu. A Comprehensive Survey of Continual Learning: Theory, Method and Application. *IEEE Transactions on Pattern Analysis and Machine Intelligence*, pp. 1–20, 2024. ISSN 0162-8828, 2160-9292, 1939-3539. doi: 10.1109/TPAMI.2024.3367329. Quanziang Wang, Renzhen Wang, Yichen Wu, Xixi Jia, and Deyu Meng. CBA: Improving Online Continual Learning via Continual Bias Adaptor. In *Proceedings of the IEEE/CVF International Conference on* Computer Vision (ICCV), pp. 19082–19092, October 2023. Yabin Wang, Zhiwu Huang, and Xiaopeng Hong. S-Prompts Learning with Pre-trained Transformers: An Occam's Razor for Domain Incremental Learning. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh (eds.), *Advances in Neural Information Processing Systems*, volume 35, pp. 5682–5695. Curran Associates, Inc., 2022a. Zifeng Wang, Zizhao Zhang, Sayna Ebrahimi, Ruoxi Sun, Han Zhang, Chen-Yu Lee, Xiaoqi Ren, Guolong Su, Vincent Perot, Jennifer Dy, and Tomas Pfister. DualPrompt: Complementary Prompting for Rehearsal-Free Continual Learning. In Shai Avidan, Gabriel Brostow, Moustapha Cissé, Giovanni Maria Farinella, and Tal Hassner (eds.), *Computer Vision - ECCV 2022*, pp. 631–648, Cham, 2022b. Springer Nature Switzerland. ISBN 978-3-031-19809-0. Zifeng Wang, Zizhao Zhang, Chen-Yu Lee, Han Zhang, Ruoxi Sun, Xiaoqi Ren, Guolong Su, Vincent Perot, Jennifer Dy, and Tomas Pfister. Learning To Prompt for Continual Learning. In *Proceedings of the* IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 139–149, June 2022c. Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong Learning with Dynamically Expandable Networks. In *International Conference on Learning Representations*, 2018. Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual Learning Through Synaptic Intelligence. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of *Proceedings of Machine Learning Research*, pp. 3987–3995. PMLR, August 2017. Xiaohua Zhai, Joan Puigcerver, Alexander Kolesnikov, Pierre Ruyssen, Carlos Riquelme, Mario Lucic, Josip Djolonga, Andre Susano Pinto, Maxim Neumann, Alexey Dosovitskiy, Lucas Beyer, Olivier Bachem, Michael Tschannen, Marcin Michalski, Olivier Bousquet, Sylvain Gelly, and Neil Houlsby. A Large-scale Study of Representation Learning with the Visual Task Adaptation Benchmark, February 2020. arXiv:1910.04867. Gengwei Zhang, Liyuan Wang, Guoliang Kang, Ling Chen, and Yunchao Wei. SLCA: Slow Learner with Classifier Alignment for Continual Learning on a Pre-trained Model. In *Proceedings of the IEEE/CVF* International Conference on Computer Vision (ICCV), pp. 19148–19158, October 2023. Yuanhan Zhang, Zhenfei Yin, Jing Shao, and Ziwei Liu. Benchmarking Omni-Vision Representation Through the Lens of Visual Realms. In Shai Avidan, Gabriel Brostow, Moustapha Cissé, Giovanni Maria Farinella, and Tal Hassner (eds.), *Computer Vision - ECCV 2022*, pp. 594–611, Cham, 2022. Springer Nature Switzerland. ISBN 978-3-031-20071-7. Da-Wei Zhou, Qi-Wei Wang, Han-Jia Ye, and De-Chuan Zhan. A Model or 603 Exemplars: Towards Memory-Efficient Class-Incremental Learning. In The Eleventh International Conference on Learning Representations, 2023a. Da-Wei Zhou, Han-Jia Ye, De-Chuan Zhan, and Ziwei Liu. Revisiting Class-Incremental Learning with Pre-Trained Models: Generalizability and Adaptivity are All You Need, March 2023b. arXiv:2303.07338. ## Appendix A Training And Implementation Details A.1 Optimization Of Ridge Regression Parameter Λ The optimization process for selecting the regression parameter λ (cf. Alg. 1) proceeds as follows: For each task t, we stratify the training data by ground truth labels and perform a four-fold split. For each split, we temporarily update G and cy for all y ∈ Yt, and calculate the accuracy for values of λ ∈ {10−8, 10−4, 10−3.5, 10−3, 10−2.5, 10−2, 10−1.5, 10−1, 10−0.5, 100, 100.5, 101, 101.5, 102, 102.5, 103} to determine which yields the highest per-sample accuracy on the remaining training data fold. We then calculate the mean accuracy across all folds for each λ and select the value that results in the highest overall accuracy. Finally, we update G and cy for all y ∈ Yt using the complete training dataset for task t, and repeat the process for task t + 1. Note that this procedure, when performed at time t, does not require access to data from any prior task, thus maintaining full compatibility with the rehearsal-free CL setting. ## A.2 Data Augmentation During CL training, data augmentation is applied to all datasets, incorporating random cropping of the images to varying sizes, ranging from 70% to 100% of their original dimensions, while maintaining an aspect ratio between 3:4 and 4:3. After resizing, images are randomly flipped horizontally, and brightness, contrast, saturation, and hue are varied randomly within a 10% range. Finally, the images are center-cropped to 224×224 pixels for all datasets, except for CIFAR-100, where images are directly resized from the original 32×32 to 224×224 pixels. During inference, images of all datasets are resized to 224x224 pixels without further modification. ## A.3 Compute Resources All experiments in this work were conducted on an Ubuntu system version 20.04.6 with a single NVIDIA GeForce RTX 3080 Ti (12GB memory) GPU. ## B Datasets We summarize the datasets compared in the main experiments in Tab. 6. Datasets for the CIL/OCL settings. CIFAR-100 (**CIFAR**) comprises 100 classes of natural images across various domains and topics, aligning relatively closely with the pre-training domains of ImageNet-1K and ImageNet-21K in terms of distribution. ImageNet-R (**IN-R**) consists of image categories that overlap with ImageNet-1K, yet it features out-of-distribution samples for the pre-training dataset, including challenging examples or newly collected data of various styles. Similarly, ImageNet-A (**IN-A**) shares categories with ImageNet-1K but encompasses real-world, adversarially filtered images designed to deceive existing classifiers pre-trained on ImageNet. The Caltech-UCSD Birds-200-2011 (CUB) dataset is a specialized collection of labeled images of 200 bird species, encompassing a diverse range of poses and backgrounds. OmniBenchmark (OB) serves as a compact benchmark designed to assess the generalization capabilities of pre-trained models across semantic super-concepts or realms, encompassing images of 300 categories that represent distinct concepts. The Visual Task Adaptation Benchmark (**VTAB**) as used in our work is a composition of the five datasets Resisc45 (Cheng et al., 2017), DTD (Cimpoi et al., 2014), Pets (Parkhi et al., 2012), EuroSAT (Helber et al., 2019), and Flowers (Nilsback & Zisserman, 2006) and is commonly split into T = 5 tasks in the CL version. The Stanford Cars-196 (**Cars**) dataset comprises images of cars belonging to one of 196 unique combinations of model and make. Datasets for the DIL setting. The Continual Deepfake Detection Benchmark Hard (**CDDB-H**) is a framework designed to evaluate the performance of deepfake detection models under continuously changing attack scenarios (gaugan, biggan, wild, *whichfaceisreal*, and san). DomainNet is a multi-source domain | Setting | Name | Original | CL Formulation | T | Ntrain | Nval | C | |-----------|--------------------------|---------------------|------------------------|--------|----------|---------|-----| | CIL/OCL | CIFAR | Krizhevsky (2009) | Rebuffi et al. (2017b) | 10 | 50 000 | 10 000 | 100 | | IN-R | Hendrycks et al. (2021a) | Wang et al. (2022b) | 10 | 24 000 | 6 000 | 200 | | | IN-A | Hendrycks et al. (2021b) | Zhou et al. (2023b) | 10 | 6 056 | 1 419 | 200 | | | CUB | Wah et al. (2011) | Zhou et al. (2023b) | 10 | 9 465 | 2 323 | 200 | | | OB | Zhang et al. (2022) | Zhou et al. (2023b) | 10 | 89 668 | 5 983 | 300 | | | VTAB | Zhai et al. (2020) | Zhou et al. (2023b) | 5 | 1 796 | 8 619 | 50 | | | Cars | Krause et al. (2013) | Zhang et al. (2023) | 10 | 8 144 | 8 041 | 196 | | | CDDB-H | Li et al. (2023) | Li et al. (2023) | 5 | 16 068 | 10 706 | 2 | | | DIL | S-DomainNet | Peng et al. (2019) | Peng et al. (2019) | 6 | 20 624 | 176 743 | 345 | | IN-R (D) | Hendrycks et al. (2021a) | - | 15 | 24 000 | 6 000 | 200 | | Table 6: Overview of datasets. Original publication, split formulation for CL setting, number of tasks (T) in the main experiments in Sec. 5, number of training samples (Ntrain), number of validation samples (Nval), and number of classes (C). Although IN-R was originally proposed for domain generalization tasks, we are not aware of any prior work to use it in the DIL setting. adaptation benchmark, comprising the six image style domains real, quickdraw, painting, sketch, *infograph*, and *clipart*. As the original training dataset of DomainNet comprises more than 400 000 samples, we use a sub-sampled version of DomainNet (**S-DomainNet**), that caps the number of training samples at 10 per class and domain, while maintaining the original validation set unchanged. Finally, with the domain-incremental split of ImageNet-R (**IN-R (D)**), a sequence of fifteen image style domains is learned (sketch, art, *cartoon*, deviantart, embroidery, graffiti, graphic, misc, origami, painting, sculpture, sticker, tattoo, toy, and *videogame*). ## C Additional Results We use the following two metrics in our work for experimental evaluation: *Average accuracy* At (following the definition of Lopez-Paz & Ranzato (2017)) and *average forgetting* Ft (following the definition of Chaudhry et al. (2018)). Average accuracy is defined as $$A_{t}=\frac{1}{t}\sum_{i=1}^{t}R_{t,i},\tag{1}$$ $$(8)^{\frac{1}{2}}$$ where Rt,i denotes the classification accuracy on task i after training on task t. Using the same notion of Rt,i, average forgetting is defined as $$F_{t}=\frac{1}{t-1}\sum_{i=1}^{t-1}\mathop{\arg\max}_{t^{\prime}\in\{1,...,t-1\}}R_{t^{\prime},i}-R_{t,i}\tag{9}$$ As the number of different classes to choose from in a CIL and an OCL setting grows as new tasks are being introduced, At tends to decrease and Ft tends to rise over the course of training. While we only report on average accuracy metric in the main paper, the experimental results in Appendix C.1, Appendix C.2, and Appendix C.3 are reported both with respect to average accuracy and average forgetting. ## C.1 Variability Across Seeds And Performance Over Time As the choice of the random seed has an influence on both the task order and PETL parameter initialization, we calculate average accuracy and forgetting with standard error for all seven datasets over the course of class-incremental training (phase B in Alg. 1) using seeds 1993-1997. Results are shown in Fig. 6. There are almost no differences between final performance after the last task across seeds, which indicates LayUP being robust to different task orders and initialization of PETL parameters. The highest variability can be observed for the VTAB benchmark, where we have T = 5 and classes belong to very distinct domains. Therefore, the task order–and consequently the set of classes that the representations are adjusted to during first session adaptation–has a greater influence on the generalization capabilities of the model during CL. As expected, the average forgetting increases as more tasks are being introduced, as the model has more classes to tell apart during inference. ## C.2 Experiments With Different Layer Choice K To analyze the learning behavior over time in the CIL setting among different choices of maximum representation depth k for prototype construction, we plot average accuracy and forgetting for k = 1 (last layer only), k = 6, and k = 12 (all layers) in Fig. 7. Clearly, the classification performance based on last layer representations only is inferior to multi-layer representations as used in LayUP, as it yields both a lower accuracy and a higher forgetting rate. At the same time, there is no performance difference between k = 6 and k = 12 evident, indicating that the model's early layers do not contribute meaningful knowledge to the classification process, yet they do not detriment it either. Considering that the choice of k is subject to a trade-off between performance gain and both memory and computational costs, the results corroborate k = 6, as used in the main experiments detailed in Sec. 5, to be a reasonable choice. ## C.3 Experiments With Different Backbones And Petl Methods Following prior works (Zhou et al., 2023b; McDonnell et al., 2023), we experiment with different PETL methods and ViT-B/16 models for LayUP, as the additional benefit from additional fine-tuning of the representations differs depending on the characteristics of the downstream domain (Panos et al., 2023). Results are shown in Fig. 8. In all but one dataset, we found adapter methods (AdaptFormer) to be superior to be superior to prompt learning (VPT) or feature modulation (SSF). However, there is no combination of PETL method and pre-trained model that generally outperforms all other variants. Such results confirm the findings of (Panos et al., 2023) and underline the importance of considering different pre-training schemes and strategies for additional fine-tuning. ## C.4 Experiments With Different Task Counts T To show whether a benefit of multi-layer representations can be observed for different task counts, we compare average accuracy scores after training for six different datasets, three different task counts T ∈ {5, 10, 20}, and three different choices of k last layers for class prototype generation. k = 1 corresponds to classification only based on the last layer (i.e., final) representations of the backbone, as it is done in prior work. k = 6 means to concatenate layer-wise features from the latter half of the network layers. Finally, k = 12 uses concatenated features of all layers of the pre-trained ViT for classification. Results are presented in Tab. 7. Performance scores across task counts and datasets are consistently higher for multi-layer representations (k = 6 and k = 12) compared with only final representations (k = 1). However, there is no considerable difference in performance between k = 6 and k = 12. Thus, incorporating intermediate representations from layers in the second half of the model provides sufficient information for class separation, while features from early layers contribute minimally. This supports the observations noted in the preliminary analysis in Sec. 4.1. | k | T | CIFAR | IN-R | IN-A | CUB | OB | Cars | |-----|------|---------|--------|--------|-------|------|--------| | 5 | 89.5 | 80.4 | 61.9 | 85.0 | 72.4 | 75.1 | | | 1 | 10 | 89.2 | 79.2 | 60.8 | 85.3 | 71.6 | 75.5 | | 20 | 88.4 | 77.3 | 57.1 | 83.6 | 72.2 | 75.6 | | | 5 | 91.8 | 82.8 | 64.0 | 87.1 | 77.4 | 81.7 | | | 6 | 10 | 91.0 | 81.2 | 62.2 | 87.3 | 77.5 | 82.5 | | 20 | 88.8 | 79.9 | 59.6 | 85.9 | 77.4 | 82.2 | | | 5 | 91.6 | 83.2 | 64.0 | 87.4 | 78.3 | 82.1 | | | 12 | 10 | 90.8 | 80.8 | 62.8 | 88.0 | 77.8 | 82.3 | | 20 | 88.9 | 80.2 | 60.0 | 86.0 | 78.1 | 82.8 | | Table 7: Average accuracy (%) after training: Comparison of different task counts T for k = 1 (prototype construction from last layer only), k = 6 (prototype construction from second half of the network layers, as utilized in Sec. 5), and k = 12 (prototype construction from all network layers). Scores listed are for AdaptFormer and ViT-B/16-IN1K. VTAB is omitted from the comparison due to its fixed number of datasets from which tasks are constructed (T = 5). ![24_image_0.png](24_image_0.png) Figure 6: Average accuracy (*left*) and average forgetting (*right*) after training on each task t in the CIL setting: Variability across random seeds for each ViT-B/16 models after first session training with AdaptFormer as PETL method. Results are reported for seeds 1993-1997 to ensure reproducibility with the resulting standard error indicated by shaded area. ![25_image_0.png](25_image_0.png) Figure 7: Average accuracy (left) and average forgetting (right) after training on each task t in the CIL setting: Comparison of different choices of k last layers for prototype construction (k E {1,6,12}) and ViT-B/16 models after first session training with AdaptFormer as PETL method. ![26_image_0.png](26_image_0.png) Figure 8: Average accuracy (*left*) and average forgetting (*right*) after training on each task t in the CIL setting: Comparison of different PETL methods (AdaptFormer (Chen et al., 2022), SSF (Lian et al., 2022), and VPT (Jia et al., 2022)) and ViT-B/16 models.
Review 1: Summary: This paper proposed a simple approach by using the features from middle layers for rehearsal free continuous learning with a pretrained model. This work improved previous work RanPAC by using features from multiple layers without random projection to achieve better results with less computations. The experimental results outperformed all prototype-based methods in CIL, DIL and online learning. Strengths and Weaknesses: Strengths 1. The paper is well-written and east to understand. 2. The idea is simple and effective, without complicated processes to achieve good results 3. The flow of paper is smooth, from the inspiration of feature importance of middle layers and then design how to use the features together to help performance. Weaknesses 1. Exploiting intra-layer features via GRAM matrix is explored in RANPAC, this paper extends that to include middle layers. 2. In contribution 2, the authors mentioned to decorrelate class prototypes by both intra- and inter-layer features but for the remaining paper, the authors do not discuss the inter part. Requested Changes: 1. I wonder what if the authors combine RanPAC with multi-layer features as the authors did? It seems that the random projection helps a lot (Based on the results in table 1 and 2, when k equals to 1, it is usually worse than RanPAC). I wondering that how good the results will be if combining them? 2. Is it necessary to have consecutive layers, and can the proposed method to be used in the network whose dimension is different from each layer? 3. How to decide the k in practice? As shown in Table 4, the performance varied case by case. Especially when a deep model is using, there are more options of k are available. 4. In algorithm 1, G and cy need to be initialized. Broader Impact Concerns: N/A ================================================== Review 2: Summary: This paper introduces a class-prototype approach, LayUP, which leverages second-order feature statistics from multiple intermediate layers of a pre-trained network for continual learning (CL). This method addresses the limitation of existing CL approaches that only use features from the final representation layer. The paper claims that LayUP improves performance across various CL benchmarks without requiring rehearsal of prior data. Strengths and Weaknesses: Strengths: This paper utilizes intra-layer features from pre-trained models, deviating from traditional methods that focus solely on the final layer. Weaknesses: 1. Does not consistently outperform existing methods across all tested benchmarks, raising questions about its efficacy. 2. Lacks a robust theoretical justification for the use of intra-layer representations and does not fully address potential limitations. 2. The paper does not thoroughly discuss the increased computational complexity and its implications for practical deployment. Requested Changes: 1. **Preliminaries Section**: The section could be improved by clarifying the motivation and specific advantages of class-prototype methods over other strategies, especially in terms of handling "full body adaptation" and "linear probing." These terms need better definition and contextualization within the framework of CL. 2. **Definition of $\bar{c}_y$ in Eq. (1)**: The paper should clearly define this term, as it is crucial for understanding the model's operation and the formulation of its prototype-based classification approach. 3. **Choice of $k$ in Eq. (4)**: The method for selecting $k$, which represents the number of layers considered for feature extraction, is not clear. More guidance on how to choose $k$ effectively based on different datasets or task characteristics would be beneficial. 4. **Computational Complexity**: There's a concern that while the inclusion of higher dimension features through $\Phi_{-k}$ might enhance performance, it also leads to increased computational complexity. It would be helpful if the paper could discuss any potential trade-offs and how they might be mitigated. 5. **Consistency Across Datasets**: The observation that LayUP only excels in four out of seven benchmarks might suggest its performance variability with different types of data. This aspect should be explored more thoroughly, perhaps by analyzing characteristics of datasets where LayUP underperforms. Broader Impact Concerns: NA ================================================== Review 3: Summary: The paper considers the problem of continual learning (CL) with pre-trained models. The authors study a particular family of CL methods that use prototypes along with parameter-efficient fine-tuning to solve the problem. These methods use the representations from the last layer of the backbone to create prototypes. However, the authors point out that the features present in earlier layers might also be beneficial for the predictions and use this observation to create the LayUP approach. The authors show that this method works well, often outperforming prior state-of-the-art results. They also propose various ablation studies, showing how changing the number of layers impacts the results and how different approaches to adaptation perform. Strengths and Weaknesses: Essentially, the paper proposes a very simple and rather iterative improvement over previous methods such as Adam and NMC+FSA, namely, using a larger number of layers. However, the proposed change does lead to significantly better results. As such, I think this study would be of interest to practitioners and researchers in the area of continual learning with large pre-trained models. Strengths: - The proposed improvement is extremely simple and leads to very good results on a wide array of benchmarks. - The empirical setup is sufficient to support the claims made in the paper. The authors test quite a few datasets and provide useful ablation studies on top of that. Also, I don’t recall any relevant methods that the authors should add to their comparison. One thing to improve would be to add other domains than images, but the current scope is sufficient. - The paper is clearly written and easy to read. - The paper describes the related work well. Weaknesses: - Since the proposed improvement (using more layers) is somewhat orthogonal to other components of the CL training, I think it is important to ask how it combines with other methods. What if one were to use both pre-trained and fine-tuned features as in Adam but with multiple layers? Or use the RanPAC’s projections using a larger number of layers. I think this is an important angle that was not studied in this paper. - In the end, the paper is not very novel and fairly incremental with respect to previous work. However, novelty is not an important criterion for TMLR, so I still think it should be accepted, as the empirical gains obtained through this simple improvement should be of interest to the audience. Requested Changes: I would appreciate additional experiments on using more layers in combination with different methods (RanPAC, Adam). Even a small-scale study on a single dataset would be interesting. Broader Impact Concerns: N/A ================================================== Metareview: Recommendation: Accept as is Comment: The paper's provides a valuable baseline for the continual learning, grounded in a simple but efficient approach to leverage feature statistics from intermediate layers of a pre-trained network for rehearsal-free continual learning. The revised version of the paper thoroughly addressed the reviewers' concerns around a number of criteria and would be a good addition to the journal. As described in the justification for the audience, the authors address a number of points of concern. Therefore, the recommendation is to accept the work. The paper does not provide a survey, and its purpose is not to reproduce other methods. So, I would suggest there would be no recommendations for certifications in this case. ==================================================
# Flexecontrol: Flexible And Efficient Multimodal Control For Text-To-Image Generation Anonymous authors Paper under double-blind review ## Abstract Controllable text-to-image (T2I) diffusion models generate images conditioned on both text prompts and semantic inputs of other modalities like edge maps. Nevertheless, current controllable T2I methods commonly face challenges related to efficiency and faithfulness, especially when conditioning on multiple inputs from either the same or diverse modalities. In this paper, we propose a novel *Flexible* and *Efficient* method, FlexEControl, for controllable T2I generation. At the core of FlexEControl is a unique weight decomposition strategy, which allows for streamlined integration of various input types. This approach not only enhances the faithfulness of the generated image to the control, but also significantly reduces the computational overhead typically associated with multimodal conditioning. Our approach achieves a reduction of 41% in trainable parameters and 30% in memory usage compared with Uni-ControlNet. Moreover, it doubles data efficiency and can flexibly generate images under the guidance of multiple input conditions of various modalities. ## 1 Introduction In the realm of text-to-image (T2I) generation, diffusion models exhibit exceptional performance in transforming textual descriptions into visually accurate images. Such models exhibit extraordinary potential across a plethora of applications, spanning from content creation (Rombach et al., 2022; Saharia et al., 2022b; Nichol et al., 2021; Ramesh et al., 2021a; Yu et al., 2022; Avrahami et al., 2023; Chang et al., 2023), image editing (Balaji et al., 2022; Kawar et al., 2023; Couairon et al., 2022; Zhang et al., 2023; Valevski et al., 2022; Nichol et al., 2021; Hertz et al., 2022; Brooks et al., 2023; Mokady et al., 2023), and also fashion design (Cao et al., 2023). We propose a new unified method that can tackle two problems in text-to-image generation: improve the training efficiency of T2I models concerning memory usage, computational requirements, and a thirst for extensive datasets (Saharia et al., 2022a; Rombach et al., 2022; Ramesh et al., 2021b); and improve their controllability especially when dealing with multimodal conditioning, e.g. multiple edge maps and at the same time follow the guidance of text prompts, as shown in Figure 1 (c). Controllable text-to-image generation models (Mou et al., 2023) often come at a significant training computational cost, with linear growth in cost and size when training with different conditions. Our approach can improve the training efficiency of existing text-to-image diffusion models and unify and flexibly handle different structural input conditions all together. We take cues from the efficient parameterization strategies prevalent in the NLP domain (Pham et al., 2018; Hu et al., 2021; Zaken et al., 2021; Houlsby et al., 2019) and computer vision literature (He et al., 2022). The key idea is to learn shared decomposed weights for varied input conditions, ensuring their intrinsic characteristics are conserved. Our method has several benefits: It not only achieves greater compactness (Rombach et al., 2022), but also retains the full representation capacity to handle various input conditions of various modalities; Sharing weights across different conditions contributes to the data efficiency; The streamlined parameter space aids in mitigating overfitting to singular conditions, thereby reinforcing the flexible control aspect of our model. Meanwhile, generating images from multiple homogeneous conditional inputs, especially when they present conflicting conditions or need to align with specific text prompts, is challenging. To further augment our model's capability to handle multiple inputs from either the same or diverse modalities as shown in Figure 1, ![1_image_0.png](1_image_0.png) Figure 1: (a) FlexEControl excels in training efficiency, achieving superior performance with just half the training data compared to its counterparts on (b) Controllable Text-to-Image Generation w. Different Input Conditions (one edge map and one segmentation map). (c) FlexEControl effectively conditions on two canny edge maps. The text prompt is Stormtrooper's lecture at the football field in both Figure (b) and Figure (c). during training, we introduce a new training strategy with two new loss functions introduced to strengthen the guidance of corresponding conditions. This approach, combined with our compact parameter optimization space, empowers the model to learn and manage multiple controls efficiently, even within the same category (e.g., handling two distinct segmentation maps and two separate edge maps). Our primary contributions are summarized below: - We propose FlexEControl, a novel text-to-image generation model for efficient controllable image generation that substantially reduces training memory overhead and model parameters through decomposition of weights shared across different conditions. - We introduce a new training strategy to improve the flexible controllability of FlexEControl. Compared with previous works, FlexEControl can generate new images conditioning on multiple inputs from diverse compositions of multiple modalities. - FlexEControl shows on-par performance with Uni-ControlNet (Zhao et al., 2023) on controllable textto-image generation with 41% less trainable parameters and 30% less training memory. Furthermore, FlexEControl exhibits enhanced data efficiency, effectively doubling the performance achieved with only half amount of training data. ## 2 Method The overview of our method is shown in Figure 2. In general, we use the copied Stable Diffusion encoder (Stable Diffusion encoder block and Stable Diffusion middle block) which accepts structural conditional input and then perform efficient training via parameter reduction using Kronecker Decomposition first (Zhang et al., ![2_image_0.png](2_image_0.png) $$(1)$$ Figure 2: **Overview of FlexEControl**: a decomposed green matrix is shared across different input conditions, significantly enhancing the model's efficiency and preserving the image content. During training, we integrate two specialized loss functions to enable flexible control and to adeptly manage conflicting conditions. In the example depicted here, the new parameter size is efficiently condensed to 4 + 6n, where n denotes the number of decomposed matrix pairs. 2021a) and then low-rank decomposition over the updated weights of the copied Stable Diffusion encoder. To enhance the control from language and different input conditions, we propose a new training strategy with two newly designed loss functions. The details are shown in the sequel. ## 2.1 Preliminary We use Stable Diffusion 1.5 (Rombach et al., 2022) in our experiments. This model falls under the category of Latent Diffusion Models (LDM) that encode input images x into a latent representation z via an encoder E, such that z = E(x), and subsequently carry out the denoising process within the latent space Z. An LDM is trained with a denoising objective as follows: $${\mathcal{L}}_{\mathrm{Idm}}=\mathbb{E}_{z,c,e,t}\left[\left\|{\hat{\epsilon}}_{\theta}(z_{t}\mid c,t)-\epsilon\right\|^{2}\right]\tag{1}$$ 2i(1) where (*z, c*) constitute data-conditioning pairs (comprising image latents and text embeddings), ϵ ∼ N (0, I) , t ∼ Uniform(1, T), and θ denotes the model parameters. ## 2.2 Efficient Training For Controllable Text-To-Image (T2I) Generation Our approach is motivated by empirical evidence that Kronecker Decomposition (Zhang et al., 2021a) effectively preserves critical weight information. We employ this technique to encapsulate the shared relational structures among different input conditions. Our hypothesis posits that by amalgamating diverse conditions with a common set of weights, data utilization can be optimized and training efficiency can be improved. We focus on decomposing and fine-tuning only the cross-attention weight matrices within the U-Net (Ronneberger et al., 2015) of the diffusion model, where recent works (Kumari et al., 2023) show their dominance when customizing the diffusion model. As depicted in Figure 2, the copied encoder from the Stable Diffusion will accept conditional input from different modalities. During training, we posit that these modalities, being transformations of the same underlying image, share common information. Consequently, we hypothesize that the updated weights of this copied encoder, ∆W, can be efficiently adapted within a shared decomposed low-rank subspace. This leads to: $$\Delta W=\sum_{i=1}^{n}H_{i}\otimes\left(u_{i}v_{i}^{\top}\right)$$ (2) with n is the number of decomposed matrices, ui ∈ R k n ×r and vi ∈ R r× dn , where r is the rank of the matrix which is a small number, Hi are the decomposed learnable matrices shared across different conditions, and ⊗ is the Kronecker product operation. The low-rank decomposition ensures a consistent low-rank representation $$\left(2\right)$$ ![3_image_0.png](3_image_0.png) ![3_image_1.png](3_image_1.png) Figure 3: The visualization of decomposed shared "slow" weights (right image) for a single condition case where the input conditions (left image) are the segmentation, depth, and sketch maps, with the text prompt Dog, Soccer player, Basketball player. We averaged the decomposed shared weights from the last cross-attention block across all attention heads in Stable Diffusion. The results demonstrate the content-preserving properties of Kronecker Decomposition. strategy. This approach substantially saves trainable parameters, allowing efficient fine-tuning over the downstream text-to-image generation tasks. The intuition for why Kronecker decomposition works for finetuning partially is partly rooted in the findings of Zhang et al. (2021a); Mahabadi et al. (2021); He et al. (2022). These studies highlight how the model weights can be broken down into a series of matrix products and thereby save parameter space. As shown in Figure 2, the original weights is 6x6, then decomposed into a series of matrix products. When adapting the training approach based on the decomposition to controllable T2I, the key lies in the shared weights, which, while being common across various conditions, retain most semantic information. The Kronecker Decomposition is known for its multiplicative rank property and content-preserving qualities. For instance, the shared "slow" weights (Wen et al., 2020) of an image, combined with another set of "fast" low-rank weights, can preserve the original image's distribution without a loss in semantic integrity, as illustrated in Figure 3. This observation implies that updating the slow weights is crucial for adapting to diverse conditions. Following this insight, it becomes logical to learn a set of condition-shared decomposed weights in each layer, ensuring that these weights remain consistent across different scenarios. The data utilization and parameter efficiency is also improved. ## 2.3 Enhanced Training For Conditional Inputs We then discuss how to improve the control under multiple input conditions of varying modalities with the efficient training approach. Dataset Augmentation with Text Parsing and Segmentation To optimize the model for scenarios involving multiple homogeneous (same-type) conditional inputs, we initially augment our dataset. We utilize a large language model (gpt-3.5-turbo) to parse texts in prompts containing multiple object entities. The parsing query is structured as: Given a sentence, analyze the objects in this sentence, give me the objects if there are multiple. Following this, we apply CLIPSeg (Lüddecke and Ecker, 2022) (clipseg-rd64-refined version) to segment corresponding regions in the images, allowing us to divide structural conditions into separate sub-feature maps tailored to the parsed objects. These segmentation masks are selectively used to augment the dataset, specifically when there is a clear, single mask for each identified object. This selective approach helps maintain the robustness of the dataset and enhances training performance. Cross-Attention Supervision Loss For each identified segment, we calculate a unified attention map, Ai, averaging attention across layers and relevant N text tokens: $$\mathbf{A}_{i}={\frac{1}{L}}\sum_{l=1}^{L}\sum_{i=1}^{N}[T_{i}\in\mathcal{T}_{j}]\mathbf{CA}_{i}^{l},\tag{1}$$ $\eqref{eq:walpha}$ where J·K is the Iverson bracket, CAli is the cross-attention map for token i in layer l, and Tj denotes the set of tokens associated with the j-th segment. The model is trained to predict noise for image-text pairs concatenated based on the parsed and segmented results. An additional loss term, designed to ensure focused reconstruction in areas relevant to each textderived concept, is introduced. This loss is calculated as the Mean Squared Error (MSE) deviation from predefined masks corresponding to the segmented regions: $${\mathcal{L}}_{\mathrm{ca}}=\mathbb{E}_{z,t}\left[\|A_{i}(v_{i},z_{t})-M_{i}\|_{2}^{2}\right],$$ $$|\rangle$$ i, (4) where Ai(vi, zt) is the cross-attention map between token vi and noisy latent zt, and Mi represents the mask for the i-th segment, which is derived from the segmented regions in our augmented dataset and appropriately resized to match the dimensions of the cross-attention maps. Masked Diffusion Loss To ensure fidelity to the specified conditions, we apply a condition-selective diffusion loss that concentrates the denoising effort on conceptually significant regions. This focused loss function is applied solely to pixels within the regions delineated by the concept masks, which are derived from the non-zero features of the input structural conditions. Specifically, the masks are binary where non-zero feature areas are assigned a value of one, and areas lacking features are set to zero. Because of the sparsity of pose features for this condition, we use the all-ones mask. These masks serve to underscore the regions referenced in the corresponding text prompts: $${\cal L}_{\mathrm{mask}}=\mathbb{E}_{z,\epsilon,t}\left[\left\|(\epsilon-\epsilon_{\theta}(z_{t},t))\odot M\right\|_{2}^{2}\right],\tag{1}$$ $\left(5\right)^2$ $\mathcal{L}_{\rm total}=\mathcal{L}_{\rm ldm}+\lambda_{\rm ca}\mathcal{L}_{\rm ca}+\lambda_{\rm mask}\mathcal{L}_{\rm mask}$, $\mathcal{L}_{\rm max}=\mathcal{L}_{\rm ldm}+\lambda_{\rm ca}\mathcal{L}_{\rm ca}+\lambda_{\rm mask}\mathcal{L}_{\rm mask}$, $$({\mathfrak{h}})$$ where M represents the union of binary mask obtained from input conditions, zt denotes the noisy latent at timestep t, ϵ the injected noise, and ϵθ the estimated noise from the denoising network (U-Net). The total loss function employed is: Ltotal = Lldm + λcaLca + λmaskLmask, (6) with λrec and λattn set to 0.01. The integration of Lca and Lmask ensure the model will focus at reconstructing the conditional region and attend to guided regions during generation. ## 3 Experiments 3.1 Datasets In pursuit of our objective of achieving controlled Text-to-Image (T2I) generation, we employed the LAION improved_aesthetics_6plus (Schuhmann et al., 2022) dataset for our model training. Specifically, we meticulously curated a subset comprising 5,082,236 instances, undertaking the elimination of duplicates and applying filters based on criteria such as resolution and NSFW score. Given the targeted nature of our controlled generation tasks, the assembly of training data involved considerations of additional input conditions, specifically edge maps, sketch maps, depth maps, segmentation maps, and pose maps. The extraction of features from these maps adhered to the methodology expounded in(Zhang and Agrawala, 2023). ## 3.2 Experimental Setup Structural Input Condition Extraction We start from the processing of various local conditions used in our experiments. To facilitate a comprehensive evaluation, we have incorporated a diverse range of structural conditions. These conditions include edge maps (Canny, 1986; Xie and Tu, 2015; Gu et al., 2022a), sketch maps (Simo-Serra et al., 2016), pose information (Cao et al., 2017), depth maps (Ranftl et al., 2020), and segmentation maps (Xiao et al., 2018), each extracted using specialized techniques. These conditions are crucial for guiding the text-to-image generation process, enabling FlexEControl to produce images that are both visually appealing and semantically aligned with the text prompts and structural inputs. The additional details for extracting those conditions are given in the Appendix. Evaluation Metrics We employ a comprehensive benchmark suite of metrics including mIoU (Rezatofighi et al., 2019), SSIM (Wang et al., 2004), mAP, MSE, FID (Heusel et al., 2017), and CLIP Score (Hessel et al., 2021; Radford et al., 2021) 1. 1https://github.com/jmhessel/clipscore Table 1: **Text-to-image generation efficiency comparison**: FlexEControl shows substantial reductions in memory cost, trainable parameters, and training time, highlighting its improved training efficiency with the same model architecture. Training times are averaged over three runs up to 400 iterations for consistency. | Models | Memory Cost ↓ | # Params. ↓ | Training Time ↓ | |------------------------------------|-----------------|---------------|-------------------| | Uni-ControlNet (Zhao et al., 2023) | 20.47GB | 1271M | 5.69 ± 1.33s/it | | LoRA (Hu et al., 2021) | 17.84GB | 1074M | 3.97 ± 1.27 s/it | | PHM (Zhang et al., 2021a) | 15.08GB | 819M | 3.90 ± 2.01 s/it | | FlexEControl (ours) | 14.33GB | 750M | 2.15 ± 1.42 s/it | | Models | Canny | MLSD | HED | Sketch | Depth | Segmentation | Poses | FID↓ | CLIP Score↑ | |---------------------------------------|---------|---------|---------|----------|---------|----------------|---------|--------|---------------| | (SSIM)↑ | (SSIM)↑ | (SSIM)↑ | (SSIM)↑ | (MSE)↓ | (mIoU)↑ | (mAP)↑ | | | | | T2IAdapter (Mou et al., 2023) | 0.4480 | - | - | 0.5241 | 90.01 | 0.6983 | 0.3156 | 27.80 | 0.4957 | | ControlNet (Zhang and Agrawala, 2023) | 0.4989 | 0.6172 | 0.4990 | 0.6013 | 89.08 | 0.7481 | 0.2024 | 27.62 | 0.4931 | | Uni-Control (Qin et al., 2023) | 0.4977 | 0.6374 | 0.4885 | 0.5509 | 90.04 | 0.7143 | 0.2083 | 27.80 | 0.4899 | | Uni-ControlNet (Zhao et al., 2023) | 0.4910 | 0.6083 | 0.4715 | 0.5901 | 90.17 | 0.7084 | 0.2125 | 27.74 | 0.4890 | | PHM (Zhang et al., 2021a) | 0.4365 | 0.5712 | 0.4633 | 0.4878 | 91.38 | 0.5534 | 0.1664 | 27.91 | 0.4961 | | LoRA (Hu et al., 2021) | 0.4497 | 0.6381 | 0.5043 | 0.5097 | 89.09 | 0.5480 | 0.1538 | 27.99 | 0.4832 | | FlexEControl (ours) | 0.4990 | 0.6385 | 0.5041 | 0.5518 | 90.93 | 0.7496 | 0.2093 | 27.55 | 0.4963 | Table 2: **Quantitative evaluation of controllability and image quality** for single structural conditional inputs. FlexEControl performs overall better while maintaining much improved efficiency. Baselines In our comparative evaluation, we assess T2I-Adapter (Mou et al., 2023), PHM (Zhang et al., 2021a), Uni-ControlNet (Zhao et al., 2023), and LoRA (Hu et al., 2021). The implementation details are given in the Appendix. Implementation Details In accordance with the configuration employed in Uni-ControlNet, we utilized Stable Diffusion 1.5 2 as the foundational model. Our model underwent training for a singular epoch, employing the AdamW optimizer (Kingma and Ba, 2014) with a learning rate set at 10−5. Throughout all experimental iterations, we standardized the dimensions of input and conditional images to 512 × 512. The fine-tuning process was executed on P3 AWS EC2 instances equipped with 64 NVIDIA V100 GPUs. For baseline implementations, we compare FlexEControl with T2I-Adapter (Mou et al., 2023), PHM (Zhang et al., 2021a), Uni-ControlNet (Zhao et al., 2023), and LoRA (Hu et al., 2021) where we implement LoRA and PHM layers over the trainable modules in Uni-ControlNet interms of generated image quality and controllability. The rank of LoRA is set to 4. For PHM (Zhang et al., 2021a), we implement it by performing Kronecker decomposition and share weights across different layer, with the number of decomposed matrix being 4. For quantitative assessment, a subset comprising 10,000 high-quality images from the LAION improved_aesthetics_6.5plus dataset was utilized. The resizing of input conditions to 512 × 512 was conducted during the inference process. The framework is further extended to accommodate video generation. The results can be found in the Appendix. In training the controllable video generation model with multiple input conditions, a straightforward strategy is employed to mask out conditions during the training process. In each iteration, a random sample, denoted as Ns, is drawn from [1, N], where N is the number of total frames, to determine the number of frames that will incorporate the conditions. Subsequently, Ns unique values are drawn from the set and the conditions are retained for the corresponding frames. Table 3: **Quantitative evaluation of controllability and image quality** on FlexEControl along with its variants and Uni-ControlNet. For Uni-ControlNet, we implement multiple conditioning by adding two homogeneous conditional images after passing them through the feature extractor. | Models | Canny | MLSD | HED | Sketch | Depth | Segmentation | Poses | FID↓ | CLIP Score↑ | |------------------------|---------|---------|---------|----------|---------|----------------|---------|--------|---------------| | (SSIM)↑ | (SSIM)↑ | (SSIM)↑ | (SSIM)↑ | (MSE)↓ | (mIoU)↑ | (mAP)↑ | | | | | Uni-ControlNet | 0.3268 | 0.4097 | 0.3177 | 0.4096 | 98.80 | 0.4075 | 0.1433 | 29.43 | 0.4844 | | FlexEControl (w/o Lca) | 0.3698 | 0.4905 | 0.3870 | 0.4855 | 94.90 | 0.4449 | 0.1432 | 28.03 | 0.4874 | | FlexEControl | 0.3711 | 0.4920 | 0.3871 | 0.4869 | 94.83 | 0.4479 | 0.1432 | 28.03 | 0.4877 | | Uni-ControlNet | 0.3078 | 0.3962 | 0.3054 | 0.3871 | 98.84 | 0.3981 | 0.1393 | 28.75 | 0.4828 | | FlexEControl (w/o Lca) | 0.3642 | 0.4901 | 0.3704 | 0.4815 | 94.95 | 0.4368 | 0.1405 | 28.50 | 0.4870 | | FlexEControl | 0.3690 | 0.4915 | 0.3784 | 0.4849 | 92.90 | 0.4429 | 0.1411 | 28.24 | 0.4873 | Single Conditioning Uni-ControlNet 0.3268 0.4097 0.3177 0.4096 98.80 0.4075 **0.1433** 29.43 0.4844 FlexEControl (w/o Lca) 0.3698 0.4905 0.3870 0.4855 94.90 0.4449 0.1432 28.03 0.4874 FlexEControl (w/o L*mask*) 0.3701 0.4894 0.3805 **0.4879 94.30** 0.4418 0.1432 28.19 0.4570 FlexEControl **0.3711 0.4920 0.3871** 0.4869 94.83 **0.4479** 0.1432 **28.03 0.4877** Multiple Conditioning Uni-ControlNet 0.3078 0.3962 0.3054 0.3871 98.84 0.3981 0.1393 28.75 0.4828 FlexEControl (w/o Lca) 0.3642 0.4901 0.3704 0.4815 94.95 0.4368 0.1405 28.50 0.4870 FlexEControl (w/o L*mask*) 0.3666 0.4834 0.3712 0.4831 94.89 0.4400 0.1406 28.68 0.4542 FlexEControl **0.3690 0.4915 0.3784 0.4849 92.90 0.4429 0.1411 28.24 0.4873** ## 3.3 Quantitative Results Table 1 highlights FlexEControl's superior efficiency compared to Uni-ControlNet. It achieves a 30% reduction in memory cost, lowers trainable parameters by 41% (from 1271M to 750M), and significantly reduces training time per iteration from 5.69s to 2.15s. Table 2 provides a comprehensive comparison of FlexEControl's performance against Uni-ControlNet and T2IAdapter across diverse input conditions. After training on a dataset of 5M text-image pairs, FlexEControl demonstrates better, if not superior, performance metrics compared to Uni-ControlNet and T2IAdapter. Note that Uni-ControlNet is trained on a much larger dataset (10M text-image pairs from the LAION dataset). Although there is a marginal decrease in SSIM scores for sketch maps and mAP scores for poses, FlexEControl excels in other metrics, notably surpassing Uni-ControlNet and T2IAdapter. This underscores our method's proficiency in enhancing efficiency and elevating overall quality and accuracy in controllable text-to-image generation tasks. To validate FlexEControl's effectiveness in handling multiple structural conditions, we compared it with Uni-ControlNet through human evaluations. Two scenarios were considered: multiple homogeneous input conditions (300 images, each generated with 2 canny edge maps) and multiple heterogeneous input conditions (500 images, each generated with 2 randomly selected conditions). Results, summarized in Table 4, reveal that FlexEControl was preferred by 64.00% of annotators, significantly outperforming Uni-ControlNet (23.67%). This underscores FlexEControl's proficiency with complex, homogeneous inputs. Additionally, FlexEControl demonstrated superior alignment with input conditions (67.33%) compared to Uni-ControlNet (23.00%). In scenarios with random heterogeneous conditions, FlexEControl was preferred for overall quality and alignment over Uni-ControlNet. In addition to our primary comparisons, we conducted an additional quantitative evaluation of FlexEControl and Uni-ControlNet. This evaluation focused on assessing image quality under scenarios involving multiple conditions from both the homogeneous and heterogeneous modalities. The findings of this evaluation are summarized in Table 5. FlexEControl consistently outperforms Uni-ControlNet in both categories, demonstrating lower FID scores for better image quality and higher CLIP scores for improved alignment with text prompts. ## 3.3.1 Ablation Studies To substantiate the efficacy of FlexEControl in enhancing training efficiency while upholding commendable model performance, and to ensure a fair comparison, an ablation study was conducted by training models on an identical dataset. We trained FlexEControl along its variants and Uni-ControlNet on a subset of 100,000 training samples from LAION improved_aesthetics_6plus. When trained with the identical data, FlexEControl performs better than Uni-ControlNet. The outcomes are presented in Table 3. Evidently, FlexEControl exhibits substantial improvements over Uni-ControlNet when trained on the same dataset. This underscores the effectiveness of our approach in optimizing data utilization, concurrently diminishing computational costs, and enhancing efficiency in the text-to-image generation process. 2https://huggingface.co/runwayml/stable-diffusion-v1-5 ![7_image_1.png](7_image_1.png) ![7_image_0.png](7_image_0.png) (a) FlexEControl performs the best when both λca = 0.01 and λmask = 0.01. (b) Qualitative comparison. The text prompt is A mechanical whale flying over a desert that has a tree. Figure 4: Quantitative and qualitative comparison showing the effect of excluding cross-attention supervision ![7_image_2.png](7_image_2.png) loss and masked diffusion loss. Figure 5: Qualitative comparison of FlexEControl and existing controllable diffusion models with single condition. Text prompt: A bed. The image quality of FlexEControl is comparable to existing methods and Uni-ControlNet + LoRA, while FlexEControl has much more efficiency. We also study the impact of λca and λmask trained on the subset of 100,000 samples from LAION improved_aesthetics_6plus for 6,000 steps. We evaluated the score on SSIM of canny edge maps and mIoU of segmentation maps, results are shown in Figure 4. As observed, FlexEControl achieves optimal performance when both λca = 0.01 and λmask = 0.01. Additionally, as indicated in Table 3, FlexEControl outperforms the configurations where either λca or λmask is set to zero, demonstrating the importance of incorporating both the cross-attention supervision loss and the masked diffusion loss. However, higher values of λca and λmask could lead to instability during training, causing the model to focus excessively on local conditions, which results in worse performance. We also show the qualitative comparison of λca and λmask in Figure 4. Without the cross-attention loss, the concept of the whale tends to merge with the tree, causing attribute leakage and misblending issues. Without the masked diffusion loss, the model is more likely to generate the whale outside the intended region, leading to blurred regions and a lack of focus within the maps. ## 3.3.2 Additional Results On Stable Diffusion 2 In our efforts to explore the versatility and adaptability of FlexEControl, we conducted additional experiments using the Stable Diffusion 2.1 model, available at Hugging Face's Model Hub. The results from these experiments are depicted in Table 6. FlexEControl can leverage the advancements in Stable Diffusion 2.1 to ![8_image_0.png](8_image_0.png) Figure 6: Qualitative comparison of FlexEControl and existing controllable diffusion models with multiple heterogeneous conditions. First row: FlexEControl effectively integrates both the segmentation and edge maps to generate a coherent image while Uni-ControlNet and LoRA miss the segmentation map and Uni-Control generates a messy image. Additionally, the cats generated by Uni-ControlNet, LoRA, and Uni-Control lack clear feline characteristics and does not align with the edge map. Second row: The input condition types are one depth map and one sketch map. FlexEControl can do more faithful generation while all three others generate the candle in the coffee. Table 4: Human evaluation of FlexEControl and Uni-ControlNet under homogenous and heterogeneous structural conditions, assessing both human preference and condition alignment. "Win" indicates FlexEControl's preference, "Tie" denotes equivalence, and "Lose" indicates Uni-ControlNet's preference. Results indicate that under homogeneous conditions, FlexEControl outperforms Uni-ControlNet in both human preference and condition alignment. | Condition Type | Metric | Win | Tie | Lose | |-------------------------|----------------------|-------|-------|--------| | Homogeneous | Human Preference (%) | 64.00 | 12.33 | 23.67 | | Condition Alignment (%) | 67.33 | 9.67 | 23.00 | | | Heterogeneous | Human Preference (%) | 9.80 | 87.40 | 2.80 | | Condition Alignment (%) | 6.60 | 89.49 | 4.00 | | | Condition Type | Baseline | FID↓ | CLIP Score↑ | |------------------|----------------|--------|---------------| | Heterogeneous | Uni-ControlNet | 27.81 | 0.4869 | | | FlexEControl | 27.47 | 0.4981 | | Homogeneous | Uni-ControlNet | 28.98 | 0.4858 | | | FlexEControl | 27.65 | 0.4932 | Table 5: Quantitative evaluation of controllability and image quality in scenarios with multiple conditions from heterogeneous and homogeneous modalities for FlexEControl and Uni-ControlNet. The 'heterogeneous' category averages the performance across one Canny condition combined with six other different modalities. The 'homogeneous' category represents the average performance across seven identical modalities (three inputs). achieve even better performance in text-to-image generation tasks. For the sake of a fair comparison in the main paper, we conduct experiments using Stable Diffusion 1.5 model. ![9_image_0.png](9_image_0.png) Figure 7: Qualitative performance of FlexEControl when conditioning on diverse compositions of multiple modalities. Each row in the figure corresponds to a unique type of condition, with the text prompts and conditions as follows: (first row) two canny edge maps with the prompt A motorcycle in the forest, (second row) two depth maps for A car, (third row) two sketch maps depicting A vase with a green apple, (fourth row) two canny edge maps for Stormtrooper's lecture at the football field, (fifth row) two segmentation maps visualizing A deer in the forests, (sixth row) two MLSD edge maps for A sofa in a desert, and (seventh row) one segmentation map and one edge map for A bird. These examples illustrate the robust capability of FlexEControl to effectively utilize multiple multimodal conditions, generating images that are not only visually compelling but also faithfully aligned with the given textual descriptions and input conditions. ![10_image_0.png](10_image_0.png) Figure 8: Qualitative results on multimodal control for generating multiple foregrounds. ![10_image_1.png](10_image_1.png) Figure 9: Qualitative results on multimodal control using three homogeneous condition images ## 3.4 Qualitative Results We present qualitative results of our FlexEControl under three different settings: single input condition, multiple heterogeneous conditions, and multiple homogeneous conditions, illustrated in Figure 5, Figure 6, and Figure 7, respectively. The results indicate that FlexEControl is comparable to baseline models when a single condition is input. However, with multiple conditions, FlexEControl consistently and noticeably outperforms other models. Particularly, under multiple homogeneous conditions, FlexEControl excels in generating overall higher quality images that align more closely with the input conditions, surpassing other models. We also shown in Figure 8 the qualitative results of generating multiple foregrounds.. In the teddy bear and dog condition case, the teddy bear has a noisy background, and the dog image has a noisy foreground, while the prompt asks the model to generate a teddy bear and a bear. As shown in the results, FlexEControl effectively handles the noisy and conflicting semantic information, successfully following the prompt to generate an image with two foregrounds: a teddy bear and a bear, even though the bear condition comes Table 6: Quantitative evaluation of controllability and image quality trained on a subset of 100,000 samples. Human poses are evaluated solely within portrait images. | Models | Canny | MLSD | HED | Sketch | Depth | Segmentation | Poses | FID↓ | CLIP Score↑ | |---------------------|-------------|---------|-------------|-------------|---------|----------------|---------|--------|---------------| | (SSIM)↑ | (SSIM)↑ | (SSIM)↑ | (SSIM)↑ | (MSE)↓ | (mIoU)↑ | (mAP)↑ | | | | | FlexEControl | 0.3711 | 0.4920 | 0.3871 | 0.4869 | 94.83 | 0.4479 | 0.1432 | 28.03 | 0.4877 | | FlexEControl-SD 2.1 | 0.3891 | 0.5273 | 0.4077 | 0.4960 | 93.58 | 0.4490 | 0.1562 | 25.08 | 0.5833 | | Condition 1 | Condition 2 | Ours | Condition 1 | Condition 2 | Ours | | | | | Figure 10: **Failure cases**. Failure cases in generating human images (*left*): The text prompt is: a basketball player with a helicopter. Due to limitations in the Stable Diffusion backbone, FlexEControl fails to generate a correct basketball player, instead producing an image where the basketball player's face is replaced with a basketball. Failure cases in generating images with a weak text prompt for the background (*right*): The text prompt is a car is parking, which provides little information about the background. The background segmentation map is complex, and the foreground uses a strong canny edge guidance. Consequently, the generated image shows a weak effect of the segmentation, although the foreground is generated accurately. from a dog image. In the robot case, the depth map for the soccer ball is blurred, and the player given is a human soccer player, yet the model still follows the prompt to generate robot soccer player images with three additional soccer balls. These examples demonstrate the strong controllability of FlexEControl. Furthermore, we show in Figure 9 the qualitative results for FlexEControl on mulimodal control using three homogeneous conditiona images. Further highlighting the versatility and effectiveness of FlexEControl in handling multiple conditions. Additionally, we showcase the extensibility of FlexEControl in controllable video generation. The results are presented in Figure 12 and Figure 13 in the Appendix, where results for providing one condition and multiple conditions are demonstrated. ## 3.5 Limitations Although FlexEControl achieves strong performance, it shares the inherent limitations of diffusion-based image generation models. The LAION dataset exhibits certain biases, which can lead to suboptimal performance in specific scenarios. FlexEControl could benefit from a more robust and strong pretrained text-to-image generation backbone and could be further improved with access to better open-source datasets that mitigate the risk of generating biased, toxic, sexualized, or other harmful content. Some failure cases and analyses where FlexEControl struggled are illustrated in Figure 10. ## 4 Related Work FlexEControl is an instance of efficient training and controllable text-to-image generation. Here, we overview modeling efforts in the subset of efficient training towards reducing parameters and memory cost and controllable T2I. Efficient Training Prior work has proposed efficient training methodologies both for pretraining and fine-tuning. These methods have established their efficacy across an array of language and vision tasks. One of these explored strategies is Prompt Tuning (Lester et al., 2021), where trainable prompt tokens are appended to pretrained models (Schick and Schütze, 2020; Ju et al., 2021; Jia et al., 2022). These tokens can be added exclusively to input embeddings or to all intermediate layers (Li and Liang, 2021), allowing for nuanced model control and performance optimization. Low-Rank Adaptation (LoRA) (Hu et al., 2021) is another innovative approach that introduces trainable rank decomposition matrices for the parameters of each layer. LoRA has exhibited promising fine-tuning ability on large generative models, indicating its potential for broader application. Furthermore, the use of Adapters inserts lightweight adaptation modules into each layer of a pretrained transformer (Houlsby et al., 2019; Rücklé et al., 2021). This method has been successfully extended across various setups (Zhang et al., 2021b; Gao et al., 2021; Mou et al., 2023), demonstrating its adaptability and practicality. Other approaches including post-training model compression (Fang et al., 2023) facilitate the transition from a fully optimized model to a compressed version - either sparse (Frantar and Alistarh, 2023), quantized (Li et al., 2023a; Gu et al., 2022b), or both. This methodology was particularly helpful for parameter quantization (Dettmers et al., 2023). Different from these methodologies, FlexEControl puts forth a new unified strategy that aims to enhance the efficient training of text-to-image diffusion models through the leverage of low-rank structure. Yeh et al. (2023) and Marjit et al. (2024) explore the use of Kronecker Product for tuning T2I models. These approaches focus on enhancing control and efficiency, particularly in subject-driven or style-preserving generation tasks. FlexEControl is the first to leverage it for multimodal conditioning, leading to enhanced flexibility and efficiency in handling diverse input modalities. FlexEControl is also a general approach that can be applied to UniControl Qin et al. (2023) or other backbones. Controllable Text-to-Image Generation Recent developments in the text-to-image generation domain strives for more control over image generation, enabling more targeted, stable, and accurate visual outputs, several models like T2I-Adapter (Mou et al., 2023) and Composer (Huang et al., 2023) have emerged to enhance image generations following the semantic guidance of text prompts and multiple different structural conditional control. However, existing methods are struggling at dealing with multiple conditions from the same modalities, especially when they have conflicts, e.g. multiple segmentation maps and at the same time follow the guidance of text prompts; Recent studies also highlight challenges in controllable text-to-image generation (T2I), such as omission of objects in text prompts and mismatched attributes (Lee et al., 2023; Bakr et al., 2023), showing that current models are strugging at handling controls from different conditions. Towards these, the Attend-and-Excite method Chefer et al. (2023) refines attention regions to ensure distinct attention across separate image regions. ReCo Yang et al. (2023), GLIGEN Li et al. (2023b), and LayoutGuidance Chen et al. (2023) allow for image generation informed by bounding boxes and regional descriptions. Mo et al. (2024) offers a training-free approach to multimodal control. FlexEControl improves the model's controllability by proposing a new training strategy, distinguishing itself by targeting the flexibility and efficiency of multimodal control, especially in scenarios with conflicting conditions from the same or different modalities (e.g., multiple segmentation maps combined with text prompts). ## 5 Conclusion In this work, we present FlexEControl, an approach designed to enhance both the flexibility and efficiency of controllable diffusion-based text-to-image generation. Our method introduces several key innovations: Dataset Augmentation with Text Parsing and Segmentation, Cross-Attention Supervision, and Masked Diffusion Loss, which together significantly improve the model's ability to handle diverse and conflicting multimodal inputs. Additionally, we propose an Efficient Training strategy that optimizes parameter, data, and memory efficiency without sacrificing performance or inference speed. We also demonstrate that sharing a common set of decomposed weights across different multimodal conditions via Kronecker Decomposition can further optimize parameter space and enhance efficiency. These findings suggest that FlexEControl can be readily adapted to other architectures, offering a scalable solution for future developments in text-to-image generation. Future work could explore more advanced decomposition techniques and their application to cutting-edge diffusion backbones or Diffusion Transformers (DiTs), aiming to further optimize model efficiency, complexity, and expressive power. ## Broader Impact Statement While FlexEControl demonstrates promising results in efficient and controllable text-to-image generation, the ability of FlexEControl to generate realistic images based on textual descriptions raises ethical concerns, especially regarding the creation of misleading or deceptive content. It is imperative to establish guidelines and ethical standards for the use of such technology to prevent misuse in generating deepfakes or propagating false information. ## References Armen Aghajanyan, Luke Zettlemoyer, and Sonal Gupta. 2020. Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning. *arXiv:2012.13255 [cs]*. Omri Avrahami, Kfir Aberman, Ohad Fried, Daniel Cohen-Or, and Dani Lischinski. 2023. Break-a-scene: Extracting multiple concepts from a single image. In *SIGGRAPH Asia 2023 Conference Papers*, pages 1–12. Eslam Mohamed Bakr, Pengzhan Sun, Xiaogian Shen, Faizan Farooq Khan, Li Erran Li, and Mohamed Elhoseiny. 2023. HRS-Bench: Holistic, Reliable and Scalable Benchmark for Text-to-Image Models. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 20041–20053. Yogesh Balaji, Seungjun Nah, Xun Huang, Arash Vahdat, Jiaming Song, Karsten Kreis, Miika Aittala, Timo Aila, Samuli Laine, Bryan Catanzaro, et al. 2022. ediffi: Text-to-image diffusion models with an ensemble of expert denoisers. *arXiv preprint arXiv:2211.01324*. Samy Bengio, Jason Weston, and David Grangier. 2010. Label embedding trees for large multi-class tasks. In NIPS. Tim Brooks, Aleksander Holynski, and Alexei A Efros. 2023. Instructpix2pix: Learning to follow image editing instructions. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition*, pages 18392–18402. John Canny. 1986. A computational approach to edge detection. *IEEE Transactions on pattern analysis and* machine intelligence, (6):679–698. Shidong Cao, Wenhao Chai, Shengyu Hao, Yanting Zhang, Hangyue Chen, and Gaoang Wang. 2023. Difffashion: Reference-based fashion design with structure-aware transfer by diffusion models. *IEEE* Transactions on Multimedia. Zhe Cao, Tomas Simon, Shih-En Wei, and Yaser Sheikh. 2017. Realtime multi-person 2d pose estimation using part affinity fields. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pages 7291–7299. Huiwen Chang, Han Zhang, Jarred Barber, AJ Maschinot, Jose Lezama, Lu Jiang, Ming-Hsuan Yang, Kevin Murphy, William T Freeman, Michael Rubinstein, et al. 2023. Muse: Text-to-image generation via masked generative transformers. *arXiv preprint arXiv:2301.00704*. Hila Chefer, Yuval Alaluf, Yael Vinker, Lior Wolf, and Daniel Cohen-Or. 2023. Attend-and-excite: Attentionbased semantic guidance for text-to-image diffusion models. *ACM Transactions on Graphics (TOG)*, 42(4):1–10. Minghao Chen, Iro Laina, and Andrea Vedaldi. 2023. Training-free layout control with cross-attention guidance. *arXiv preprint arXiv:2304.03373*. Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. 2020. A simple framework for contrastive learning of visual representations. *arXiv preprint arXiv:2002.05709*. Guillaume Couairon, Jakob Verbeek, Holger Schwenk, and Matthieu Cord. 2022. Diffedit: Diffusion-based semantic image editing with mask guidance. *arXiv preprint arXiv:2210.11427*. Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. 2022. FlashAttention: Fast and memory-efficient exact attention with IO-awareness. In *Advances in Neural Information Processing Systems*. Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. 2023. Qlora: Efficient finetuning of quantized llms. *arXiv preprint arXiv:2305.14314*. Gongfan Fang, Xinyin Ma, and Xinchao Wang. 2023. Structural pruning for diffusion models. *arXiv preprint* arXiv:2305.10924. Elias Frantar and Dan Alistarh. 2023. Massive language models can be accurately pruned in one-shot. arXiv preprint arXiv:2301.00774. Peng Gao, Shijie Geng, Renrui Zhang, Teli Ma, Rongyao Fang, Yongfeng Zhang, Hongsheng Li, and Yu Qiao. 2021. Clip-adapter: Better vision-language models with feature adapters. *arXiv preprint arXiv:2110.04544*. Jianping Gou, Baosheng Yu, Stephen J Maybank, and Dacheng Tao. 2021. Knowledge distillation: A survey. International Journal of Computer Vision, 129:1789–1819. Geonmo Gu, Byungsoo Ko, SeoungHyun Go, Sung-Hyun Lee, Jingeun Lee, and Minchul Shin. 2022a. Towards light-weight and real-time line segment detection. In *Proceedings of the AAAI Conference on Artificial* Intelligence, volume 36, pages 726–734. Shuyang Gu, Dong Chen, Jianmin Bao, Fang Wen, Bo Zhang, Dongdong Chen, Lu Yuan, and Baining Guo. 2022b. Vector quantized diffusion model for text-to-image synthesis. In *Proceedings of the IEEE/CVF* Conference on Computer Vision and Pattern Recognition, pages 10696–10706. Xiuye Gu, Tsung-Yi Lin, Weicheng Kuo, and Yin Cui. 2021. Open-vocabulary object detection via vision and language knowledge distillation. *arXiv preprint arXiv:2104.13921*. Qiushan Guo, Xinjiang Wang, Yichao Wu, Zhipeng Yu, Ding Liang, Xiaolin Hu, and Ping Luo. 2020. Online knowledge distillation via collaborative learning. In *Proceedings of the IEEE/CVF Conference on Computer* Vision and Pattern Recognition, pages 11020–11029. Xuehai He, Chunyuan Li, Pengchuan Zhang, Jianwei Yang, and Xin Eric Wang. 2022. Parameter-efficient fine-tuning for vision transformers. *arXiv preprint arXiv:2203.16329*. Amir Hertz, Ron Mokady, Jay Tenenbaum, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. 2022. Promptto-prompt image editing with cross attention control. *arXiv preprint arXiv:2208.01626*. Jack Hessel, Ari Holtzman, Maxwell Forbes, Ronan Le Bras, and Yejin Choi. 2021. CLIPScore: a reference-free evaluation metric for image captioning. In *EMNLP*. Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. 2017. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30. Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. *arXiv* preprint arXiv:1503.02531. Jonathan Ho and Tim Salimans. 2022. Classifier-free diffusion guidance. *arXiv preprint arXiv:2207.12598*. Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. 2019. Parameter-Efficient Transfer Learning for NLP. arXiv:1902.00751 [cs, stat]. Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2021. LoRA: Low-Rank Adaptation of Large Language Models. *arXiv:2106.09685 [cs]*. Xinting Hu, Kaihua Tang, Chunyan Miao, Xian-Sheng Hua, and Hanwang Zhang. Distilling Causal Effect of Data in Class-Incremental Learning. page 10. Lianghua Huang, Di Chen, Yu Liu, Yujun Shen, Deli Zhao, and Jingren Zhou. 2023. Composer: Creative and controllable image synthesis with composable conditions. *arXiv preprint arXiv:2302.09778*. Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. 2022. Visual prompt tuning. *arXiv preprint arXiv:2203.12119*. Chen Ju, Tengda Han, Kunhao Zheng, Ya Zhang, and Weidi Xie. 2021. Prompting visual-language models for efficient video understanding. *arXiv preprint arXiv:2112.04478*. Bahjat Kawar, Shiran Zada, Oran Lang, Omer Tov, Huiwen Chang, Tali Dekel, Inbar Mosseri, and Michal Irani. 2023. Imagic: Text-based real image editing with diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6007–6017. Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. *arXiv preprint* arXiv:1412.6980. Nupur Kumari, Bingliang Zhang, Richard Zhang, Eli Shechtman, and Jun-Yan Zhu. 2023. Multi-concept customization of text-to-image diffusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1931–1941. Kimin Lee, Hao Liu, Moonkyung Ryu, Olivia Watkins, Yuqing Du, Craig Boutilier, Pieter Abbeel, Mohammad Ghavamzadeh, and Shixiang Shane Gu. 2023. Aligning text-to-image models using human feedback. arXiv preprint arXiv:2302.12192. Benjamin Lefaudeux, Francisco Massa, Diana Liskovich, Wenhan Xiong, Vittorio Caggiano, Sean Naren, Min Xu, Jieru Hu, Marta Tintore, Susan Zhang, Patrick Labatut, and Daniel Haziza. 2022. xformers: A modular and hackable transformer modelling library. https://github.com/facebookresearch/xformers. Brian Lester, Rami Al-Rfou, and Noah Constant. 2021. The power of scale for parameter-efficient prompt tuning. *arXiv preprint arXiv:2104.08691*. Junnan Li, Ramprasaath Selvaraju, Akhilesh Gotmare, Shafiq Joty, Caiming Xiong, and Steven Chu Hong Hoi. 2021. Align before fuse: Vision and language representation learning with momentum distillation. Advances in neural information processing systems, 34:9694–9705. Xiang Lisa Li and Percy Liang. 2021. Prefix-Tuning: Optimizing Continuous Prompts for Generation. arXiv:2101.00190 [cs]. Xiuyu Li, Long Lian, Yijiang Liu, Huanrui Yang, Zhen Dong, Daniel Kang, Shanghang Zhang, and Kurt Keutzer. 2023a. Q-diffusion: Quantizing diffusion models. *arXiv preprint arXiv:2302.04304*. Yuheng Li, Haotian Liu, Qingyang Wu, Fangzhou Mu, Jianwei Yang, Jianfeng Gao, Chunyuan Li, and Yong Jae Lee. 2023b. Gligen: Open-set grounded text-to-image generation. 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Timo Lüddecke and Alexander Ecker. 2022. Image segmentation using text and image prompts. In *Proceedings* of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 7086–7096. Rabeeh Karimi Mahabadi, James Henderson, and Sebastian Ruder. 2021. Compacter: Efficient Low-Rank Hypercomplex Adapter Layers. *arXiv:2106.04647 [cs]*. Shyam Marjit, Harshit Singh, Nityanand Mathur, Sayak Paul, Chia-Mu Yu, and Pin-Yu Chen. 2024. Diffusekrona: A parameter efficient fine-tuning method for personalized diffusion model. *arXiv preprint* arXiv:2402.17412. Chenlin Meng, Robin Rombach, Ruiqi Gao, Diederik Kingma, Stefano Ermon, Jonathan Ho, and Tim Salimans. 2023. On distillation of guided diffusion models. In *Proceedings of the IEEE/CVF Conference* on Computer Vision and Pattern Recognition, pages 14297–14306. Sicheng Mo, Fangzhou Mu, Kuan Heng Lin, Yanli Liu, Bochen Guan, Yin Li, and Bolei Zhou. 2024. Freecontrol: Training-free spatial control of any text-to-image diffusion model with any condition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7465–7475. Ron Mokady, Amir Hertz, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. 2023. Null-text inversion for editing real images using guided diffusion models. In *Proceedings of the IEEE/CVF Conference on* Computer Vision and Pattern Recognition, pages 6038–6047. Chong Mou, Xintao Wang, Liangbin Xie, Jian Zhang, Zhongang Qi, Ying Shan, and Xiaohu Qie. 2023. T2i-adapter: Learning adapters to dig out more controllable ability for text-to-image diffusion models. arXiv preprint arXiv:2302.08453. Alexander Quinn Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. 2021. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. *arXiv preprint arXiv:2112.10741*. Matthew Peters, Waleed Ammar, Chandra Bhagavatula, and Russell Power. 2017. Semi-supervised sequence tagging with bidirectional language models. In ACL. Hieu Pham, Melody Y. Guan, Barret Zoph, Quoc V. Le, and Jeff Dean. 2018. Efficient neural architecture search via parameter sharing. In *ICML*. Can Qin, Shu Zhang, Ning Yu, Yihao Feng, Xinyi Yang, Yingbo Zhou, Huan Wang, Juan Carlos Niebles, Caiming Xiong, Silvio Savarese, et al. 2023. Unicontrol: A unified diffusion model for controllable visual generation in the wild. *arXiv preprint arXiv:2305.11147*. Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. 2021. Learning transferable visual models from natural language supervision. *arXiv preprint arXiv:2103.00020*. Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. 2021a. Zero-shot text-to-image generation. In *ICML*. Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. 2021b. Zero-shot text-to-image generation. In *International Conference on Machine Learning*, pages 8821–8831. PMLR. René Ranftl, Katrin Lasinger, David Hafner, Konrad Schindler, and Vladlen Koltun. 2020. Towards robust monocular depth estimation: Mixing datasets for zero-shot cross-dataset transfer. *IEEE transactions on* pattern analysis and machine intelligence, 44(3):1623–1637. Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian Reid, and Silvio Savarese. 2019. Generalized intersection over union: A metric and a loss for bounding box regression. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 658–666. Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. 2022. Highresolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10684–10695. Olaf Ronneberger, Philipp Fischer, and Thomas Brox. 2015. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234–241. Springer. Andreas Rücklé, Gregor Geigle, Max Glockner, Tilman Beck, Jonas Pfeiffer, Nils Reimers, and Iryna Gurevych. 2021. AdapterDrop: On the Efficiency of Adapters in Transformers. *arXiv:2010.11918 [cs]*. Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Rapha Gontijo Lopes, Tim Salimans, Jonathan Ho, David J Fleet, and Mohammad Norouzi. 2022a. Photorealistic text-to-image diffusion models with deep language understanding. *arXiv:2205.11487*. Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L Denton, Kamyar Ghasemipour, Raphael Gontijo Lopes, Burcu Karagol Ayan, Tim Salimans, et al. 2022b. Photorealistic text-to-image diffusion models with deep language understanding. *Advances in Neural Information Processing Systems*, 35:36479–36494. Tim Salimans and Jonathan Ho. 2022. Progressive distillation for fast sampling of diffusion models. *arXiv* preprint arXiv:2202.00512. Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. 2019. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. In *EMC2 @ NeurIPS*. Timo Schick and Hinrich Schütze. 2020. Exploiting cloze questions for few shot text classification and natural language inference. *arXiv preprint arXiv:2001.07676*. Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. 2022. Laion-5b: An open large-scale dataset for training next generation image-text models. *arXiv preprint arXiv:2210.08402*. Edgar Simo-Serra, Satoshi Iizuka, Kazuma Sasaki, and Hiroshi Ishikawa. 2016. Learning to simplify: fully convolutional networks for rough sketch cleanup. *ACM Transactions on Graphics (TOG)*, 35(4):1–11. Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, and Alexey Dosovitskiy. 2021. MLP-Mixer: An all-MLP Architecture for Vision. *arXiv:2105.01601 [cs]*. Dani Valevski, Matan Kalman, Yossi Matias, and Yaniv Leviathan. 2022. Unitune: Text-driven image editing by fine tuning an image generation model on a single image. *arXiv preprint arXiv:2210.09477*. Yixin Wang and Michael I. Jordan. 2021. Desiderata for Representation Learning: A Causal Perspective. arXiv:2109.03795 [cs, stat]. Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. 2004. Image quality assessment: from error visibility to structural similarity. *IEEE transactions on image processing*, 13(4):600–612. Yeming Wen, Dustin Tran, and Jimmy Ba. 2020. Batchensemble: an alternative approach to efficient ensemble and lifelong learning. *arXiv preprint arXiv:2002.06715*. Tete Xiao, Yingcheng Liu, Bolei Zhou, Yuning Jiang, and Jian Sun. 2018. Unified perceptual parsing for scene understanding. In *Proceedings of the European conference on computer vision (ECCV)*, pages 418–434. Saining Xie and Zhuowen Tu. 2015. Holistically-nested edge detection. In Proceedings of the IEEE international conference on computer vision, pages 1395–1403. Zhengyuan Yang, Jianfeng Wang, Zhe Gan, Linjie Li, Kevin Lin, Chenfei Wu, Nan Duan, Zicheng Liu, Ce Liu, Michael Zeng, et al. 2023. Reco: Region-controlled text-to-image generation. In *Proceedings of the* IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 14246–14255. Shih-Ying Yeh, Yu-Guan Hsieh, Zhidong Gao, Bernard BW Yang, Giyeong Oh, and Yanmin Gong. 2023. Navigating text-to-image customization: From lycoris fine-tuning to model evaluation. In The Twelfth International Conference on Learning Representations. Jiahui Yu, Yuanzhong Xu, Jing Yu Koh, Thang Luong, Gunjan Baid, Zirui Wang, Vijay Vasudevan, Alexander Ku, Yinfei Yang, Burcu Karagol Ayan, et al. 2022. Scaling autoregressive models for content-rich text-to-image generation. *arXiv preprint arXiv:2206.10789*, 2(3):5. Elad Ben Zaken, Shauli Ravfogel, and Yoav Goldberg. 2021. BitFit: Simple Parameter-efficient Fine-tuning for Transformer-based Masked Language-models. *arXiv:2106.10199 [cs]*. Aston Zhang, Yi Tay, Shuai Zhang, Alvin Chan, Anh Tuan Luu, Siu Cheung Hui, and Jie Fu. 2021a. Beyond fully-connected layers with quaternions: Parameterization of hypercomplex multiplications with 1/n parameters. *arXiv preprint arXiv:2102.08597*. Lvmin Zhang and Maneesh Agrawala. 2023. Adding conditional control to text-to-image diffusion models. arXiv preprint arXiv:2302.05543. Renrui Zhang, Rongyao Fang, Peng Gao, Wei Zhang, Kunchang Li, Jifeng Dai, Yu Qiao, and Hongsheng Li. 2021b. Tip-Adapter: Training-free CLIP-Adapter for Better Vision-Language Modeling. arXiv:2111.03930 [cs]. Zhongping Zhang, Jian Zheng, Jacob Zhiyuan Fang, and Bryan A Plummer. 2023. Text-to-image editing by image information removal. *arXiv preprint arXiv:2305.17489*. Shihao Zhao, Dongdong Chen, Yen-Chun Chen, Jianmin Bao, Shaozhe Hao, Lu Yuan, and Kwan-Yee K Wong. 2023. Uni-controlnet: All-in-one control to text-to-image diffusion models. *arXiv preprint arXiv:2305.16322*. This Appendix is organized as follows: - Appendix A contains our detailed model architectures; - Appendix B contains additional implementation details; - Appendix C contains additional results; - Appendix D contains additional study on text-to-image pretraining; - Appendix E contains additional related works; - Appendix F contains details for the human evaluation setup; ## A Detailed Model Architecture In ControlNet (Zhang and Agrawala, 2023) and Uni-ControlNet (Zhao et al., 2023), the weights of Stable Diffusion (SD) (Rombach et al., 2022) are fixed and the input conditions are fed into zero-convolutions and added back into the main Stable Diffusion backbone. Specifically, for Uni-ControlNet, they uses a multi-scale condition injection strategy that extracts features at different resolutions and uses them for condition injection referring to the implementation of Feature Denormalization (FDN): $$\mathrm{FDN}\left(Z,\right)$$ $\left(7\right)$. FDN (*Z, c*) = norm (Z) · (1 + Φ (zero (hr (c)))) + Φ (zero (hr (c))), (7) where Z denotes noise features, c denotes the input conditional features, Φ denotes learnable convolutional layers, and zero denotes zero convolutional layer. The zero convolutional layer contains weights initialized to zero. This ensures that during the initial stages of training, the model relies more on the knowledge from the backbone part, gradually adjusting these weights as training progresses. The use of such layers aids in preserving the architecture's original behavior while introducing structure-conditioned inputs. We use the similar model architecture while we perform efficient training proposed in the main paper. We show the model architecture in Figure 11. ## B Additional Implementation Details In this section, we provide further details about the implementation aspects of our approach. ## B.1 Additional Details Of Structural Input Conditions Extraction - **Edge Maps**: For generating edge maps, we utilized two distinct techniques: - Canny Edge Detector (Canny, 1986) - A widely used method for edge detection in images. - HED Boundary Extractor (Xie and Tu, 2015) - Holistically-Nested Edge Detection, an advanced technique for identifying object boundaries. - MLSD (Gu et al., 2022a) - A method particularly designed for detecting multi-scale line segments in images. - **Sketch Maps**: We adopted a sketch extraction technique detailed in Simo-Serra et al. (2016) to convert images into their sketch representations. - **Pose Information**: OpenPose (Cao et al., 2017) was employed to extract human pose information from images, which provides detailed body joint and keypoint information. - **Depth Maps**: For depth estimation, we integrated Midas (Ranftl et al., 2020), a robust method for predicting depth information from single images. ![20_image_0.png](20_image_0.png) Figure 11: Detailed model architecture in FlexEControl. The Stable Diffusion part is fixed and others are trainable. fi - **Segmentation Maps**: Segmentation of images was performed using the method outlined in Xiao et al. (2018), which focuses on accurately segmenting various objects within an image. Each of these conditions plays a crucial role in guiding the text-to-image generation process, helping FlexEControl to generate images that are not only visually appealing but also semantically aligned with the given text prompts and structural conditions. ## B.2 Additional Details Of Evaluation Metrics mIoU (Rezatofighi et al., 2019): Mean Intersection over Union, a metric that quantifies the degree of overlap between predicted and actual segmentation maps. SSIM (Wang et al., 2004): Structural Similarity, a metric evaluating the structural similarity in generated outputs, applied to Canny edges, HED edges, MLSD edges, and sketches. mAP: Mean Average Precision, utilized for pose maps, measuring the precision of localization across multiple instances. MSE: Mean Squared Error, employed for depth maps, MSE quantifies the pixel-wise variance, providing an assessment of image fidelity. FID (Heusel et al., 2017): Fréchet Inception Distance, which serves as a metric to quantify the realism and diversity of the generated images. A lower FID value indicates higher quality and diversity of the output images. CLIP Score (Hessel et al., 2021; Radford et al., 2021): Employing CLIP Score, we gauge the semantic similarity between the generated images and the input text prompts. ![21_image_0.png](21_image_0.png) Figure 12: Results from FlexEControl on controllable text-to video generation (single condition). fi ## C Additional Results C.1 Additional Qualitative Results On Video Generation FlexEControl can be further extended to accommodate video generation. In training the controllable video generation model with multiple input conditions, a straightforward strategy is employed to mask out conditions during the training process. In each iteration, a random sample, denoted as Ns, is drawn from [1, N] to determine the number of frames that will incorporate the conditions. Subsequently, Ns unique values are drawn from the set 1, 2*, ..., N*, and the conditions are retained for the corresponding frames. In this section, we showcase the extensibility of FlexEControl in controllable video generation. The results are presented in Figure 12 and Figure 13, where results for providing one condition and multiple conditions are demonstrated. ![22_image_0.png](22_image_0.png) Figure 13: FlexEControl on using multiple conditions for video generation. ## D Training A Small U-Net Backbone In this section, we discuss further methods to refine the training of a lightweight Stable Diffusion backbone within FlexEControl, aiming to further curtail the number of trainable parameters and minimize memory usage end-to-end. The resulting pre-trained Stable Diffusion backbone, which we denote as FlexEControlpretraining, offers a more lightweight alternative to the original model while retaining versatility for application in a variety of tasks. Building upon the strategies delineated in the main paper, we architect a streamlined U-Net structure utilizing low-rank decomposition. This design is complemented by the implementation of knowledge distillation techniques throughout the training process to cultivate an efficient text-to-image generative model. Our training regimen unfolds in two distinct phases: Initially, we focus on establishing a lightweight T2I diffusion model founded on a conventional U-Net framework, with knowledge distillation enhancing this foundational stage. Subsequently, we move to fine-tuning introduced in the main paper, enabling the model to adeptly manage controlled T2I generation tasks. This bifurcated approach yields significant resource savings both in fine-tuning and in the overall model parameter count, setting a new benchmark for efficiency in generative modeling. ## D.1 Background On Low-Rank Training Background on Training in Low-dimensional Space Let θ D = hθ0 D *. . . θ*m Dibe a set of m D- dimensional parameters that parameterize the U-Net within the Stable Diffusion. Instead of optimizing the noise prediction loss in the original parameter space θ D, we are motivated to train the model in the lower-dimensional space θ d(Aghajanyan et al., 2020). Our overall pipeline is trying to train the controllable text-to-image diffusion model in such a lower-dimension space to improve the overall efficiency. An overview of our proposed two-stage pipeline is shown in Figure 16. We first train the U-Net of a text-toimage model with a low-rank schema. Specifically, we employ matrix factorization techniques that decompose high-dimensional matrices into smaller matrices, capturing essential features with reduced computational overhead. This process is augmented through knowledge distillation, visually represented in green on Figure 16. We then conduct efficient fine-tuning using the methods (shown in the yellow part on Figure 16) with the methods introduced in the main paper, where we employ low-rank decomposition and Kronecker decomposition to streamline the parameter space. Low-rank Text-to-image Diffusion Model To establish a foundational understanding of our model, it's crucial to first comprehend the role of U-Nets in the diffusion process. In diffusion models, there exists an input language prompt y that is processed by a encoder τθ. This encoder projects y to an intermediate ![23_image_0.png](23_image_0.png) Figure 14: Overview of the Stage-1 training: Training a low-rank U-Net using knowledge distillation from a teacher model (green) to the student model (blue). This process involves initializing the student U-Net with a decomposition into low-rank matrices and minimizing the loss between the predicted noise representations from the student and teacher. ![23_image_1.png](23_image_1.png) Figure 15: The overview pipeline of our method. Our method improves the efficiency of controllable text-toimage generation from two aspects. At pretraining stage, we propose an efficient pretraining method for the standard text-to-image generation via knowledge distillation. For the finetuning stage introduced in the main paper, we propose to resort to low-rank and Kronecker decomposition to reduce the tunable parameter space. representation τθ(y) ∈ RM×dτ, where M is denotes the token length, and dτ denotes the dimension of the embedding space . This representation is subsequently mapped to the intermediate layers of the U-Net through a cross-attention layer given by $$\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\left(\frac{Q K^{T}}{\sqrt{d}}\right)V,$$ with Q = WQφi (zt), K = WKτθ(y), V = WV τθ(y). In this context, φi (zt) ∈ R N×dϵis an intermediate representation of the U-Net. The terms WV ∈ R d×dϵ,WQ ∈ R d×dτ,WK ∈ R d×dτ represent learnable projection matrices. Shifting focus to the diffusion process, during the t-timestep, we can represent: $$(8)^{\frac{1}{2}}$$ $K={\bf W}_{K}\tau_{\theta}(y)=AB\tau_{\theta}(y),$ $V={\bf W}_{V}\tau_{\theta}(y)=AB\tau_{\theta}(y),$ where A and B are decomposed low-rank matrices from the cross-attnetion matrices, dτ and dϵ denote the dimension for the text encoder and noise space respectively. Conventionally, the diffusion model is trained via minimizing Lθ =ϵ − ϵθ 2 2 , where ϵ is the groundtruth noise and ϵθ is the predicted noise from the model. Central to our strategy is a knowledge distillation process. This involves guiding a novice or 'Student' diffusion model using feature maps that draw upon the wisdom of a more seasoned 'Teacher' model. A pivotal insight $$\begin{array}{l}{(9)}\\ {(10)}\end{array}$$ from our study lies in the mathematical congruence between the low-rank training processes across both training phases, unveiling the symmetries in low-rank training trajectories across both phases. To fully exploit the prior knowledge from the pretrained teacher model while exploiting less data and training a lightweight diffusion model, we propose a new two-stage training schema. The first one is the initialization strategy to inherit the knowledge from the teacher model. Another is the knowledge distillation strategy. The overall pipeline is shown in Figure 14. ## D.2 Initialization Directly initializing the student U-Net is not feasible due to the inconsistent matrix dimension across the Student and teacher U-Net. We circumvent this by decomposing U-Net into two low-rank matrices, namely A and B for the reconstruction. We adopt an additional transformation to adapt the teacher's U-Net weights to the Student, which leverages the Singular Value Decomposition (SVD) built upon the teacher U-Net. The initialization process can be expressed as: 1. Compute the SVD of the teacher U-Net: Starting with the teacher U-Net parameterized by θ0, we compute its SVD as θ0 = UΣV T. 2. Extract Low-Rank Components: to achieve a low-rank approximation, we extract the first k columns of U, the first k rows and columns of Σ, and the first k rows of V T. This results in matrices Uk, Σk, and V T kas follows: Uk = first k columns of U, (11) Σk = first k rows & columns of Σ, (12) $$\begin{array}{c}{{U_{k}=\mathrm{first~}k\mathrm{~columns~of~}U,}}\\ {{\Sigma_{k}=\mathrm{first~}k\mathrm{~rows~}\&\mathrm{columns~of~}\Sigma,}}\\ {{V_{k}^{T}=\mathrm{first~}k\mathrm{~rows~of~}V^{T}}}\end{array}$$ T(13) 3. We then initialize the student U-Net with UkΣk and V T kthat encapsulate essential information from the teacher U-Net but in a lower-rank format. We observe in practice that such initialization effectively retains the prior knowledge inherited from Teacher U-Net while enabling the student U-Net to be represented in a compact form thus computationally more efficient for later training. ## D.3 Loss Function We propose to train our Student U-Net with knowledge distillation (Meng et al., 2023) to mimic the behavior of a teacher U-Net. This involves minimizing the loss between the student's predicted noise representations and those of the teacher. To be specific, our training objective can be expressed as: $\left(11\right)^3$ $\left(12\right)^3$ $\left(13\right)$. $${\mathcal{L}}_{\theta}=w\left(\lambda_{t}\right)\left\|{\hat{\epsilon}}-{\hat{\epsilon}}_{\theta}\right\|_{2}^{2},$$ $$(14)^{\frac{1}{2}}$$ , (14) where ϵ˜ denotes the predicted noise in the latent space of Stable Diffusion from the teacher model, ϵˆθ is the corresponding predicted noise from the student model, parameterized by θ, and w (λt) is a weighting function that may vary with the time step t. Such an objective encourages the model to minimize the squared Euclidean distance between the teacher and Student's predictions thus providing informative guidance to the Student. We also tried combining the loss with the text-to-image Diffusion loss but using our training objective works better. ## D.4 Experimental Settings In the pretraining stage, we used the standard training scheme of Stable Diffusion (Rombach et al., 2022) with the classifier-free guidance (Ho and Salimans, 2022). We employed the Stable Diffusion 2.1 3 model in conjunction with xFormers (Lefaudeux et al., 2022) and FlashAttention (Dao et al., 2022) using the implementation available in HuggingFace Diffusers 4. 3https://huggingface.co/stabilityai/stable-diffusion-2-1 4https://huggingface.co/docs/diffusers/index Table 7: Comparing U-Net models: Original, decomposed, with and without Knowledge Distillation. FlexEControlPretraining showcases a promising balance between performance and efficiency. Note that compared with Stable Diffusion, FlexEControl-Pretraining is only trained on 5 million data. FlexEControl-Pretraining beats Decomposed U-Net w/o Distillation interms of FID and CLIP Score, suggesting the effectiveness of our distillation strategy in training the decomposed U-Net. | Methods | FID↓ CLIP Score↑ # Parameters ↓ | | | |-------------------------------|-----------------------------------|-------|-------| | Stable Diffusion | 27.7 | 0.824 | 1290M | | Standard U-Net w/o Distill. | 66.7 | 0.670 | 1290M | | Decomposed U-Net w/o Distill. | 84.3 | 0.610 | 790M | | FlexEControl-Pretraining | 45.0 | 0.768 | 790M | | | Metrics | Uni-ControlNet | FlexEControl | ∆ | | |---------------------------|---------------------|--------------------------|----------------|------|--------| | | | w/o Distill. w/ Distill. | | | | | Efficiency | Memory Cost ↓ | 20GB | 11GB | 11GB | 0 | | | # Params. ↓ | 1271M | 536M | 536M | 0 | | Image Quality | FID ↓ | 27.7 | 84.0 | 43.7 | - 40.3 | | | CLIP Score ↑ | 0.82 | 0.61 | 0.77 | +0.16 | | Sketch Maps (CLIP Score)↑ | | 0.49 | 0.40 | 0.46 | +0.06 | | Controllability | Edge Maps (NMSE ) ↓ | 0.60 | 0.54 | 0.57 | +0.03 | | Segmentation Maps (IoU) ↑ | | 0.70 | 0.40 | 0.74 | +0.34 | Table 8: Performance and resource metrics comparison of FlexEControl with the baseline Uni-ControlNet. The FlexEControl approach with distillation shows a significant reduction in resource consumption while providing competitive image quality and outperforming in controllability metrics, especially in segmentation maps. The ∆ column shows the improvement of FlexEControl (w/o distillation) compared with no distillation. ## D.5 Results Table 7 illustrates the comparison between different variations of our method in the pretraining stage, including original U-Net, decomposed low-rank U-Net, and their respective performance with and without knowledge distillation. It is observed that the decomposed low-rank U-Net models demonstrate efficiency gains, with a reduction in the total number of parameters to 790M, although at the cost of some fidelity in metrics such as FID and CLIP Score. Employing distillation helps to mitigate some of these performance reductions. Table 8 illustrates the comparison between FlexEControl including pretraining and the baseline training end-to-end. It is observed that the decomposed low-rank U-Net models demonstrate efficiency gains, with a reduction in the total number of parameters to 536M, although at the cost of some fidelity in metrics such as FID and CLIP Score. Employing distillation helps to mitigate some of these performance reductions. These collective results affirm our method's capability to not only enhance efficiency but also improve or maintain performance across various aspects of text-to-image generation. ## E Additional Related Works Knowledge Distillation for Vision-and-Language Models Knowledge distillation (Gou et al., 2021), as detailed in prior research, offers a promising approach for enhancing the performance of a more streamlined "student" model by transferring knowledge from a more complex "teacher" model (Hinton et al., 2015; Sanh et al., 2019; Hu et al.; Gu et al., 2021; Li et al., 2021). The crux of this methodology lies in aligning the Figure 16: Screenshot for human evaluation tasks on the Amazon Mechanical Turk crowdsource evaluation platform. predictions of the student model with those of the teacher model. While a significant portion of existing knowledge distillation techniques leans towards employing pretrained teacher models (Tolstikhin et al., 2021), there has been a growing interest in online distillation methodologies (Wang and Jordan, 2021). In online distillation (Guo et al., 2020), multiple models are trained simultaneously, with their ensemble serving as the teacher. Our approach is reminiscent of online self-distillation, where a temporal and resolution ensemble of the student model operates as the teacher. This concept finds parallels in other domains, having been examined in semi-supervised learning (Peters et al., 2017), label noise learning (Bengio et al., 2010), and quite recently in contrastive learning (Chen et al., 2020). Our work on distillation for pretrained text-to-image generative diffusion models distinguishes our method from these preceding works. (Salimans and Ho, 2022; Meng et al., 2023) propose distillation strategies for diffusion models but they aim at improving inference speed. Our work instead aims to distill the intricate knowledge of teacher models into the student counterparts, ensuring both the improvements over training efficiency and quality retention. ## F Human Evaluation Interface We give the human evaluation interface in Figure 16. The human evaluators are mainly asked to finish two tasks and choose their preference from three perspectives.
Review 1: Summary: This paper targets for flexible and efficient controllable text-to-image generation. To achieve that, the paper proposes a weight decomposition method to allow for streamlined integration of various input conditions. Experiments demonstrate that it can reduce computational resources and support various modalities conditions. Strengths and Weaknesses: **Strengths** 1. The paper introduces the Kronecker product operation to compute the shared decomposed low-rank subspace, which effectively reduces the trainable parameters. Introducing the slow and fast low-rank weights into multi-modality conditional generation is reasonable. 2. The proposed method achieves trainable parameters reduction and less GPU memory consumption, with comparable performances compared to SOTAs. 3. The paper is well written and motivated. **Weaknesses** 1. Although introducing Kronecker product operation for parameter reduction is reasonable and interesting, it seems to lack technical contributions that are unique to the text-to-image generation. The authors are suggested to include more analysis on the unique contributions or designs that are more tailored for T2I generation. 2. The dataset augmentation part relies on the CLIPSeg to obtain masks, which could be less accurate when different objects share similar semantics information or are close to each other. This may also result in inferior results when multiple objects are occluded. **Questions** 1. For multi-modal conditional T2I generation, the paper mainly showed results conditioned on 2 conditions. Could the method support more than 2 conditions? 2. Could the authors show some failure cases analysis? 3. For multi-condition generation, the paper mainly reports foreground and background generation. Is it possible to generate two foregrounds? Requested Changes: Please refer to the weaknesses and questions. Broader Impact Concerns: N.A. Already included in the paper. ================================================== Review 2: Summary: This work aims to merge parameter efficiency and multiple controls in image synthesis using Text-to-Image LDMs. The authors claim high parameter efficiency with of decrease of 41% parameters compared to the SOTA, Uni-Controlnet. Broadly, the authors use Kronecker Decomposition The authors introduce 2 new loss functions for better controllable generation and semantic understanding. Overall, this work is a good mix of multi-control generation equipped with parameter efficiency and exhibits good results both qualitatively and quantitatively. Strengths and Weaknesses: Strengths: 1. I like the idea of merging parameter-efficient training with multiple controls. In my opinion, this work can have multiple applications such as label-preserving image generation for autonomous driving. The qualitative results show the affinity of generations to the control prompts. 2. The idea of introducing __Masked Diffusion Loss__ looks excellent to me. This can surely improve the spatial understanding of diffusion models allowing them to better understand the text prompts and hence generate better images. 3. This work explores Kronecker Decomposition which is an underexplored matrix decomposition technique having excellent content preservation qualities.💯 Weaknesses: This work shows interesting results and findings however I have a few concerns mentioned below. 1. This work seems to be highly motivated by FreeControl[1]. Although FreeControl is a training-free approach, the ideologies seem to be quite similar, but I find no mention or comparison to [1] in the paper. Moreover, the authors claim novelty in applying Kronecker Decomposition for parameter efficiency but do not cite works which have already explored Kronecker Product for tuning T2I models[2][3]. 2. In section __2.2__, the authors cite previous works but do not show any concrete reason of using Kronecker Products for matrix decomposition. There is no mention of __multiplicative rank__ property of Kronecker Products which sets them apart from techniques such as LoRA.🤦 3. In section __2.3__, paragraph __Cross-Attention Supervision__, the authors do not clearly mention the benefit of adding the extra loss term. In my opinion, __Masked Diffusion Loss__ already covers the semantic-spatial understanding of concepts present in the image. 4. The authors do not provide any information about the implementation of baselines used for comparison in the main paper. I can only find mention of LoRA (Hu et al.), PHM(Zhang et al.), etc, in the main paper. Instead, they waste a lot of space explaining __Evaluation Metrics__ and __Input Conditions__. I am strongly against comparing architectures using tables and figures without mentioning the implementation. It is good that the authors have mentioned a brief section about it in the appendix. 5. In __Figure 5__, the authors compare their method with ControlNet, however, no quantitative evaluation is provided with ControlNet. 6. Since the authors introduce 2 new loss terms, a qualitative comparison showing the effect of each term was expected which the authors have not provided. They only included __Figure 4__ as an ablation on lambda values. [1]: FreeControl: Training-Free Spatial Control of Any Text-to-Image Diffusion Model with Any Condition [2]: DiffuseKronA: A Parameter Efficient Fine-tuning Method for Personalized Diffusion Model [3]: Navigating Text-To-Image Customization:From LyCORIS Fine-Tuning to Model Evaluation Requested Changes: This work has good potential but I am not completely satisfied with the presentation. I tried to provide constructive feedback in the section above and here are some suggestions that would make the paper better IMO. 1. Proper citations, at least to [2] and [3] must be added and should be mentioned in the related works. 2. In __2.2__, instead of citing previous works repeatedly, the authors are requested to mention the multiplicative rank property along with properties showing the content-preserving qualities of the Kronecker Product. 3. Instead of wasting much space in explaining terms commonly known to most researchers(__3.2__, __3.3__), the authors must bring implementation details of LoRA, PHM, etc. from the appendix to the main paper to bring more clarity. 4. Qualitative results on lambda values of loss functions could better justify the addition of new terms and the selection of lambda values for training. 5. Unlike other model names, the authors forgot to emphasize __improved_aesthetics_6plus__ in __3.1__ and __3.6.1__. It is good to keep it consistent with other model names.😊 Broader Impact Concerns: No concerns on broader impact. ================================================== Review 3: Summary: One of the main applications of diffusion based text-to-image are ControlNets, i.e., the possibility to provide additional input to control the generated image. Usually an additional network, called ControlNet is trained and the additional input controls the structure of the generated image.  According to the paper, current ControlNets struggle when multiple inputs are involved. In addition, the paper claims to improve efficiency. The proposed framework, FlexEControl, is built upon a unique weight decomposition strategy. The approachachieves a reduction of 41% in trainable parameters and 30% in memory usage compared to a similar method - UniControl. The paper also suggests augmenting the training data for multiple conditions by segmenting different objects separately and then using a novel loss to make sure the network handles the different segments. Strengths and Weaknesses: Weaknesses: 1. "copied Stable Diffusion encoder" - I consider myself an expert in diffusion models but not sure what the meaning of stable diffusion encoder is? VAE? Part of the Unet? ControlNet? 2. Figure 3 - it is better if the figure caption is clear even without diving into the text. What is the purpose of this figure? It would be better to add this to the figure itself 3. After reading the Method section and the related work section I'm not sure how UniControl works and what is the difference from UniControl? Since UniControl seems like the most related work I find it important 4. The ablation study is not convincing. I want to understand what happens when lambdas are zero. Please convince me that the complicated losses are useful. 5. Figure 6 - the effect of the segmentation seems kind of weak. Although other methods fail as well - this is kind of disappointing. I would consider this example as a failure case. 6. Actually, I think the limitation/failure cases section would improve the paper significantly. 7. Conclusions section is too short and lacks novel insights. Strengths: 1. The task of multi-control generation is interesting and highly applicable 2. The losses and the specific decomposition are novel and interesting 3. The evaluation seems adequate, the model is compared to several baselines and several metrics are evaluated. Requested Changes: Overall, the paper is not well-written in my opinion. All weaknesses above (1-7) should be addressed to improve the paper. Broader Impact Concerns: There are no ethical concerns ==================================================
# Loc-Facmac: Locality Based Factorized Multi-Agent Actorcritic Algorithm For Cooperative Tasks Anonymous authors Paper under double-blind review ## Abstract In this work, we present a novel cooperative multi-agent reinforcement learning method called Locality based Factorized Multi-Agent Actor-Critic (Loc-FACMAC). Existing stateof-the-art algorithms, such as FACMAC, rely on global reward information, which may not accurately reflect individual agents' actions' influences in decentralized systems. We integrate the concept of locality into critic learning, where strongly related agents form partitions during training. Agents within the same partition have a greater impact on each other, leading to more precise policy evaluation. Additionally, we construct a dependency graph to capture the relationships between agents, facilitating the partitioning process. This approach mitigates the curse of dimensionality and prevents agents from using irrelevant information. Our method improves upon existing algorithms by focusing on local rewards and leveraging partition-based learning to enhance training efficiency and performance. We evaluate the performance of Loc-FACMAC in two environments: Multi-cartpole and BoundedCooperative-Navigation. We explore the impact of partition sizes on the performance and compare the result with baseline MARL algorithms such as LOMAQ, FACMAC, and QMIX. The experiments reveal that, if the locality structure is defined properly, Loc-FACMAC outperforms these baseline algorithms up to 45% , indicating that exploiting the locality structure in the actor-critic framework improves the MARL performance. ## 1 Introduction Multi-Agent Reinforcement Learning (MARL) is a framework (Foerster et al., 2017; Tan, 1993) that enables a group of agents to learn team behaviors by interacting with an environment. Recently, the impact of MARL has become quite evident in a range of areas (Jiang et al., 2022; Chu et al., 2019; Zhang et al., 2022; He et al., 2016). In the field of reinforcement learning, multi-agent coordination plays a crucial role in various applications such as cooperative searching, human-robot interaction, product delivery, and soccer (Ji et al., 2022; Qie et al., 2019; Vorotnikov et al., 2018; Ota, 2006; Jiménez et al., 2018). In these scenarios, agents often rely on local observations to make decisions that benefit the entire team. In many MARL algorithms, access to global rewards is assumed. However, the assumption does not hold in many scenarios as agents often need to learn cooperative behaviors based only on local observations and local or group rewards. In this paper, we propose a new MARL technique that learns using the locality inherent in many multi-agent coordination scenarios. Similar to single-agent RL, most existing MARL frameworks can be classified into two categories: *value-based* (Watkins & Dayan, 1992; Sunehag et al., 2017; Rashid et al., 2018; 2020; Son et al., 2019; Kortvelesy & Prorok, 2022; Xu et al., 2021) approaches and *actor-critic* approaches (Konda & Tsitsiklis, 1999; Peng et al., 2021; Wang et al., 2020). In value-based approaches, agents learn to estimate an action-value function by exploring the action space and choosing the action with the maximum action value. Value-based approaches are commonly used in MARL, in part, because QMIX (Rashid et al., 2018) has shown the potential of solving complex coordination problems such as the Star-Craft Multi-Agent Challenge (SMAC) (Samvelyan et al., 2019). The core idea of QMIX is to utilize a monotonic mixer to estimate the joint-action value Qtot from the individual state-action values Qi. The joint-action value function evaluates the agents' performance and modifies the policy using back-propagation. The idea of QMIX has been extended in several ways, including WQMIX (Rashid et al., 2020) and Qtran (Son et al., 2019). Although value-based approaches have shown the potential for solving complicated tasks, the curse of dimensionality prevents the approach from being applied to large-scale tasks. For instance, in QMIX-type approaches, when the number of agents increases, the joint-action space exponentially increases. Meanwhile, value-based approaches must compare all action values, requiring significant search time. Therefore, value-based approaches are not an efficient method for training many agents at once. In contrast, the actor-critic approach directly learns a policy and decides actions from the policy rather than maximizing the Q value function. For instance, MADDPG (Lowe et al., 2017) is one of the classical approaches in this category. The actor in MADDPG learns to generate the optimal action and sends the chosen actions to a critic to evaluate the value of the chosen action. Then, the actor adjusts the policy according to the score given by the critic. MADDPG can reduce the training time, but agents update their policy via a separate policy gradient while assuming that the actions of all other agents are fixed. Therefore, the policy commonly falls into the sub-optimal solution. A recently proposed algorithm, FACMAC (Peng et al., 2021), overcomes the limitations of solely value-based and only actor-critic approaches by combining them both. In FACMAC, QMIX is used for the critic update, and a centralized policy gradient is used for the actors during training. FACMAC is shown to outperform QMIX and MADDPG on various tasks within the SMAC environment (Peng et al., 2021). Table 1: Comparison of different approaches. Algorithm Num. of Mixers Critic Actor QMIX (Rashid et al., 2018) 1 ✓ × LOMAQ (Zohar et al., 2022) K ✓ × FACMAC (Peng et al., 2021) 1 ✓ ✓ Loc-FACMAC (This work) K ✓ ✓ A common feature of most existing MARL approaches is that they aim to maximize a common global reward. However, in various practical applications, it is possible that one agent's actions may not have any effect on another agent. For example, in a task of surveillance by a group of agents (Kolling & Carpin, 2008), if two agents are quite far from each other, it makes sense to assume that their actions will not affect each other. This idea is explored in a recent paper for value function-based MARL approaches, in which the authors proposed the LOMAQ algorithm (Zohar et al., 2022). LOMAQ presents a multi-mixer approach to accelerate the training process by exploiting the locality of the rewards by defining a partition (a subset of agents) across the network of agents. LOMAQ provides theoretical guarantees under fully observable settings that maximizing the global joint-action value is equivalent to maximizing the action value in each partition. The partition's action value reflects the performance of the partition so each agent can learn a local policy that maximizes the local reward of that partition instead of focusing on maximizing the global reward. The feedback in each partition only updates the most correlated agents' actor-critic networks. Several works have examined the relationship between agents (HAO et al., 2023). Recent approaches utilize attention mechanisms to determine the weights of graph neural networks (GNNs) (Liu et al., 2019; Li et al., 2021), which connect the agents' actions to cooperative behavior. Alternatively, deep coordination graphs (DCG) (Wang et al., 2022; Böhmer et al., 2020) can be used to model the payoffs between pairs of agents. However, existing works dynamically learn the graph during end-to-end learning, resulting in continuous changes to the graph structure. In this work, we extend the concept of *locality* to actor-critic methods and introduce a novel locality-based actor-critic approach named Locality-based Factorized Multi-Agent Actor-Critic Algorithm (Loc-FACMAC) for cooperative MARL. The key characteristics of Loc-FACMAC compared to existing methods are summarized in Table 1. Loc-FACMAC separates the process of constructing the dependency graph from policy learning. Once the dependency graph is established, Loc-FACMAC utilizes it across multiple mixers to compute the local joint-action value in each partition. Both critic and actor can leverage locality information to update the network with accurate policy gradient values. Similar to FACMAC, Loc-FACMAC divides the training process of critics and actors, enabling the critic to precisely evaluate action value quality without being influenced by action choices. The actor learns from the high-quality local action-value function and rapidly converges to an optimal policy. Contributions. We summarize our main contributions as follows. - We introduce a novel two-stage MARL approach named Loc-FACMAC. In the first stage, we construct a dependency graph based on the variance of agents' performance when they utilize state and action information from other agents. In the second stage, agents learn the local policy within the fixed structure of the dependency graph using an actor-critic approach. - We evaluate the proposed Loc-FACMAC algorithm in two MARL environments: multi-cartpole and bounded-cooperative-navigation. Our framework demonstrates good performance in solving these tasks and is competitive relative to baseline methods. If a proper dependency graph is defined, our framework can achieve the maximum reward with a competitively short amount of training time. ## 2 Problem Formulation We model the problem as a decentralized, partially observable Markov decision process (DecPOMDP). We define the process as a tuple M = (N, S, A, P, r, Ω*, O, γ,* G). Here, N denotes a finite set of agents, s ∈ S is the true joint state, and A is the joint-action space of all agents. At each time step, if the state is s ∈ S, and each agent i selects an action from a continuous or discrete action space Ai, then we transition to state s ′ ∼ P(·|*s, a*), where P(·|*s, a*) represents the transition kernel from state s to s ′. We define r as the global reward which depends on the global state and the joint action. The discount factor is denoted by γ. We note that Ω is the observation space, which implies that at each time step, agent i can observe partial information oi sampled from Oi(*s, a*) ∈ Ω. G = (V, E) is an undirected graph of agents, namely a dependency graph, where V = {1, 2*, ..., N*} denotes the node and *E ⊆ V × V* is the edge between nodes. The dependency graph is an additional feature added to the original Dec-POMDP in this work. The two agents are correlated if an agent is connected with another agent in the dependency graph, as shown in Fig. 1. Hence, the action of an agent affects its neighbor agent's reward. The goal here is to learn a stochastic policy πi(ai|τi) or a deterministic policy µi(τi) for each agent i where τiis the local action-observation history τi ∈ T = Ω × A. We assume that the dependency graph can be decomposed into a collection of partition P = {Jk} K k=1, such that Jk ∩ Jl = ∅, ∀k ̸= l and Sk Jk = V. The global reward r is expressed by {r1, r2*, ..., r*K}, such that r =PK k=1 rk. We also define the global action-value function as Figure 1: This figure considers a five-agent network ![2_image_0.png](2_image_0.png) and shows how different agents are connected. It also shows two ways of partitioning the network to leverage locality in the learning process. Node 4 and node 5 are away from node 1, node 2, and node 3. Node 4 and node 5 can be grouped separately. $$Q_{t o t}(\mathbf{\tau}(t),\mathbf{a}(t))=\mathbb{E}\biggl[\sum_{t=0}^{\infty}\gamma^{t}r(\mathbf{\tau}(t),\mathbf{a}(t))\biggr],$$ tr(τ (t), a(t)), (1) where we have τ (0) = τ (t), a(0) = a(t). Similarly, we define the local Q function Qi(τi(t), ai(t)) = E[P∞ l=0 γ tri(τi(t), ai(t))], with τi(0) = τi(t), ai(0) = ai(t). We assume the condition Qtot(s(t), a(t)) = PN i=1 Qi(si(t), ai(t)) holds at any time step which is well-defined in value function based approaches (Rashid et al., 2020; Zohar et al., 2022). ## 3 Proposed Algorithm: Loc-Facmac In this section, we present the framework of our new algorithm 2, Loc-FACMAC, which is a multi-mixer actor-critic method that allows the agents to synchronize the policy update while the locality information of the rewards is retained. $$\left(1\right)$$ ![3_image_0.png](3_image_0.png) Figure 2: This figure presents the architecture of the proposed LOMAQ, FACMAC, and Loc-FACMAC. Our proposed framework, Loc-FACMAC, consists of Actors, Critics, and Mixers; Actors take local observation and local action history to compute the conditional policy and sample the action from the conditional policy. Critics evaluate the quality of the action. Mixers correlate the local action value and the joint-action value. ## Algorithm 1 Proposed Loc-Facmac Algorithm Ensure: i ∈ N = 1, 2*, ..., n* are the agents 1: Partition P of V 2: Policy π i θi (τi) with parameter θi, where τi ∈ Γ ≡ (Ω × A) is local action-observation history 3: Local state s i 0 ∈ Ω drawn from O(*s, i*), where s is true state of environment 4: Critic Networks ϕi ∈ R d 5: Mixing networks ψk ∈ R e, where k = 1, 2*, .., K* 6: for iter t = 1, 2*, ..., m* do 7: for agent i = 1, 2*, ..., n* do 8: Sample action ai(t) from π i θi (τi) and retrieve next observation s(t + 1) and reward r(t) 9: **end for** 10: We have Qπ J (τ t, a t, s t; ϕ t N , ψtJ ) = F t ψJ (st, {Q πi i (τ t i , at i ; ϕ t i )}i∈N(J )), N (J ) is the κ-hop neighbourhood of J in the dependency graph 11: 12: **Train mixing and Critic network:** update mixing network by minimizing the loss: 13: L(ϕ, ψ) = ED[PJ∈P (y tot J − Qπ J (τ t, a t, s t; ϕ t N , ψtJ ))2] 14: ϕi ← ϕi − α∇ϕiL(ϕ, ψ) 15: ψk ← ψk − β∇ψk L(ϕ, ψ) 16: 17: **Train Actor network:** by update 18: ∇θJ(θ) = ED[∇θπ∇πQπ tot(τ t, π1(τ t 1 )*, ...π*n(τ t n ))] 19: Update policy parameter θk ← θk − γ∇θJ(θ) 20: **end for** Loc-FACMAC is built upon FACMAC and overcomes FACMAC's limitation of overgeneralized policy gradients. In FACMAC, the agents' network is updated using the policy gradient computed from the global reward (Peng et al., 2021). Even though the agent does not contribute to the global reward, it still updates its network using the same policy gradient. Using the distorted policy gradient, agents fail to estimate the action value and end up with a sub-optimal policy. Therefore, we adopt the idea of the locality of rewards. The policy gradient is computed from the partitions' reward and used to update the strongly related agents' network. Compared to the policy gradient in FACMAC, the policy gradient computed from partitions' reward is more accurate, so it can give a better update direction to the policy network. In the Loc-FACMAC, multiple mixers are used to estimate the locality of rewards. Each mixer corresponds to one partition. It takes the local action values and maps them to the partition's joint-action value. By increasing the number of mixers, detailed information on the locality of rewards can be retained. A simple example is estimation four natural numbers (n1, n2, n3, n4) that sum up to a given number. If only the total sum is given, the number of possible combinations could be very large. However, if the subset sums are given, e.g., n1 + n2 and n3 + n4, the number of possible combinations is reduced. Therefore, the extra information on the locality of rewards can aid agents in finding the globally optimal policy. Then, the loss can be calculated by summing the error in each partition using, $$L(\phi,\psi)=E_{D}[\sum_{J\in\mathcal{P}}(y^{tot}_{J}-Q^{\pi}_{J}(\tau^{t},a^{t},s^{t};\phi^{t}_{N},\psi^{t}_{J}))^{2}]\tag{2}$$ where y tot J =Pj∈J rj + γ maxat+1 F t+1 ψJ (st+1, {Qi(τ t+1 i, at+1 i)}i∈N(J )) is the target reward of partition J. N (J ) is the κ-hop neighbourhood of J in the dependency graph. Loc-FACMAC also inherits the property of FACMAC that it separates the learning process of actor and critic. The framework of Loc-FACMAC consists of two parts: Actor and Mixer. The actor generates an optimal action based on the local observation and historical actions and the mixer criticizes the performance of the agents' action and computes the loss of the network. The advantage of separating the learning process is to prevent the actor from learning from the overestimated/underestimated temporal difference (TD) error. This is critical in MARL because an agent should learn optimal policy by considering the other agents' chosen actions during updating the policy network. However, policy gradient updates the agent's policy network by assuming the other agents' policy is fixed. The assumption fails to be maintained. Especially, when the number of agents increases, the dynamic of agents' behavior becomes hard to predict. Hence, agents frequently get trapped in a sub-optimal policy using MADDPG or QMIX, since no individual agent can modify its optimal action conditioning on fixing all other agents' actions under the sub-optimal policy. This problem is resolved by actor-critic methods in that the mixer first measures the true error of the estimated reward. Then, the actor can be updated by computing the policy gradient from the global joint-action. Since the mixer and actors are updated in two independent steps, agents can synchronize the actor update by considering other agents' actions. The policy gradient is $$\nabla_{\theta}J(\theta)=E_{D}[\nabla_{\theta}\pi Q_{t o t}^{\pi}(\tau^{t},\pi_{1}^{t}(\tau_{1},\theta_{1}),\pi_{2}^{t}(\tau_{2},\theta_{2}),...,\pi_{n}^{t}(\tau_{n},\theta_{n}))]$$ $$\left({3}\right)$$ where π = π t 1 (τ1, θ1), πt2 (τ2, θ2)*, ..., π*tn (τn, θn)) is the collection of all agents' current policy. Using (3), the policy update of an agent does not only rely on its local observation and local action. Instead, the policy gradient is computed using the lasted estimated error from the mixer and the global sampled action µ. The details of the Loc-FACMAC framework are shown in Algorithm 1. Each agent has its individual actor and critic. The actor takes the inputs of current observation o t i and previous action µ t−1 ito compute conditional policy πi. Then, the current action µ t i can be sampled from the policy πi and fed into the critic. The critic produces the utility function Ui which evaluates actions taken by the actor. In the last stage, there are K mixers. Each mixer takes the outputs of the critic and the global state to find a monotonic function F estimating the total rewards of a partition i. The number of mixers is equal to the number of partitions P. Each partition contains a subgroup of agents and each agent has to belong to one partition, such that Ji ∩ Jj = ∅, ∀i, j ∈ 1*, ..., k*. For example, the set of Partition 2 in Figure 1 is denoted as J2 = {4, 5}. If κ = 1 is selected, the mixer takes the output of {2, 3, 4, 5} agents' critic as input to estimate QJ2 . ## 3.1 Construct Dependency Graph The Loc-FACMAC algorithm presented in the previous section assumes that the partitions are already given. In this section, we show how to construct a dependency graph and the partitions. Before training for the main policy, we first conduct a pretraining process to construct the dependency graph. The dependency graph, which delineates the relationship between agents' actions, is an important component of Loc-FACMAC. The topology of the dependency graph influences both the training efficiency and the performance of the models. An optimal dependency graph manifests as a sparse structure, connecting only a select few agents of the most significance. Hence, building on the insights of (Wang et al., 2022), we quantify the influence between agents, defined as the discrepancy in agent i with the inclusion of information from agent j. This is formalized as: $$\xi_{i j}=\operatorname*{max}_{a_{i}}\operatorname{Var}_{a_{j}}\left[q_{i}^{j}\left(\tau_{i},\tau_{j},a_{i},a_{j}\right)\right)\right]$$ Here, Var indicates the variance function. To obtain the estimation of q j i , we apply Independent Q-learning to learn the values. An example of a Coupled-Multi-Cart-Pole is shown in Figure 3. When ξij exceeds a threshold, a dependency edge between agent i and agent j is established. This threshold serves as a criterion to determine the significance of the mutual influence between agents. Agents with ξij surpassing the threshold are deemed to possess a substantial influence on each other's learning processes, warranting a connection in the dependency graph. Figure 3: The measurement ξij for all pairs of agent ![5_image_0.png](5_image_0.png) in Coupled-Multi-Cart-Pole environment. The higher value indicates a strong relationship between the agents. ## 4 Experiments In this section, we demonstrate the advantages of our proposed algorithm by comparing it with the other state-of-art MARL algorithms, QMIX (Rashid et al., 2018), FACMAC (Peng et al., 2021), and LOMAQ (Zohar et al., 2022) on two discrete cooperative multi-agent tasks: Coupled-Multi-Cart-Pole and BoundedCooperative Navigation. In Coupled-Multi-Cart-Pole and Bounded-Cooperative Navigation, our algorithm outperforms the other tested algorithms. The result also reveals that utilizing multiple mixers can enhance the maximum reward while the actor-critic controls the speed of convergence. Besides that, we study the effect of the dependency graph of agents and the cluster of rewards on the agents' overall performance. The following results will show that by delicately clustering the rewards of strongly related agents, the agents effectively learn a better policy. To construct the dependency graph, we operate under the assumption that agents share a strong relationship when their geometric distance is relatively small. If a strong relationship exists, it follows that a corresponding edge connecting the agents must be present in the dependency graph. ## 4.1 Coupled-Multi-Cart-Pole The Coupled-Multi-Cart-Pole problem described in Fig. 4 is developed by Zohar et al. (Zohar et al., 2022) based on the standard Cart-Pole problem. The objective of the Coupled-Multi-Cart-Pole problem is to hold the pole in an upright direction to receive positive rewards. The Coupled-Multi-Cart-Pole problem also restricts the cart movement by linking the cart to its neighboring carts with a spring. Hence, when a cart moves in one direction, its force also impacts the motion of its neighboring carts along the connected spring. Since the cart only impacts its neighboring carts, the relationship can be simply modeled as a linear graph. In the following, we show the simulation result of n = 6 carts cooperatively holding the pole for 300 steps, so the ideal maximum reward is 1800. We apply our approach Loc-FACMAC to compete Figure 4: This figure describes the partition for one specific environment of multi-cartpole. We can divide six carts into two possible partitions (2-2-2 and 3-3). There exist other possible partitions, such as 1-2-3. with QMIX, FACMAC, and LOMAQ. For Loc-FACMAC and LOMAQ, we set κ = 1 and partition the rewards into six, Pi = *i, i* = 1, 2*, ...,* 6 which is the maximum partition. In this experiment, Loc-FACMAC leverages the locality information and performs the best among all tested frameworks up to 45%. In Fig. 5a, Loc-FACMAC quickly reaches the maximum possible reward at around 140,000 steps. It takes another 150,000 steps to stabilize the rewards. Loc-FACMAC's outstanding performance is due to the integration of the merits of actor-critic and the multiple mixers. The actor-critic method can synchronize the update of agents' policy which guarantees the consistency of the agents' gradient and convergence speed. Adopting this approach, FACMAC converges (at around 250,000) much faster than LOMAQ and Qmix. Loc-FACMAC and FACMAC have a very similar reward pattern in that they both have a high initial momentum boosting the speed of convergence of the two approaches. Meanwhile, the weakness of FACMAC is obvious that FACMAC using a single mixer to coordinate agents overgeneralizes loss between the target global reward and the estimated global reward. The limitation is reflected in the maximum reward of FACMAC which is bounded above by 1250. On the other side, LOMAQ can sustainably improve the policy because of using multiple mixers to capture the detailed locality information. Using multiple mixers can better evaluate the performance of each cluster and hence, a higher reward can be reached. The performance of LOMAQ matches the expectation. LOMAQ has a relatively slower initial value compared to FACMAC and Loc-FACMAC, but it improves the reward sustainably over time and reaches approximately the same reward as FACMAC at 350,000. Loc-FACMAC combines the actor-critic method and multiple mixers so it is the fastest method achieving the highest possible reward among all tested methods and its reward is almost 3 times the fundamental method Qmix at 350,000 steps. In the aspect of performance, maximizing the number of partitions and the number of mixer inputs can reach the highest performance. However, the trade-off is increasing the computational time. In some machines with limited computational resources, the highest performance may not be their first concern. Therefore, we are also interested in understanding how the size of the partition affects the performance of reinforcement learning agents. In Fig. 5b, we tested LOMAQ and Loc-FACMAC with two different partitions: (1) 6 partitions, {{1},{2},...,{6}} and (2) 3 partitions, {{1,2},{3,4},{5,6}}. For the consistency of the experiment, the inputs of the mixers are always the same in which all agents are taken as the input. The result matches our expectation that if the number of partitions increases, the higher performance can be. The result of Loc-FACMAC using 6 partitions is overwhelming which reaches 1800 at around 140,000. Meanwhile, Loc-FACMAC using 3 partitions performs relatively well compared to LOMAQ using 6 portions and 3 partitions. It obtains roughly 1200 rewards at 350,000 which is slightly better than the number of rewards (1000) of LOMAQ using 6 partitions. Furthermore, in our experimentation, we conducted tests using the LOC-FACMAC algorithm in the environment with 12 agents. The results indicated that increasing the number of partitions in the environment had a positive impact on learning speed. ## 4.2 Bounded-Cooperative-Navigation Environment The Bounded-Cooperative Navigation task restricts the location of n agents in n bounded regions. The agents can move freely inside their pre-defined region. The bounded regions may have overlapped areas that multiple agents can access the area. The goal of the agents is to cooperatively cover all n landmarks. In this task, the agent's behavior will impact the agents sharing the bounded region. Therefore, if any two agents have a common bounded area, they are connected in the dependency graph. We applied Loc-FACMAC to nine agents' Bounded-Cooperative Navigation task. The number of partitions is 9, Pi = *i, i* = 1, 2*, ...,* 9 and κ = 1. The result in Fig. 5d shows that Loc-FACMAC significantly improves the speed of convergence in the Bounded-Cooperative-Navigation problem. In this problem, the structure of locality dominates the quality of agents' actions. An agent's local reward highly depends on whether its' neighboring agent has already covered a landmark in the common area. Agents can only receive local rewards if its covered landmark is available. Therefore, using only one mixer, the agent is nearly impossible to comprehend its contribution to the local reward because one mixer is not capable of estimating an accurate local reward from computing the global reward. Both Qmix and FACMAC use one mixer so their performance is no different in this task. They both reach approximately 200 rewards at 500,000 steps. In contrast, LOMAQ can reach a higher global reward which obtains 316 rewards at 500,000 steps. It uses multiple mixers to capture the detailed information of the locality so each agent estimates its action value from the perspective of local agents and ![7_image_0.png](7_image_0.png) ![7_image_1.png](7_image_1.png) (a) The simulation in Multi-Cartpole environment using the different frameworks. ![7_image_2.png](7_image_2.png) (b) The simulation in Multi-Cartpole environment comparing the Loc-FACMAC and LOMAQ with different partition sizes. (c) The simulation compares different partitions for one specific environment of the multi-cart pole using Loc-FACMAC. (d) The simulation in Bounded-CooperativeNavigation environment using the different frameworks. Figure 5: This figure compares the performance of the proposed loc-FACMAC algorithm against the baseline algorithms QMIX, LOMAQ, and FACMAC. global coordination. Similarly, Loc-FACMAC can achieve 300 rewards with a higher speed of convergence. It is due to Loc-FACMAC also utilizing the actor-critic to coordinate the policy update. Hence, it takes much less time to explore the optimal policy for this task. ## 5 Conclusions In this paper, we introduce Loc-FACMAC, a novel MARL method that combines reward locality with the actor-critic framework to enhance agent performance and learning efficiency. We validate Loc-FACMAC's effectiveness across two tasks, where it outperforms existing methods. Our findings also highlight the correlation between framework structure, maximum reward, and convergence speed. Future research will address challenges such as constructing dependency graphs without prior knowledge and re-evaluating the Individual-Global-Max (IGM) assumption's applicability. Addressing these challenges requires exploring constrained optimization in competitive settings and developing methods to model dynamic agent dependencies without prior assumptions. ## References Wendelin Böhmer, Vitaly Kurin, and Shimon Whiteson. Deep coordination graphs, 2020. Tianshu Chu, Jie Wang, Lara Codecà, and Zhaojian Li. Multi-agent deep reinforcement learning for large-scale traffic signal control. *IEEE Transactions on Intelligent Transportation Systems*, 21(3):1086–1095, 2019. Jakob Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients, 2017. Jianye HAO, Xiaotian Hao, Hangyu Mao, Weixun Wang, Yaodong Yang, Dong Li, YAN ZHENG, and Zhen Wang. Boosting multiagent reinforcement learning via permutation invariant and permutation equivariant networks. In *The Eleventh International Conference on Learning Representations*, 2023. URL https://openreview.net/forum?id=OxNQXyZK-K8. Xiaofan He, Huaiyu Dai, and Peng Ning. Faster learning and adaptation in security games by exploiting information asymmetry. *IEEE Transactions on Signal Processing*, 64(13):3429–3443, 2016. Tianchen Ji, Roy Dong, and Katherine Driggs-Campbell. Traversing supervisor problem: An approximately optimal approach to multi-robot assistance. *arXiv preprint arXiv:2205.01768*, 2022. Qize Jiang, Minhao Qin, Shengmin Shi, Weiwei Sun, and Baihua Zheng. Multi-agent reinforcement learning for traffic signal control through universal communication method. *arXiv preprint arXiv:2204.12190*, 2022. Andrés C Jiménez, Vicente García-Díaz, and Sandro Bolaños. A decentralized framework for multi-agent robotic systems. *Sensors*, 18(2):417, 2018. Andreas Kolling and Stefano Carpin. Multi-robot surveillance: an improved algorithm for the graph-clear problem. In *2008 IEEE International Conference on Robotics and Automation*, pp. 2360–2365. IEEE, 2008. Vijay Konda and John Tsitsiklis. Actor-critic algorithms. *Advances in neural information processing systems*, 12, 1999. Ryan Kortvelesy and Amanda Prorok. Qgnn: Value function factorisation with graph neural networks, 2022. Sheng Li, Jayesh K. Gupta, Peter Morales, Ross Allen, and Mykel J. Kochenderfer. Deep implicit coordination graphs for multi-agent reinforcement learning, 2021. Yong Liu, Weixun Wang, Yujing Hu, Jianye Hao, Xingguo Chen, and Yang Gao. Multi-agent game abstraction via graph attention neural network, 2019. Ryan Lowe, Yi I Wu, Aviv Tamar, Jean Harb, OpenAI Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. Advances in neural information processing systems, 30, 2017. Jun Ota. Multi-agent robot systems as distributed autonomous systems. *Advanced engineering informatics*, 20(1):59–70, 2006. Bei Peng, Tabish Rashid, Christian Schroeder de Witt, Pierre-Alexandre Kamienny, Philip Torr, Wendelin Boehmer, and Shimon Whiteson. Facmac: Factored multi-agent centralised policy gradients. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan (eds.), *Advances in Neural* Information Processing Systems, volume 34, pp. 12208–12221. Curran Associates, Inc., 2021. URL https: //proceedings.neurips.cc/paper/2021/file/65b9eea6e1cc6bb9f0cd2a47751a186f-Paper.pdf. Han Qie, Dianxi Shi, Tianlong Shen, Xinhai Xu, Yuan Li, and Liujing Wang. Joint optimization of multiuav target assignment and path planning based on multi-agent reinforcement learning. *IEEE access*, 7: 146264–146272, 2019. Tabish Rashid, Mikayel Samvelyan, Christian Schroeder, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. QMIX: Monotonic value function factorisation for deep multi-agent reinforcement learning. In Jennifer Dy and Andreas Krause (eds.), *Proceedings of the 35th International Conference on Machine* Learning, volume 80 of *Proceedings of Machine Learning Research*, pp. 4295–4304. PMLR, 10–15 Jul 2018. URL https://proceedings.mlr.press/v80/rashid18a.html. Tabish Rashid, Gregory Farquhar, Bei Peng, and Shimon Whiteson. Weighted qmix: Expanding monotonic value function factorisation for deep multi-agent reinforcement learning. *Advances in neural information* processing systems, 33:10199–10210, 2020. Mikayel Samvelyan, Tabish Rashid, Christian Schroeder De Witt, Gregory Farquhar, Nantas Nardelli, Tim GJ Rudner, Chia-Man Hung, Philip HS Torr, Jakob Foerster, and Shimon Whiteson. The starcraft multi-agent challenge. *arXiv preprint arXiv:1902.04043*, 2019. Kyunghwan Son, Daewoo Kim, Wan Ju Kang, David Earl Hostallero, and Yung Yi. Qtran: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International conference on machine learning, pp. 5887–5896. PMLR, 2019. Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, et al. Value-decomposition networks for cooperative multi-agent learning. *arXiv preprint arXiv:1706.05296*, 2017. Ming Tan. Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the tenth international conference on machine learning, pp. 330–337, 1993. Sergey Vorotnikov, Konstantin Ermishin, Anaid Nazarova, and Arkady Yuschenko. Multi-agent robotic systems in collaborative robotics. In *Interactive Collaborative Robotics: Third International Conference,* ICR 2018, Leipzig, Germany, September 18–22, 2018, Proceedings 3, pp. 270–279. Springer, 2018. Rose E Wang, Michael Everett, and Jonathan P How. R-maddpg for partially observable environments and limited communication. *arXiv preprint arXiv:2002.06684*, 2020. Tonghan Wang, Liang Zeng, Weijun Dong, Qianlan Yang, Yang Yu, and Chongjie Zhang. Context-aware sparse deep coordination graphs, 2022. Christopher JCH Watkins and Peter Dayan. Q-learning. *Machine learning*, 8(3):279–292, 1992. Zhiwei Xu, Dapeng Li, Yunpeng Bai, and Guoliang Fan. Mmd-mix: Value function factorisation with maximum mean discrepancy for cooperative multi-agent reinforcement learning. In *2021 International* Joint Conference on Neural Networks (IJCNN), pp. 1–7, 2021. doi: 10.1109/IJCNN52387.2021.9533636. Tianyu Zhang, Andrew Williams, Soham Phade, Sunil Srinivasa, Yang Zhang, Prateek Gupta, Yoshua Bengio, and Stephan Zheng. Ai for global climate cooperation: Modeling global climate negotiations, agreements, and long-term cooperation in rice-n. *arXiv preprint arXiv:2208.07004*, 2022. Roy Zohar, Shie Mannor, Guy Tennenholtz, , and and. Locality matters: A scalable value decomposition approach for cooperative multi-agent reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 9278–9285, 2022. ## Appendix A Background QMIX (Rashid et al., 2018) is a recent framework adopting Centralised Training with Decentralised Execution (CTDE) to solve cooperative MARL tasks. The framework consists of individual agent networks representing the action value functions Qi and a mixing network that combines the action values of all agents to obtain the global joint-action value Qtot. Note that each Qiis technically a utility function as they do not directly estimate the discounted expected return. In the training stage, the mixing network can access global state information and the global joint-action value. The purpose of the mixing network is to eliminate the difference between Qtot and the function of the action-value set (Q1, Q2*, ..., Q*N ), such that $$Q_{t o t}(\mathbf{\tau},\mathbf{a})=f_{\psi}(\mathbf{\tau},Q_{1}(\tau_{1},a_{1}),Q_{2}(\tau_{2},a_{2}),Q_{N}(\tau_{N},a_{N})),$$ where τiis the local action-observation history of agent i and aiis the local action specific to agent i. Here, fψ is required to be a continuous monotonic function to ensure the consistency between the global optimal action and the agents' optimal action. The loss function of QMIX is given by $$L(\theta,\psi)=\sum_{i=1}^{b}(y_{i}^{t o t}-Q_{t o t}(\mathbf{\tau},\mathbf{a};\theta,\psi))^{2},$$ $$|\rangle$$ $$\left({5}\right)$$ where b is the batch size of transitions sampled from the replay buffer and y tot i = r + γ maxa′ Qtot(τ ′, a ′; θ −, ψ−)) is the target value of Qtot. Here, θ and ψ are the parameters of the agent's network and the mixing network, respectively. Through back-propagation, θ and ψ are adjusted to minimize the loss. Accordingly, the learned action-value function Ui can properly evaluate the quality of the action and it only depends on the local observation and the parameter θi. In the execution stage, each agent only maximizes its local action value using the local observation. LOMAQ (Zohar et al., 2022) extends the idea of QMIX and improves the algorithm efficiency using the locality of rewards. The core idea is that the agents can be partitioned into different K clusters {Jk} K k=1 which defines a partition P, such that Jk ∩ Jl = ∅, ∀k ̸= l and Sk Jk = V. LOMAQ proved that under the Q-Summation Maximisation (QSM) Condition given by: $$\max_{\mathbf{a}}\sum_{i=1}^{n}Q_{i}^{\pi}(\mathbf{\tau},\mathbf{a})=\sum_{J\in\mathcal{P}}\max_{\mathbf{a}}\sum_{i\in J}^{n}Q_{i}^{\pi}(\mathbf{\tau},\mathbf{a}),$$ we can exploit the locality of rewards to reduce the regret of decisions. LOMAQ utilizes K mixers where the value of K can be defined manually to leverage the property of reward locality. Each mixer corresponds to the joint-action value function of one partition J so that the mixer can map the local action values to the joint-action value of the partitions. The loss function of LOMAQ is $$L_{F}(\theta,\psi)=\mathbb{E}_{\mathbf{s},\mathbf{a},\mathbf{s}^{\prime}}{\Bigg[}\sum_{J\in\mathcal{P}}\left(y_{J}-F_{J}^{\psi}(Q_{i\in J}^{\theta}(\tau_{i},a_{i}))^{2}\right],$$ where yJ =Pj∈J rj + γ maxa′ F ψ J (Qθ i∈J (τ ′ i , a′i )) is the target reward of partition J, and FJ is the joint-action value function of J. FACMAC (Peng et al., 2021) is a recent state-of-art framework proposed by Peng et al. (2021). This approach resolves the limitation of biased updates in QMIX by utilizing a factorized critic in an actor-critic framework. Each agent has a critic and an actor. The actor takes the local observation oi(t) and the past action ai(t − 1) as the input to compute the local policy πi. Then, the action ai(t) is sampled from πi. The function of the critic is to evaluate the local action value Qi from ai(t) and τi(t). Similar to the structure of QMIX, FACMAC contains a mixer responding to coordinate all agents' actions by mapping Qi to the joint-action value Qtot. Hence, the loss function of the joint-action value function is the same as the loss function in QMIX. Agents' action value functions are updated using the policy gradient given by: $$\nabla_{\theta}=\mathbb{E}_{\mathcal{D}}[\nabla_{\theta}\mu Q_{t o t}^{\mu}(\tau,\mu_{1}(\tau_{1},a_{1}),\mu_{2}(\tau_{2},a_{2}),...,\mu_{n}(\tau_{n},a_{n}))],$$ tot(τ , µ1(τ1, a1), µ2(τ2, a2), ..., µn(τn, an))], (7) $$({\mathfrak{h}})$$ where D is the data buffer and θ is the parameter of actor network. The back-propagation of FACMAC relies on a single joint-action value Qtot. This means that even if an agent does not contribute to the reward in a particular step, the policy gradient ∇θ still updates its parameters. On the other hand, LOMAQ does not take into account the impact of changing other agents' parameters when updating its parameters, resulting in a slower convergence time. To address these limitations, we propose a novel approach called LOC-FACMAC, which combines the strengths of both methods. ## B Details Of The Environments Multi-Cartpole environment is a variant of Single Cartpole environment. Each agent has to uphold its pole to obtain the reward. Each agent can obtain a +1 reward when its pole does not fall. Multi-Cartople adds a restriction on the Single cart pole that each agent is connected to its neighbor by a spring. Each agent has two inputs that can control its agent to move toward left or right. Its motion affects its neighbor by applying force to the spring. The state of an agent is a four-dimension vector that includes the position, velocity, pole angle, and pole angular velocity. An agent can observe two neighborhood agents' states. The global state is a collection of the state of all agents. Bounded-Cooperative-Navigation is a task in which each agent has to cover a landmark and avoid collision with their agent in its own common area. Each agent is bounded in a circle region and has some areas overlapping with near agents. The reward of an agent is computed by three factors: occupant reward, bonus reward, and collision reward. The occupant reward is triggered when an agent covers the landmark and another agent does not cover the landmark. The value of the bonus reward is based on the distance between the agent and the landmark to enough agent to move toward the landmark. The collision reward punishes the agent when it collides with another agent. The agent can observe the nearby agents' relative position, the landmark's relative position, and the number of occupant landmarks. The state is the collection of agents' velocity, agents' position, and landmarks' position. ## C Dependency Graph The construction of a dependency graph is important in Loc-FACMAC. If the dependency graph can accurately reflect the relationship of all agents, the network update can target the most correlated agents and improve the efficiency of the training. The construction of a dependency graph requires prior knowledge of the problem. In the graph, each agent is considered as a node. If the agent i is affected by the agent j, the node i and the node j should be connected. The partition in each mixer can be determined manually based on the need of the task and the amount of resources. The smaller size of the partition can provide more locality information and better performance but it also increases the computational time. Also, according to the dependency graph, the strongly related agents should be grouped into one partition. By grouping strong relationship agents into the same partition, the locality of the rewards becomes meaningful because it can truly reflect the performance of the related cooperative agents. ## D Hyper-Parameters | Hyperparameter | Values | |--------------------------------|----------------------------------------------------------| | ϵstart | 1.0 | | ϵend | 0.05 | | ϵ anneal time | 50000 | | batch size | 128 | | γ | 0.99 | | κ | 1 | | grad norm clip | 20 | | actor learning rate | 0.0025 | | mixer and critic learning rate | 0.008 | | td lambda | 0.2 | | target update mode | soft | | target update rate | 0.5 | | target update interval | 50 | | Mixer | Linear, Relu, Linear, ReLu, Linear (mixing embed dim 32) | | Parameter Sharing in Mixer | No | | Critic | Linear, Linear, Linear (embed dim 64) | | Actor | Linear, Relu, GRU, Linear (hidden dim 64) | Table 2: Experiment 1:Multi-Cartpole | Hyperparameter | Values | |--------------------------------|----------------------------------------------------------| | ϵstart | 1.0 | | ϵend | 0.05 | | ϵ anneal time | 100000 | | batch size | 128 | | γ | 0.99 | | κ | 1 | | grad norm clip | 20 | | actor learning rate | 0.0025 | | mixer and critic learning rate | 0.0005 | | td lambda | 0.2 | | target update mode | soft | | target update rate | 0.5 | | target update interval | 50 | | Mixer | Linear, Relu, Linear, ReLu, Linear (mixing embed dim 32) | | Parameter Sharing in Mixer | No | | Critic | Linear, Linear, Linear (embed dim 64) | | Actor | Linear, Relu, GRU, Linear (hidden dim 64) | Table 3: Experiment 2: Bounded-Cooperative-Navigation
Review 1: Summary: This paper extends the idea of LOMAQ to FACMAC and presents a Locality-based Factorized Multi-Agent Actor-Critic (Loc-FACMAC) framework. The core idea is to manually break the global multiagent learning problem into a set of local multiagent learning problems based on the predefined locality structure. By connecting strongly related agents into partitions and directly utilizing the local summed reward to guide the local critic learning, Loc-FACMAC adopts additional human priori and locality knowledge to help the agents achieve better credit assignments (instead of simply telling the agent a global shared reward). Experiments on three environments (Multi-cartpole, the StarCraft Multi-Agent Challenge, and Bounded-Cooperative-Navigation) demonstrate that when the locality structure is appropriately defined, Loc-FACMAC can achieve better performance. Strengths and Weaknesses: **Strengths:** * The paper studies an important problem, namely introducing locality to help the MARL algorithms do better credit assignments. * Most of the paper is well-written and easy to follow. * Extensive experiments are conducted to show the effectiveness of the proposed method. **Weaknesses:** * The proposed method is a simple combination of LOMAQ and FACMAC, i.e., replacing the utility function and mixing function of FACMAC with LOMAQ. The contribution is very limited. * Some descriptions are inaccurate. Some words are overclaimed. * "So the critic can precisely evaluate the quality of action value `without being influenced by the choice of actions`." Though the critic can use the off-policy learning technique, the values are also influenced by the actions. * "The actor learns from the high-quality local action value function and `quickly converges to an optimal policy.`" Can we ensure it's the optimal policy? * "Besides that, the actor in the actor-critic approach outputs an action instead of the action value. It is extremely useful when the action space is large since it can `discard the search time` of the highest action value from all actions." If learning a stochastic policy, sampling from the policy costs almost the same time as picking the highest action value. * "The actor generates an `optimal action` based on the local observation and historical actions." The 'optimal action' is overclaimed. * Some symbols are inaccurate and inconsistent, and in some instances, explanations for the symbols are not provided. * In Eq.1, the meaning of the bold symbol $\boldsymbol{\tau}$ and $\boldsymbol{a}$ is not given. * Below Eq.1, in $\mathbb{E}\left[\sum_{l=0}^{\infty} \gamma^t r_i\left(\tau_i(t), a_i(t)\right)\right]$, $l$ should be $t$. * `Eq.3 has some errors.` Eq.3 should be $\nabla_{\theta_i}=E_D[\nabla_{\theta_i}\pi_i \nabla_{a_i} Q_{tot}(\boldsymbol{\tau}, a_1, \cdots,a_n)|_{a_i=\pi_i(\tau_i, \theta_i)}]$ * Below Eq.3, $\mu_i^t$ indicates the action of agent $i$ at step $t$. However, in Eq.7, $\nabla_\theta=E_D[\nabla_\theta \mu Q_{\text{tot }}^\mu({\tau}, \mu_1(\tau_1, a_1), \mu_2(\tau_2, a_2), \ldots, \mu_n(\tau_n, a_n))]$, the meaning of $\mu$ is changed and is not given. * The title of Fig.4d is wrong. 'Multi-Cartpoles' should be 'Bounded-Cooperative-Navigation' * Some important related works, which also adopt the locality structure to help do credit assignments or achieve SOTA performance on MARL benchmarks, are missing. * Deep coordination graphs, ICML 2020. * Context-aware sparse deep coordination graphs, ICLR 2021. * Deep Implicit Coordination Graphs for Multi-agent Reinforcement Learning, AAMAS 2021. * Boosting Multiagent Reinforcement Learning via Permutation Invariant and Permutation Equivariant Networks, ICLR 2022. * Multi-agent game abstraction via graph attention neural network, AAAI 2020. Requested Changes: * Since adopting the manually defined locality structure to boost the learning procedure is the main contribution of LOMAQ, developing methods to model dependency graphs without prior knowledge or assumptions would be a great contribution to this paper. * Some important related works, which also adopt the locality structure to help do credit assignments or achieve SOTA performance on MARL benchmarks, are missing. * Deep coordination graphs, ICML 2020. * Context-aware sparse deep coordination graphs, ICLR 2021. * Deep Implicit Coordination Graphs for Multi-agent Reinforcement Learning, AAMAS 2021. * Boosting Multiagent Reinforcement Learning via Permutation Invariant and Permutation Equivariant Networks, ICLR 2022. * Multi-agent game abstraction via graph attention neural network, AAAI 2020. * The SMAC benchmark is outdated, as many tasks have been shown to be trivially solvable due to the lack of stochasticity in the SMAC benchmark. The multi-agent coordination benchmark proposed in "Context-aware sparse deep coordination graphs" can be used to verify the effectiveness of the locality structure. * Some experimental settings are not clear. * For the Multi-Cartpole environment, since there are 6 carts in total, what's the difference between independent learning (e.g., independent actor-critic or independent Q-learning) and Loc-FACMAC if setting the cluster number also to 6? * Since Loc-FACMAC requires the local reward when updating the critic networks, do the authors modify the SMAC environment as it originally only provides a shared global reward? * $\mathcal{N}(\mathcal{J})$ is the $\kappa$-hop neighbourhood of $J$. In the experiments, what is the value set for $\kappa$? * It’s not clear how many seeds the work used for the main experimental results. The results should be reported across at least 10 seeds. Minor: * In the second paragraph, "value-based approaches are commonly used ...". The first letter should be capitalized. Broader Impact Concerns: The main concern is that the proposed method is a simple combination of LOMAQ and FACMAC, i.e., replacing the utility function and mixing function of FACMAC with LOMAQ. The contribution may be very limited. ================================================== Review 2: Summary: This work focuses on improving the performance of cooperative multi-agent reinforcement learning. The authors propose adding agent partitioning to the FACMAC algorithm. Essentially combining FACMAC and LOMAQ to support training teams with partition. Strengths and Weaknesses: Strength: First of all, the paper is overall well-written and easy to follow. The related works are referenced with good descriptions. Weakness: I have a few concerns with this paper: - The novelty seems limited in this work. The challenge of the paper is not too clear, it is simply combining FACMAC and LOMAQ. What are the challenges for doing agent partitioning on FACMAC? - In more complicated environments such as SMAC, how do you partition the global rewards into rewards of each partition? Does it require environment support? - The evaluation results seem to show that the performance improvement is marginal for more complicated environments: For the SMAC benchmark, the proposed algorithm is similar to the baselines. - Minor error: 1) Figure 4 "(c) he simulation ..." -> "(c) The simulation ..." 2) Figure 4 subfigure (6) caption is about " Bounded-CooperativeNavigation ", but the title is "Multi-Cartpole" Requested Changes: - clarify the contribution and novelty of this work. Try to provide the challenges of proposed solution and how you solve this challenges. - describe in more detail how the proposed solution work for more complicated environments such as SMAC and demonstration its performance improvement over previous work. - fix the minor errors mentioned above Broader Impact Concerns: N/a ================================================== Review 3: Summary: In this paper, the authors argue that one centralized value function cannot assign reasonable credit to each agent, and propose to use the locality of rewards to learn a grouped value function for each group. The idea is combined with an existing algorithm FACMAC, and evaluated on three multiagent environments. Strengths and Weaknesses: Strengths, 1) The idea of learning several grouped value functions based on the locality structure reflects the sparse interaction property in MASs, which makes sense. 2) Experimental results show promising results given pre-defined partitions of agents compared with non-partitioned algorithms. Weaknesses, 1) The novelty of this paper is limited, as the paper seems like a combination of two existing methods, LOMAQ and FACMAC. The paper simply extends LOMAQ to the actor-critic version. 2) Some technical details are unclear and need to be clarified. 3) Although the limitations of this paper have been discussed, some key aspects are unlisted. 4) The literature review is not extensive and lacks related work to this paper. Requested Changes: 1. The authors argue the paper resolves the FACMAC limitation of overgeneralized policy gradient, while the results do not support this claim well. The reviewer suggests providing a toy example (task) with the overgeneralized phenomenon and verifying how Loc-FACMAC resolves it empirically. 2. The reviewer is confused with the partition. From the definition, different groups do not contain the same agent. As in Figure 1, there are two partitions {1,2,3} and {4,5}. Since Agent 2 also connects to Agent 5, which means they are influenced by each other, how does the proposed method consider the connections among different groups? 3. The notations are confusing, for example, in Section 2, the value functions are denoted as $Q_i$, $Q_{tot}$, while in Section 3, $U_i$ is used to represent the utility function, are they the same thing? What's $F$? Is this a mixing network? 4. The Figure 2 is never referenced in the paper. 5. The partition method is not discussed in Section 3. How is it difficult to define the partition for each task is not discussed either. Some papers have already investigated how to measure the relationships among agents automatically, for example [1], the authors should conduct a comprehensive literature review from this direction. [1] Multi-Agent Game Abstraction via Graph Attention Neural Network. 2020. Broader Impact Concerns: Not applicable. ================================================== Metareview: Recommendation: Reject Comment: The reviewers were unanimous in their recommendation of leaning toward reject. In their official recommendations, one reviewer commented that their main concern is about the contribution. The proposed method is a simple combination of LOMAQ and FACMAC, i.e., replacing the utility function and mixing function of FACMAC with LOMAQ. Also, they stated that the evaluation results seem to show that the performance improvement is very limited. As a result, the claims made in the paper are not well supported by the experimental results. There was also a specific note about some outstanding problems with the methodology: the authors argue the paper resolves the FACMAC limitation of overgeneralized policy gradient, while the results do not support this claim well. The partition method is not discussed in Section 3. How difficult it is to define the partition for each task is not discussed either. Given the unclarified concerns, the reviewer suggests the authors carefully prepare a new version of the paper and consider re-submitting it again or to other venues. The last reviewer commented mainly on novelty. As novelty is not a criterion for acceptance at TMLR, in principle this is not a strong determining factor for the decision. However, I would advise the authors to be conservative about claims of novelty and omit any explicit claims of novelty in the list of contributions. Given the modest gains of the empirical comparison, as a reader I'm left wondering if the added complexity of the Loc-FACMAC is worth the performance. This criticism is reflects on the significance of the paper. I encourage the authors to find a setting where the empirical results more convicingly support the motivation to use Loc-FACMAC. This was a difficult decision as I believe the paper falls just short of the TMLR acceptance bar. Iencourage the authors to take all the feedback into consideration and resubmit an improved version of the paper with the issues addressed. ==================================================
# Recurrent Inertial Graph-Based Estimator (Ring): A Single Pluripotent Inertial Motion Tracking Solution Anonymous authors Paper under double-blind review ## Abstract This paper introduces a novel ML-based method for Inertial Motion Tracking (IMT) that fundamentally changes the way this technology is used. The proposed method, named RING (Recurrent Inertial Graph-Based Estimator), provides a pluripotent, problem-unspecific plug-and-play IMT solution that, in contrast to conventional IMT solutions, eliminates the need for expert knowledge to identify, select, and parameterize the appropriate method. RING's pluripotency is enabled by a novel online-capable neural network architecture that uses a decentralized network of message-passing, parameter-sharing recurrent neural networks, which map local IMU measurements and nearest-neighbour messages to local orientations. This architecture enables RING to address a broad range of IMT problems that vary greatly in aspects such as the number of attached sensors, or the number of segments in the kinematic chain, and even generalize to previously unsolved IMT problems, including the challenging combination of magnetometer-free and sparse sensing with unknown sensor-to-segment parameters. Remarkably, RING is trained solely on simulated data, yet evaluated on experimental data, which indicates its exceptional ability to zero-shot generalize from simulation to experiment, while outperforming several state-of-the-art problem-specific solutions. For example, RING can, for the first time, accurately track a four-segment kinematic chain (which requires estimating four orientations) using only two magnetometerfree inertial measurement units. This research not only makes IMT more powerful and less restrictive in established domains ranging from biomechanics to autonomous systems, but also opens its application to new users and fields previously untapped by motion tracking technology. Code and data is available here. ## 1 Introduction In the domain of multi-agent systems, structural policies have shown great potential for the control of complex agents; meanwhile, Recurrent Neural Networks (RNNs) are an established choice for sequential data. The potential of their combination for the analysis of structural sequential data has rarely been investigated and exploited. This combination seems particularly promising for state estimation in graph-structured systems, such as, for example, for IMT of Kinematic Chains (KCs). The need for reliable and accurate estimation of the orientation, attitude, or pose of articulated objects in three-dimensional (3D) space spans across various application domains ranging from aerospace engineering (Euston et al., 2008; Givens & Coopmans, 2019) to health applications (Buke et al., 2015; López-Nava & Muñoz-Meléndez, 2016; Seel et al., 2020). Inertial Measurement Units (IMUs), which typically comprise a 3D accelerometer, a 3D gyroscope, and a 3D magnetometer, have become smaller and less expensive within the last two decades and have therefore rapidly become the most promising technology for accurate, reliable, and inexpensive motion tracking in rigid bodies and KCs, especially since camera-based systems are typically more expensive, more restrictive, and suffer from occlusion (von Marcard et al., 2017; Huang et al., 2018). However, fusing the available measurement signals to estimate the desired orientations requires advanced IMT algorithms that typically need to overcome a combination or all of the following three main IMT challenges (Seel et al., 2020): (1) inhomogeneous magnetic fields in indoor environments and in proximity of ![1_image_0.png](1_image_0.png) Figure 1: RING is a ML-based method that provides a versatile, pluripotent IMT solution applicable across a broad range of challenging IMT problems, designed for use without the need for expert knowledge. Remarkably, RING is trained solely on simulated data, yet zero-shot generalizes to real-world experiments and outperforms several problem-specific state-of-the-art solutions. ferromagnetic material or electric devices; (2) sensor-to-segment calibration, i.e. identifying the joint position and axis orientations in local sensor coordinates; (3) solving sparse problems in which some segments of the KC are not equipped with a sensor, to improve the usability and reduce costs. In recent years, numerous highly specialized methods have been proposed to address these challenges. Magnetometer-free methods have been developed to estimate the relative orientation between two adjacent segments by exploiting different kinematic constraints (Kok et al., 2014; Laidig et al., 2017; Lehmann et al., 2020; 2024). Moreover, numerous general-purpose magnetometer-free attitude estimators have been proposed (Mahony et al., 2008; Madgwick, 2010; Seel & Ruppin, 2017; Weber et al., 2021; Laidig & Seel, 2023). Several algorithms were developed to achieve sensor-to-segment calibration for specific kinematics with full sensor setups (Taetz et al., 2016; McGrath et al., 2018; Olsson et al., 2020). Finally, a variety of sparse IMT methods have been developed that either use a limited number of sensors while still depending on magnetometers (von Marcard et al., 2017; Huang et al., 2018; Sy et al., 2020; 2021; Zheng et al., 2021) or are magnetometer-free (Grapentin et al., 2020; Yi et al., 2021; 2022; Bachhuber et al., 2023; Van Wouwe et al., 2023). In summary, there exists a plethora of methods, each tailored to a very specific application, such as magnetometer-free tracking of a single-degree-of-freedom (1-DoF) joint (Lehmann et al., 2020), or human pose estimation from six IMUs, as detailed in Yi et al. (2021). To apply IMT, the user must successfully identify the method that is suitable for the given problem and typically specify various parameters such as joint axes directions and sensor placement. Therefore, the user must be an expert in the field of IMT, which strongly limits the use of IMUs in many application domains. To make matters even worse, a given problem might require a nontrivial combination of methods which may exclude each other, e.g., the tracking of a sparse three-segment KC currently requires known joint axes directions (Bachhuber et al., 2023), but the method that estimates the joint axes directions does not allow for a sparse sensor setup (Olsson et al., 2020). What if, instead of a plethora of methods, we had a single *pluripotent* method that can be used for, e.g., magnetometer-free tracking of 1-DoF joints, and the tracking of sparse sensor setups with known or even unknown joint axes directions? What if we had one to track them all? In this work, we demonstrate that ML methods can be used to, for the first time, achieve this goal. We propose a method, named RING, that combines a novel neural network architecture, named RINGCell, with an elaborate training data simulation, the Random Chain Motion Generator (RCMG). The key insight that enables the pluripotency of RING is that a given system in an Inertial Motion Tracking Problem (IMTP) can be viewed as a graph where nodes represent segments and edges represent a single DoF. Then, a shared set of parameters can be applied on a decentralized, per-node level, where only local IMU measurements are observed and only the local estimation problem is solved, i.e., the orientation relative to the parent is estimated. Information exchange between nodes is enabled by passing messages along the edges of the graph. We show that RING can be used to plug-and-play solve a range of challenging magnetometer-free sparse or non-sparse motion tracking problems with a single trained neural network and that it even solves previously unsolved challenging IMTPs, such as, e.g., the tracking of a triple-hinge-joint system with only two IMUs. We demonstrate that although RING is trained solely on simulated data, it zero-shot generalizes to experimental data and aligns with various state-of-the-art (SOTA) results. ## 2 Related Works As mentioned above, there exists a plethora of highly specialized methods in the field of IMT, but there is no single pluripotent solution that solves a variety of IMTPs. Even the use of ML methods for IMT has so far only led to specific solutions for single IMTPs. RNNs have been used in Weber et al. (2021) to achieve SOTA attitude estimation, and in Bachhuber et al. (2023) to successfully track a specific sparse KC. Deep learning has also been used for human motion capture, where the full-body pose is estimated from typically six or more IMUs, and previous work has shown promising results (von Marcard et al., 2017; Huang et al., 2018; Zheng et al., 2021; Yi et al., 2021; 2022; Van Wouwe et al., 2023; Puchert & Ropinski, 2023). However, while addressing a challenging problem, these methods are limited to human motion capture with one specific sensor setup and assume statistical patterns of human motion (von Marcard et al., 2017), or full-body biomechanical models (Yi et al., 2022) to constrain the estimated pose. From a methodological viewpoint, RING uses a decentralized network of message-passing RNNs with shared parameters that are trained via supervised learning. The concept of decentralized networks, communication, and collaboration is at the heart of multi-agent systems, and the means of communication can either be prescribed (Panait & Luke, 2005; Wang et al., 2019) or, more recently, learned (Sukhbaatar et al., 2016; Foerster et al., 2016; Wang et al., 2018; Pathak et al., 2019; Huang et al., 2020). In deep Reinforcement Learning (RL), feedforward networks have been used to parameterize structured policies that pass messages along the edges of a graph in Sukhbaatar et al. (2016); Foerster et al. (2016); Wang et al. (2018); Huang et al. (2020), and distinct advantages of message-passing have been shown. In particular, in Huang et al. (2020) it was investigated whether centralised control can emerge from decentralized policies, and they show that it is possible to learn a global policy that achieves locomotion across various agent morphologies. It is interesting to note that policies must collaborate in order to achieve a global task, e.g., locomotion, and are motivated by a global reward. In the present work, the decentralized RNNs must collaborate by exchanging information in order to solve the task of motion tracking, and are motivated by a decentralized loss function. The advantages of communication and global coordination emerging in a decentralized structure were also investigated in Sukhbaatar et al. (2016); Foerster et al. (2016). In particular, the work of Sukhbaatar et al. (2016) uses supervised learning instead of RL for learning communication protocols. ## 3 Preliminaries 3.1 Notation We use a typical notation with scalars denoted by x, vectors by x, matrices (or higher dimensional tensors) by X, and quaternions (or higher dimensional arrays of quaternions) by q. Additionally, note that the symbol 1 defines either the unity element of a given space, or the indicator function, such that, e.g., 10(i) is one for i = 0 and zero else. The symbol ⊗ is used to denote the direct product of vector spaces, and additionally denotes quaternion multiplication, see Definition B.2. Further details can be found in Appendix A.1. ## 3.2 An Inertial Motion Tracking Problem We define an IMTP as the task of estimating the trajectory of the complete rotational state of an Articulated Rigid-Body System (ARBS) from inertial data. Conceptually, an ARBS is a collection of multiple rigid (or assumed to be rigid) bodies that are interconnected via joints that allow for relative motion between these bodies. Let there be a singleton, inertial reference coordinate system named *base* (sometimes *world*, or *Earth*), then an orientation of a body relative to the base is referred to as an absolute orientation. An orientation of a body relative to the coordinate system of another body is referred to as a relative orientation. Then, assuming that no additional information about the types of joints is provided, to fully describe the rotational state of an ARBS that consists of N bodies at a single moment in time, N orientations must be specified. In this work, we will utilize N − 1 relative orientations and one absolute orientation. An IMTP is solved by estimating the rotational state from at most N IMUs that are connected to the bodies of the ARBS (at most one IMU per body), and that provide 3D measurements of angular rates, specific forces, and the magnetic field density in their local sensor coordinates. A magnetometer-free method solves an IMTP without the use of the magnetometer, and such IMUs are referred to as 6D IMUs. In this case, the rotational state of the ARBS can only be estimated up to an absolute heading error, that is, up to an arbitrary rotation around the gravity vector, and the one absolute orientation is referred to as the absolute attitude. Finally, note that if at least one body of the ARBS does not have an IMU attached, then the IMTP is said to be sparse. ## 3.3 Graph Connectivity The topology of an ARBS is represented by a Connectivity Graph (CG) (Featherstone, 2008; 2010), which is an undirected graph where the nodes represent the bodies that constitute the ARBS and the edges represent its joints. Before the CG can be encoded, the bodies must be numbered. We adopt the broadly adopted standard numbering scheme and notation from Featherstone (2008; 2010) which for an ARBS with N bodies proceeds as follows: 1. The base is assigned the number 0 and it serves as the root node. $$\mu_{\lambda}(i)=\{j\mid\lambda[j]=i\quad\forall j=1\ldots N\}\,.$$ 2. The remaining bodies are consecutively numbered from 1 to N, so that each body has a higher number than its parent. The CG may then be encoded via a parent array λ ∈ N N where λ[i] is the body number of the parent of body i. Additionally, we define the function µ(i) to return the set of the body numbers of the children of body i, that is µλ(i) = {j | λ[j] = i ∀j = 1 *. . . N*} . (1) Definition 3.1. The body i of an ARBS with parent array λ is said to be an outer body if it has no children bodies, i.e., µλ(i) = {}, or if its parent is the base, i.e., λ[i] = 0; otherwise it is said to be an inner body. As an example, consider an ARBS that is a three-segment KC (see 2). There, the three bodies are numbered increasingly from top-to-bottom, and then, for this numbering, the parent is given by λ = (0, 1, 2)⊺. Note that if the inner body (middle segment) is assumed to connect to the base, then the parent array is different and given by λ = (0, 1, 1)⊺. ## 3.4 Minimal And Maximal Coordinates We refer to the generalized coordinates position vector as the minimal coordinates, denoted by q. It fully captures the kinematic state of the ARBS using a minimal amount of coordinates. The size of q depends on the DoFs of the joints in the ARBS. In this work, we will consider ARBSs that can move freely in space (without any constraints). Therefore, in the corresponding CG, the edges that connect to the base are 6-DoF free joints and all the remaining edges represent single DoF. Definition 3.2. For an ARBS with N bodies with a CG given by λ where the joints that connect to the base are 6-DoF and 1-DoF otherwise, the size of q is given by Nq =PN i 710(λ[i]) + (1 − 10(λ[i])). Similarly, the size of the velocity of minimal coordinates q˙ is given by Nq˙ =PN i 610(λ[i]) + (1 − 10(λ[i])). For an ARBS with N bodies, we refer to the set of all euclidean positions and rotational states from the base to all bodies in the system as the maximal coordinates, denoted by t ∈H ⊗ R 3N. The size of t depends only on the number of bodies in the system. $\left(1\right)$. ## 3.5 Representing Orientations We represent 3D orientations with quaternions q due to various advantages over equivalent representations using orthogonal matrices or Euler angles (Kuipers, 2002). In particular, we use 01q ∈ H to denote the absolute orientation from the base to the body one's coordinate system. Similarly, we use 12q to denote the relative orientation from body one to body two. In Appendix B, we define various utilized quaternion-related operations. ## 3.6 Loss Function For Orientations In order to train and evaluate ML methods that predict orientations (represented by quaternions), a suitable metric function must be identified. We can compare the difference between a ground truth orientation q and the corresponding predicted orientation ˆq by computing the angle of the smallest rotation that makes ground truth and prediction identical. It is given by angle(q ⊗ ˆq ∗) where ⊗ denotes quaternion multiplication, ∗ denotes the complex conjugate, and angle extracts the rotation angle of a quaternion (see Appendix B.5). Then, we use the following mean-squared-error function loss : q ∈ H, ˆq ∈ H → R≥0 to calculate a scalar error between two quaternions, given by loss(q, ˆq) = angle(q ⊗ ˆq ∗) 2. (2) The loss function for a single orientation in eq. (2) is then used to compute the mean-squared-error for the entire rotational state of the KC in eq. (7). ## 4 Method In this section, we define the problem under consideration and the proposed method which consists of three components: - A virtually infinite, simulated training data set (see Section 4.2). - A novel, online-capable neural network architecture, named RINGCell, purpose-built for state estimation in ARBS (see Section 4.3). In contrast to typical RNNs that map a fixed number of input features to a fixed number of output features using a centralized logic, RINGCell leverages the graph-structure of ARBS and employs a decentralized, message-passing logic with a shared set of parameters. This design maps a fixed number of input features *per body* to a fixed number of output features *per body*, and it allows RINGCell to adapt to the size and topology of the ARBS without the need for retraining. - A powerful IMT solution, named RING, that can solve a broad range of IMTPs in the real world (see Section 4.4). RING is obtained by training RINGCell on the simulated training data. Finally, Section 4.5 provides a software implementation of the entire method and, more specifically, RING. Most notably, we provide a single file that trains the here benchmarked version of RING from scratch without requiring any files that contain real-world training data. ## 4.1 Problem Formulation: A Class Of Inertial Motion Tracking Problems In this work, we consider the following class of IMTPs. We consider an N-segment KC where N ∈ {1, 2, 3, 4} with unknown physical geometry and with segments that are interconnected via hinge joints. The axes directions of these hinge joints may be *known or unknown*. For each inner body *at most one* and for each outer body exactly one 6D IMU, with unknown sensor-to-body position, is *rigidly or nonrigidly* attached to each body. For each body and with the KC at rest, the constant sensor-to-body orientation is assumed to be known. The initial pose of the ARBS is assumed to be unknown. Then, the task is to estimate, for every timestep, the rotational state of the KC (consisting of N orientations) from the available IMU measurements and the available joint axes directions. Note that the task requires providing accurate estimates at each ![5_image_0.png](5_image_0.png) Figure 2: System object example (see Definition 4.2) for a three-segment KC with N = 3 bodies and parent array λ3 = (0, 1, 2)⊺. timestep, thus necessitating an online-capable solution focused on online, real-time processing (filtering) as opposed to retrospective data processing (smoothing). To summarize, two IMTPs of this class of IMTPs can differ in: 1) the number of bodies N in the KC, 2) the number of attached IMUs, 3) the number of known joint axes directions, and 4) whether IMUs are attached rigidly or nonrigidly. A broad range of IMTPs from this class of IMTPs are illustrated in Figure 1 within the grey ellipsoid. Definition 4.1. The parent arrays λN of the N-segment KC where N ∈ {1, 2, 3, 4} are given by, without loss of generality, λ1 = (0)⊺,λ2 = (0, 1)⊺,λ3 = (0, 1, 2)⊺,λ4 = (0, 1, 2, 3)⊺, respectively. ## 4.2 Training Data: The Rcmg Algorithm The RING network is trained on data obtained from simulated random motion of one-, two-, three-, and four-segment KCs. The procedure that generates this training data (from only PseudoRNG) is called the Random Chain Motion Generator (RCMG) (Bachhuber et al., 2022). The RCMG procedure (see Algorithm 1) has three main steps that execute consecutively: 1. Randomized KC (see Section 4.2.1). A randomized KC is drawn to manipulate the downstream simulation and achieve various forms of domain randomization that enable to bridge the sim-to-real gap from simulation (training) to real-world (testing). 2. Random Motion Generation (see Section 4.2.2). The KC is simulated to randomly move in space and the maximal coordinates of all bodies relative to the base are computed for every timestep. 3. Get X, Y Data (see Section 4.2.3). From the maximal coordinates of all bodies, the IMU, joint axes, and pose data is computed, and returned as training data. Internally, the RCMG procedure uses a system object sys (see Definition 4.2) which is the collection of various attributes such as, e.g., a joint axes array J ∈ R N×3. Definition 4.2. We define a system object sys with N bodies as the collection of the following attributes: - a numbering array of integers n ∈ N N which stores a permutation of the numbers going from 1 *. . . N*, - a parent array of integers λ ∈ N N , - a joint axes array J ∈ R N×3that contains the hinge joint axis direction, - a relative-to-parent position array R ∈ R 2N×3that contains the position vector of the body's coordinate system relative to its parent (expressed in the parent's coordinate system). Note that the first N values are due to the geometry of the KC, while the last N values are used as sensor-to-body positions, - an array of stiffness parameters for N free joints K ∈ R N×6, ![6_image_0.png](6_image_0.png) Figure 3: Each sequence of training data is simulated using the RCMG. In the first step of the RCMG a randomized KC is created which involves randomizing the node in the KC to which the base attaches. Afterwards, the nodes in the graph are numbered according to Section 3.3. For example here, for λ4, the new numbering array is n = (2, 1, 3, 4)⊺, and the new parent array λ = (0, 1, 1, 3)⊺. ![6_image_1.png](6_image_1.png) Figure 4: For each node i in the KCs, there exists a second IMU node (that is not counted in the body count N of the system; here in green) with body number i + N. The IMU node is connected via a passive spring-damper free joint to the original node in order to simulate nonrigidly-attached IMUs. There is a 25% chance that the damping and stiffness parameters of the passive free joint are chosen such that the IMU is effectively rigidly attached and the passive free joint is frozen. - an array of damping parameters for N free joints Γ ∈ R N×6, - a float representing the sampling time Ts ∈ R, here always 0.01 s. An exemplary system object is shown in Figure 2. ## 4.2.1 Step 1) Randomized Kinematic Chain In order to enrich the simulated training data, several forms of domain randomization are achieved by drawing a KC with randomized system attributes. The first domain randomization is the randomization of all downstream forward kinematics applications, and additionally, randomization of the absolute random translation and orientation in the generation of random motion. This has been shown to improve the training data such that the trained network more effectively closes the sim-to-real gap (Bachhuber et al., 2023) This is achieved by re-attaching the bases randomly and afterwards, the nodes in the graph are re-numbered according to Section 3.3. An example of this is shown in Figure 3. Secondly, the N randomized hinge joint axes J are drawn. Thirdly, the position array R is randomized by drawing values from uniform ranges. Finally, the stiffness K and damping Γ arrays are randomized. These values are used to model nonrigidly attached IMUs by connecting additional nodes that are connected via passive spring-damper free joints. For each node i in the CG, we add an additional (IMU) node with body number i + N that is a child of node i and that is connected to node i via a passive spring-damper free joint. The stiffness K[i] and damping Γ[i] parameters are used during the forward simulation of the KC as the parameters of the 3D spring-damper dynamics between node i and (IMU) node i + N. For each node i, the stiffness K[i] and damping Γ[i] parameters are randomized in a way such that, either the IMU is effectively rigidly attached, or such that the IMU moves relative to the segment node i (which then models nonrigid attachment). ## 4.2.2 Step 2) Random Motion Generation As a second step, the RCMG procedure generates random motion of the previously obtained randomized KC. Random motion is obtained by drawing a random reference trajectory for all joints in the KC. The generation of such randomized reference trajectories is influenced and constrained by various parameters, e.g., upper limits on angular velocities or lower limits on the amount of motion (to avoid jittering). Additional details on the reference trajectory generation can be found in Appendix C.1. Afterwards, a dynamical forward simulation is performed where joint forces are computed using PD control such that the random reference is tracked. Note that the additionally added nodes to model nonrigid IMU attachment are passive free joints and as such they are not actuated. Finally, the trajectories of maximal coordinates of all N bodies and N IMU bodies, given by T ∈H ⊗ R 32N×T(from base to body), are computed. ## 4.2.3 Step 3) Get X, Y **Data** In the last step, the training tuples of X, Y are computed from the trajectories of maximal coordinates and afterwards returned. They are: - X ∈ R T ×N×9, where X[:*, i,* :6] is the simulated 6D IMU data for body i as measured in its IMU body i + N (but for each inner body, there is a 23 chance that the IMU data gets dropped out and replaced by zeros), and where X[:*, i,* 6:] is the joint axis direction J[i] of the hinge joint between body i and its parent λ[i] and zeros if the parent is the base (but for each body, there is a 12 chance that the joint axis direction data gets dropped out and replaced by zeros), and - Y ∈ HT ×N where Y[:, i] is the timeseries of: 1) absolute attitudes i0q(t) if the parent λ[i] is the base; 2) relative orientations ipq(t) from body i to its parent p = λ[i], and where T is the number of timesteps (here, 60 s at 100 Hz, thus T = 6000), and N is the number of bodies in the KC. IMU and joint axes data is dropped out in order to force RING to learn to solve IMTPs with sparse IMU placement (an inner body may not have an IMU attached to it), and learn to solve IMTPs with require sensor-to-segment calibration. Finally, multiple sequences are stacked to build a training batch. These input and output arrays (X and Y) directly align with the provided software implementation of RING, see Appendix 4.5. Algorithm 1 RCMG (Generate One Training Data Pair) 1: **Input:** λN 2: **Output:** X ∈ R T ×N×9, Y ∈ HT ×N 3: sys ← randSys (λN ) {see Algorithm 2} 4: T ← randMotion (sys) {see Algorithm 3} 5: X, Y ← getXY(sys,λN , T) {see Algorithm 4} ## 4.3 The Architecture Of Ring RING is based on a decentralized network of message-passing RNNs which allows for information exchange along the edges of a graph (as given by the CG). RING can be applied to an arbitrary CG (see Section 3.3) and it maps per-node-input to per-node-output. *Most importantly, the parameters of RING are shared across* the nodes of the graph such that the number of parameters of RING does not depend on the given CG. The hidden state, however, is not shared across the nodes. This allows for the training of a single RING network which then solves a variety of IMTPs (see Section 4.1). The introduction of RING stems from the requirement of acquiring a single pretrained network that can solve different IMTPs with a varying number of inputs and outputs, e.g., estimate two orientations for a two-segment KC, and three orientations for a three-segment KC. This is possible because on a node (or segment) level, we can guarantee static input (at most one IMU, at most a known joint axis direction) and output shapes (one orientation relative to parent). But the per-node-output cannot be estimated from only ![8_image_0.png](8_image_0.png) Figure 5: The architecture of the plug-and-play IMT solution RING. It consists of the RNN cell RINGCell and a final MLP head that returns one quaternion per node in the graph. RING is trained to estimate child-to-parent orientations from the available local IMU and joint axis data and nearest neighbour messages. To this end, RINGCell applies a shared set of parameters on a decentralized, per-node level and passes messages along the edges of the graph to allow for information exchange. Note that while the parameters are shared, the hidden states are not shared across nodes. This architecture allows RING to apply a single set of parameters across a broad range of IMTPs, which may vary in aspects such as the number of segments, and it ultimately enables RING's remarkable pluripotency. the per-node-input as the orientation relative to the parent depends on the orientation state of the parent, and orientation w.r.t. the base cannot be estimated from 6D IMU data, additionally, the segment may not have an IMU attached. Thus, we have to allow information exchange between nodes and propose a scheme which again gives rise to local static input and output shapes of messages. Finally, we claim that the estimation of the entire pose in a hierarchical approach is inherently natural and provides an advantageous structural prior to subsequent parameter learning which we explore in Section 5.4. RING consists of a novel RNN cell, named RINGCell, and a final Multi-Layer Perceptron (MLP) head such that the network's per-node-output is a single unit quaternion (per timestep). Note that the network head is independent of the RINGCell and may easily be replaced to suit different needs. Let λ be a CG with N ∈ N nodes, let F ∈ N be the number of input features per node, let H ∈ N be the half-hidden state dimensionality, and let M ∈ N be the dimensionality of the latent messages passed inside the cell based on the edges in the CG. Then, let ξt-1 ∈ R N×2H be the hidden state of the RINGCell from the previous timestep t − 1, and let Xt ∈ R N×F be the F inputs for all N nodes at time t. Then, the next hidden state ξt is obtained by $$\xi_{t}=\mathrm{ringCell}\left(\xi_{t\cdot1},\mathbf{X}_{t},{\boldsymbol{\lambda}}\right)\quad\forall t$$ , Xt,λ) ∀t (3) with ξ0 = 0. Internally, a RINGCell has the parameters of - a Message-MLP-network fθ : R H → RM (three layers, single hidden layer, hidden layer size H, ReLU activations, no final activation), and - a Stacked-GRUCell-network gθ : R 2H × R 2M+F → R 2H which consists of the sequence of Gated- Recurrent-Unit(GRU)Cell, LayerNorm, GRUCell (Cho et al., 2014). Note that θ is symbolic for the whole set of parameters of the Stacked-GRUCell-network and that it is different to the parameters of fθ. $\left(3\right)$. Note that the two GRUCells each have a hidden state dimensionality of H, thus the hidden state of the Stacked-GRUCell-network is of dimensionality of 2H. Then, a RINGCell has three consecutive steps, ∀i = 1 *. . . N* : 1. Messages Mt ∈ R N×M are computed. $$\mathbf{M}_{t}[i]=f_{\theta}\left(\mathbf{\xi}_{t-1}[i,H:]\right)$$ 2. Messages are passed and latent input X˜ ∈ R N×(2M+F )computed. $${\tilde{\mathbf{X}}}[i]=\operatorname{concat}\left(\mathbf{M}_{t}\big[\mathbf{\lambda}[i]\big],\mathbf{0}+\sum_{c\in\mu_{\lambda}(i)}\mathbf{M}_{t}[c],\mathbf{X}_{t}[i]\right)$$ $\downarrow$). where Mt -λ[i]is 0 if λ[i] = 0. 3. Hidden state is updated. $$\xi_{t}[i]=g_{\theta}\left(\xi_{t-1}[i],\tilde{\mathbf{X}}[i]\right)$$ The architecture of RING is finished by piping the hidden state ξt through a final network head, the Quaternion-MLP that combines - a Layernorm, and a MLP-network hθ : R H → R 4(three layers, single hidden layer, hidden layer size H, ReLU activations, no final activation). The Quaternion-MLP has two consecutive steps, ∀i = 1 *. . . N* : 1. Unnormalized output Y˜ ∈ R N×4is computed. $${\tilde{\mathbf{Y}}}[i]=h_{\theta}{\Big(}\mathtt{layernorm}\left(\xi_{t}[i,H{:}]\right){\Big)}$$ [*i, H*:]) (4) 2. Normalize to allow interpretation as unit quaternions. One unit quaternion per node. Final RING output Yˆt ∈ HN . $${\hat{\mathbf{Y}}}_{t}[i]={\frac{{\tilde{\mathbf{Y}}}[i]}{\sqrt{\sum_{j=1}^{4}{\tilde{\mathbf{Y}}}[i,j]^{2}}}}$$ $$\mathbf{\dot{\theta}}$$ (5) Note that the normalizing operation, due to its square-root operation, requires special care to allow for successful backpropagation. Also note that the employed loss function, see Section 3.6, is based on a arctan expression, which does not require any special care, in contrast to seemingly equivalent expressions to extract the angle from a quaternion that are based on arccos. Finally, by combining the equations (3), (4), (5) and unrolling the RNN in time, we can view the entire RING network as a function that maps the timeseries of available input data X ∈ R T ×N×F and CG λ ∈ N N to the timeseries of predicted output data Yˆ ∈ HT ×N , i.e. $${\hat{\mathbf{Y}}}=\operatorname{ring}_{\theta}\left(\mathbf{X},{\boldsymbol{\lambda}}\right)$$ (X,λ) (6) where the parameters of RING are given by the set {fθ, gθ, hθ}. The hyperparameters of RING are H ∈ N and M ∈ N. Note that the set of parameters of RING is influenced by the hyperparameters of RING and the number of input features per node F, but not by the GC λ or the number of bodies. For example, a single RING network can be used for predicting the orientations of both two-segment or three-segment KCs even though the number of bodies and, consequently, the dimensionality of input and output arrays is different, e.g., X ∈ R T ×2×F compared to X ∈ R T ×3×F . $$({\mathfrak{h}})$$ ## 4.4 Ring: A Single Imt Solution To A Variety Of Imtps In this section, we use the *simulated* training data from Section 4.2 to train a network based on the RINGCell architecture (see Section 4.3). The trained network is then called RING and, with a single set of parameters, RING shows its pluripotency in a range of *experimental* scenarios, from simple single-joint tracking to complex four-segment KCs, without reliance on magnetometers as will be shown in Section 5. For each of the four KCs λN (see Definition 4.1), we use the RCMG (see Algorithm 1) to simulate 512 input-output pairs and stack them to create a single batch of training data. This batch of training data is used to update the parameters of the RING network (see Section 4.3), with H = 400 and M = 200 (total parameter count: 2 337 404) by minimizing the mean-squared-(orientation-estimation)-error, i.e., $$\min_{\theta}\frac{1}{10T}\sum_{N\in\{1,2,3,4\}}\mathbb{E}\sum_{\mathbf{Y},\mathbf{Y}\sim\mathsf{KRO}(\mathbf{\lambda}_{N})}^{T}\sum_{t=1}^{N}\mathsf{loss}\left(\mathbf{Y},\mathsf{ring}(\mathbf{X},\mathbf{\lambda}_{N})\right)[t,i]\tag{7}$$ where RCMG is given by Algorithm 1, loss is given by eq. (2), ring is given by eq. (6), and where the expectation E is estimated using 512 draws. We use the LAMB optimizer (You et al., 2020) combined with global (threshold = 0.1) and adaptive (threshold = 0.2) gradient clipping, a cosine decaying learning rate (initial learning rate = 1 × 10−3, and Truncated Backpropagation Through Time (TBTT). Borrowing the notation from Williams & Peng (1990), we utilize TBTT(10 s, 10 s), i.e., the gradients are stopped and applied after 10 s instead of the total length of 60 s. This results in every batch generation (or episode) corresponding to six parameter updates. We train for 5000 episodes using a single node with eight A40 GPUs (each 48 gigabytes of VRAM). Due to the large amounts of training data, overfitting is seemingly impossible and any form of early stopping did not prove to be required. This has been also confirmed with a separate validation dataset. Training has been stopped after 5000 episodes as the loss has no longer improved. ## 4.5 Openly-Available Code And Data The code and experimental validation data is hosted at https://github.com/anonymous-sup-material/ ring_supplementary_material and the repository contains implementations of the RCMG, RINGCell, and RING as decoupled components. Additionally, it includes the code of SOTA methods and validation data to create the experimental validation results (AMAEs and RMAEs) of RING and the SOTA methods that are discussed in Section 5. Finally, we also provide files to retrain RING from scratch, without requiring any real-world training data files. The software, most notably, uses the JAX and Haiku frameworks (Bradbury et al., 2018; Hennigan et al., 2020). The ease-of-use of RING is demonstrated through a code example in the Appendix D. ## 5 Experimental Validation Of Ring In this section, we evaluate the accuracy of RING with one common set of pretrained parameters (see Section 4.4) across a broad range of *experimental* IMTPs (see Section 4.1). *In general, RING shows* remarkable pluripotency in zero-shot generalization to real-world experiments across diverse IMTPs. This underscores its broad applicability. In Section 5.1, we describe the experimental setup used to evaluate RING on real-world data. We show that RING successfully solves multiple previously solved challenging IMTPs and competes with the current SOTA methods (Section 5.2). Impressively, RING further achieves accurate tracking in even more challenging IMTPs, including two IMTPs that have not been solved before (Section 5.3). ## 5.1 Experimental Setup And Evaluation Metric Experimental evaluation is conducted on a five-segment KC which is shown in Figure 6. The KC is constructed by a concatenation of a single spherical joint followed by three hinge joints, each oriented along the x, y, and ![11_image_0.png](11_image_0.png) Figure 6: Experimental five-segment KC with ten IMUs (orange boxes) and 20 OMC markers (grey spheres). It uses a single spherical joint followed by three hinge joints, each oriented along the x, y, and z axes, respectively. Each segment of the KC was equipped with two IMUs: one firmly attached to the segment and another affixed nonrigidly using foam padding. The experimental KC is moved in space, and the inertial and optical data is recorded to validate RING and compare it to SOTA methods across a broad range of IMTPs. z axes, respectively. Each segment of the KC was equipped with two IMUs (MTw Awinda, Xsens, Enschede, the Netherlands): one firmly attached to the segment and another affixed nonrigidly using foam padding. This foam-attachment of IMU was conducted to investigate the reduction of motion artifacts. The left panel in Figure 6 shows a close-up of one segment of the KC with one exemplary nonrigidly attached IMU. Each segment is equipped with at least three noncollinearly placed reflective markers that are used to obtain ground truth orientations from a twelve camera Optical Motion Capture (OMC) system (OptiTrack Prime x22, NaturalPoint Inc., Corvalis, USA). Two distinct trials were conducted, involving random movements of the five-segment KC, by introducing manual alterations of the KC pose by two experienced scientists. The first trial, spanning a duration of 66 s, featured a diverse range of motions, extending from very slow to notably rapid movements. Moreover, the second trial, with a length of 68 s, not only encompassed a variety of motions but also incorporated random intervals of complete stillness, wherein the KC remained motionless. All trials were preprocessed in the following way: NaN values were removed, an offline time-synchronization was employed via cross-correlation between measured (IMUs) and approximated angular velocities (OMC), and all collected data was resampled to a uniform sampling rate of 100 Hz. Additionally, we correct for any small misalignment between the rigidly attached IMUs' local coordinate systems and the corresponding segments' body coordinate systems as spanned by the OMC markers. Simultaneously, we align the OMC's reference coordinate system with the earth reference coordinate system (the base), as observed by the IMUs. For more comprehensive details regarding these preprocessing steps and the software implementations utilized, readers are referred to the study Laidig et al. (2021). The rich experimental data obtained from the five-segment KC enables us to perform evaluations on subsets of data and the KC, which represent a variety of different IMTPs. For example, for validation of a one-segment KC, we use the recorded data of all five segments of the five-segment KC independently for evaluation, which effectively increases the amount of validation data by a factor of five. Similarly, for validation of a two-segment KC with a hinge joint, we use three different sub-KCs with a joint axis direction along the x, y, and z axes (the two-segment sub-KC of segment one and segment two is excluded due to its spherical joint). Similarly, for a three-segment KC with double hinge joints, we use two different sub-KCs, and for a four-segment KC with triple hinge joint we use the sub-KC of segment two to five. Assessing KC pose estimation performance of RING in comparison with existing SOTA and thus solving the IMTP under consideration, requires the usage of a suitable evaluation metric. As already discussed in Section 3.6, the expression angle(q ⊗ ˆq ∗) can be used to compare the difference between a ground truth orientation q and the corresponding predicted orientation ˆq. Thus, in order to compare the timeseries of ground truth Y ∈ HT ×N and predicted pose Yˆ ∈ HT ×N of an N-segment KC with GC λN , we compute the Attitude-Mean-Absolute-(orientation)-Error (AMAE) and Relative-Mean-Absolute-(orientation)-Error (RMAE) which are given by $$\operatorname{\mathtt{AME}}\left(\mathbf{Y},\hat{\mathbf{Y}}\right)={\frac{1}{T}}\sum_{t=500}^{T}{\Bigm|}\operatorname{\mathtt{angle}}\left({\mathsf{zeroHead}}\left(\mathbf{Y}[t,1]\right)\otimes{\mathsf{zeroHead}}\left(\hat{\mathbf{Y}}[t,1]\right)^{*}\right){\Bigm|}$$ $\left(\mathfrak{S}\right)$. $${\mathsf{R M a E}}\left(\mathbf{Y},{\hat{\mathbf{Y}}}\right)={\frac{1}{T N}}\sum_{t=500}^{T}\sum_{i=2}^{N}\left|{\mathsf{a n g l e}}\left(\mathbf{Y}[t,i]\otimes{\hat{\mathbf{Y}}}[t,i]^{*}\right)\right|$$ $\left(\mathrm{q}\right)$. ∗ (9) where |.| denotes the absolute value and zeroHead removes the heading component (see Definition B.7). Note that initial 5 s (equaling to an index of 500 at 100 Hertz) of each timeseries were deliberately excluded from the AMAE and RMAE calculations. This decision was made to ensure that the recorded errors accurately reflected the method's performance after convergence. ## 5.2 Ring Unifies Prior Work 5.2.1 Attitude Estimation Attitude estimation in real-world environments using inertial sensors is a vital prerequisite for a wide range of applications, including tracking human movement and enabling autonomy in air and land vehicles. The attitude estimation problem is defined as estimating the orientation of an object with respect to the horizontal plane with a single sensor (Weber et al., 2021). The widely employed and long-standing methods from Madgwick (2010); Mahony et al. (2008); Seel & Ruppin (2017) have recently been outperformed with SOTA approaches by Weber et al. (2021); Laidig & Seel (2023). Table 1 shows that RING aligns with SOTA performance in attitude estimation, as indicated by the experimental AMAEs. More specifically, the AMAE of the attitude for Madgwick (2010) is (2.25 ± 0.81)◦, for Laidig & Seel (2023) is (1.61 ± 1.04)◦, for Weber et al. (2021) is (2.06 ± 1.03)◦, for Mahony et al. (2008) is (2.09 ± 0.87)◦, for Seel & Ruppin (2017) is (2.56 ± 0.93)◦, and for RING is (2.13 ± 0.91)◦. ## 5.2.2 Magnetometer-Free Tracking Of 1-Dof Joint IMT of connected segments without relying on magnetometers is desirable for numerous applications where the magnetic field is typically disturbed, including control of industrial robotic manipulators, interconnected drones in automated warehouses, and human motion analysis in hospital environments. Here, we consider the IMTP of tracking the relative motion between two segments from two 6D IMUs, assuming a single hinge joint with a known axis direction connects both segments. Overcoming the use of magnetometers is typically achieved by combining SOTA approaches for attitude estimation and utilizing joint-specific constraints that exploit knowledge of the hinge joint axis direction (Laidig et al., 2017; Lehmann et al., 2020). Additionally, a magnetometer-reliant method uses 9D VQF (Laidig & Seel, 2023) for both IMUs independently and does not exploit any kinematic constraint between the two body parts. The RMAEs are reported in Table 1, and they are: for the VQF-based baseline (19.36 ± 8.02)◦, for Lehmann et al. (2020) (4.15 ± 2.05)◦, for Laidig et al. (2017) (3.32 ± 2.12)◦, and for RING (3.52 ± 1.00)◦. This shows that RING aligns with the SOTA methods, which are already a non-trivial combination of two separate methods which, in contrast to applying RING, requires expert knowledge. ## 5.2.3 Magnetometer-Free Tracking Of 1-Dof Joint With Unknown Joint Axis Direction The IMTP of Section 5.2.2 can be made more challenging by assuming that the hinge joint axis direction is not known. Then, it can first be estimated from the IMU data, and then subsequently a method that assumes a known joint axis direction can be applied. A SOTA method for hinge joint axis direction estimation is given by Olsson et al. (2020). RING out-of-the-box supports an unknown hinge joint axis direction by its versatility to drop out the respective node input and replacing it with zeros. The experimental RMAEs are given in Table 1; combining Olsson et al. (2020) with Lehmann et al. (2020) results in (4.06±2.23)◦, and with Laidig et al. (2017) results in (3.18±2.05)◦, and RING achieves (3.92±1.40)◦. This shows that RING aligns with SOTA performance, which *comprises three distinct methods*. ## 5.2.4 Three-Segment Sparse Imt Only few recent works have achieved the combination of sparse and magnetometer-free IMT. One such challenging IMTP is, the tracking of all relative segment orientations of a three-segment KC, with double hinge joints and known hinge joint axes directions, by using only two IMUs placed on the outer segments. The SOTA method for this IMTP is given by Bachhuber et al. (2023). The absolute attitude can be easily tracked using any of the methods from Section 5.2.1. As shown in Table 1, the experimental RMAE using Bachhuber et al. (2023) is (5.60 ± 2.35)◦, and using RING the RMAE is reduced to (4.14 ± 0.53)◦ and, consequently, RING outperforms the SOTA in this IMTP. ## 5.3 Ring Goes Beyond The Sota 5.3.1 Motion Artifact Reduction The efficacy of all SOTA IMT methods heavily rely on a rigid sensor-to-body attachment. In many practical scenarios, such as human motion analysis, this assumption is rapidly violated, resulting in strongly degraded estimation accuracies, attributed to a model-reality mismatch. Here, we consider the IMTP of Section 5.2.2, however here, the IMUs are not rigidly attached to the two segments, while the estimation target remains the relative orientation between the two segments (and not between the coordinate systems of the two IMUs), and the absolute attitude of one of the segments. Currently, there exist no method that does not make the assumption of rigid IMU attachment. Still, the methods from Section 5.2.1 can be applied to estimate the absolute attitude, and we use the most accurate estimator VQF (Laidig & Seel, 2023) for comparison purposes. The methods from Section 5.2.2 are applied to estimate the relative orientation. To compensate for the violation of the rigid-IMU-attachment assumption, we additionally apply an intuitive low-pass filter (LPF) step to the estimated absolute attitude and relative orientation for each baseline method to suppress unwanted high frequency artifacts. The cutoff frequency was grid searched and we report only the best result for each baseline. Alternatively, the use of the LPF on the estimated orientations prior to computing the relative orientation did not yield better performance. In Table 1, column 5.3.1A reports the experimental AMAE in the attitude estimate, and demonstrates RING's superior performance of (7.59 ± 2.85)◦ over the combination of VQF+LPF with an AMAE of (9.19 ± 2.31)◦. Similarly, column 5.3.1B reports experimental RMAEs, they are: Lehmann et al. (2020) achieves (8.00 ± 2.78)◦, Laidig et al. (2017) achieves (7.00 ± 1.57)◦, and RING achieves (5.56 ± 2.33)◦. This shows that RING outperforms the SOTA methods. Note that the reduced AMAE shows that RING has learned to fuse the information of the second segment's IMU into the attitude estimation of the first segment. ## 5.3.2 Three-Segment Sparse Imt With Unknown Joint Axes Directions The IMTP considered in Section 5.2.4 can be made even more challenging by not assuming known joint axes directions. To the best of the authors' knowledge, there currently exists no method that is applicable in such a challenging IMTP. RING can solve this IMTP with only a modest increase in error (Table 1), given the increased complexity of the task. Note that the direction of the joint axis cannot be estimated using Olsson et al. (2020) such that the method from Section 5.2.4 may be applied, as Olsson et al. (2020) does not allow for a sparse sensor setup which inherently requires a pluripotent approach such as RING. We report a RMAE value of (5.37 ± 0.71)◦for RING in this challenging IMTP. ## 5.3.3 Four-Segment Sparse Imt: 3-Dofs Between Imus Increasing sensor sparsity will naturally make an IMTP problem more complex. A KC configuration with four segments and only two 6D IMUs results in three DoFs (three consecutive hinge joints) between the two outer-segment 6D IMUs and it represents the limit of accurate sparse IMT. Despite the complexity, the estimation target remains to capture all three relative orientations. Table 1: Motion tracking accuracy (in degrees) of RING compared to various SOTA methods across a variety of IMTPs. While previous methods are problem-specific and Not Applicable (NA) to many IMTPs, RING is the only method that accurately solves all problems. All columns report the RMAE, see eq. (9), as metric, except for the columns 5.2.1 and 5.3.1A which report AMAE as metric, see eq. (8). | IMTPs | 5.2.1 | 5.2.2 | 5.2.3 | 5.2.4 | 5.3.1a | 5.3.1b | 5.3.2 | 5.3.3 | |----------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------| | | 0 0 | 3 | | | | | | | | Method | 0 | 3 | 3 | 4 3 | | | | | | (1) | 2.06 ± 1.03 | NA | NA | NA | ≥(5) | NA | NA | NA | | (2) | 2.25 ± 0.81 | ≥(5) | ≥(5) | NA | ≥(5) | NA | NA | NA | | (3) | 2.09 ± 0.87 | ≥(5) | ≥(5) | NA | ≥(5) | NA | NA | NA | | (4) | 2.56 ± 0.93 | ≥(5) | ≥(5) | NA | ≥(5) | NA | NA | NA | | (5) | 1.61 ± 1.04 | → | 19.3 ± 8.02 | NA | 9.20 ± 2.31 | 24.9 ± 17.6 | NA | NA | | (5)+(6) | ↑ | 3.32 ± 2.12 | NA | NA | ↑ | 7.00 ± 1.57 | NA | NA | | (5)+(7) | ↑ | 4.15 ± 2.05 | NA | NA | ↑ | 8.00 ± 2.78 | NA | NA | | (5)+(6)+(8) | ↑ | → | 3.18 ± 2.05 | NA | ↑ | 8.50 ± 2.60 | NA | NA | | (5)+(7)+(8) | ↑ | → | 4.06 ± 2.23 | NA | ↑ | 7.90 ± 2.48 | NA | NA | | (9) | NA | NA | NA | 5.60 ± 2.35 | NA | NA | NA | NA | | RING | 2.13 ± 0.91 | 3.52 ± 1.00 | 3.92 ± 1.40 | 4.14 ± 0.53 | 7.59 ± 2.85 | 5.56 ± 2.33 | 5.37 ± 0.71 | 6.78 ± 1.41 | | Methods: Weber et al. (2021)(1), Madgwick (2010)(2), Mahony et al. (2008)(3), Seel & Ruppin (2017)(4), Laidig & Seel (2023)(5), Laidig et al. (2017)(6), | | | | | | | | | Figure 7: Exemplary frames that showcase RING's performance for the IMTP that involves a four-segment ![14_image_0.png](14_image_0.png) KC with sparse IMU attachments and known joint axes directions (see Section 5.3.3). It is a remarkable first that RING can accurately estimate the four orientations (one absolute and three relative orientations) from only two magnetometer-free IMUs. A video of the trial is available here. To the best of the authors' knowledge, there currently is no method that is applicable in such a challenging IMTP. RING can solve this problem formulation sufficiently well. When assuming known joint axes directions for the three hinge joints, RING achieves a RMAE of (6.78 ± 1.41)◦. An exemplary trial is shown in Figure 7. When assuming unknown joint axes directions, RING achieves (13.66±3.07)◦. This shows that with unknown joint axes directions, this IMTP pushes the limits of observability (Bachhuber et al., 2022). ## 5.4 The Decentralized Approach Of Ring Provides An Advantageous Structural Prior In this section, we showcase a second advantage of the decentralized approach of RING over a centralized approach that is typically employed, e.g., by stacking multiple LSTM- or GRU-Cells. First, recall that RING is based on a decentralized network of message-passing RNNs which allows for the training of a single set of parameters despite a varying number of bodies in the KC and, while the latter aspect is the core motivation behind this architecture it is, interestingly, not the sole motivation behind the decentralized approach. The second motivation is that the estimation of the entire pose in RING's decentralized approach provides an advantageous structural prior compared to an RNN that utilizes a centralized approach. For this purpose, we compare RING to the RNN-based Observer (RNNO), a deep GRU network with intermediate Layernorm layers, as it was proposed in Bachhuber et al. (2023). RNNO maps all available input data to the entire targeted pose data and does not utilize the specific graph structure of the IMTP. RNNO has been proposed as the solution of a specific IMTP (see Section 5.2.4) and, for this IMTP, both RING and RNNO achieve similar performance. However, this is not the case if the IMTP becomes vastly more complex. Consider, e.g., the IMTP of Section 5.3.3, which is arguably the most challenging IMTP under consideration in this work. We have trained RNNO on the subset of training data of RING that corresponds to this IMTP. Despite varying several hyperparameters, the best reported RMAE of RNNO is (18.72 ± 5.12)◦. This is significantly higher compared to RING's RMAE of (6.78 ± 1.41)◦, even though RING is maintaining its applicability to a broad range of IMTPs, and is not purpose-trained for a single IMTP. This showcases that the decentralized approach of RING provides an advantage even if only the solution of a single, specific IMTP is required. ## 6 Discussion We have shown that a single RNN, named RING, can accurately solve a broad range of IMTPs even if two IMTPs do not have same input-output dimensionality. This pluripotent behavior origins from a decentralized architecture that provides an advantageous structural prior compared to the more typical centralized approach which, in contrast to RING, has the additional limitation that it can only be utilized if the solution of a single IMTP is sufficient. In summary, for the set of IMTPs under consideration (see Section 4.1), we have shown that RING can enable accurate IMT for one-, two-, and three-segment KCs as long as the IMUs are rigidly attached. Most notably, this includes an IMTP that is sparse, magnetometer-free, and requires sensor-to-segment calibration. If IMUs are nonrigidly attached, then RING is shown to provide accurate orientation estimates for a two-segment KC. RING can achieve accurate IMT for a four-segment KC, provided that the IMUs are rigidly attached and sensor-to-segment calibration is not required. It is a remarkable first, that RING can track the pose of the four-segment KC (which requires in total four distinct orientations) using only two IMUs. Note that RING does not require problem specific priors, although their introduction, i.e., a known joint axes direction, or an additionally attached IMU is straightforwardly possible as additional input data to improve the motion tracking accuracy even further. This can be seen in Table 1 where, e.g., for a three-segment KC, providing joint axes directions decreases the mean RMAE from 5.37◦(Section 5.3.2) to 4.14 (Section 5.2.4). ## 7 Conclusion In the presented work, we combined ideas from the domain of multi-agent systems with RNNs to propose an architecture based on a decentralized network of message-passing, parameter-sharing RNNs. We have successfully exploited this combination for the analysis of structural sequential data and solved a challenging state estimation problem, which is IMT of KCs, by letting the decentralized network map local IMU measurements and nearest-neighbour messages to local orientations. In particular, we introduced RING, a *pluripotent* IMT solution that, unlike all previous, problem-specific approaches, enables plug-and-play non-expert use. RING outperforms a range of problem-specific SOTA solutions and even generalizes to previously unsolved scenarios, including the challenging combination of magnetometer-free and sparse sensing with unknown sensor-to-segment parameters. Remarkably, RING demonstrates the ability to zero-shot generalize to experimental scenarios, despite being trained solely on simulated data. For example, RING can, for the first time, accurately track a real-world four-segment kinematic chain (which requires estimating four orientations) using only two magnetometer-free IMUs. RING's pluripotency greatly simplifies the application of IMT by eliminating the need for expert knowledge to identify, select, and fine-tune problem-specific methods. This is expected to not only make IMT more powerful and less restrictive in established domains but also to facilitate the accessibility of IMT technology by non-expert users and broadens its applicability to previously untapped domains. ## References Simon Bachhuber, Daniel Weber, Ive Weygers, and Thomas Seel. RNN-based Observability Analysis for Magnetometer-Free Sparse Inertial Motion Tracking. In 2022 25th International Conference on Information Fusion (FUSION), pp. 1–8, Linköping, Sweden, July 2022. IEEE. ISBN 978-1-73774-972-1. doi: 10.23919/FUSION49751.2022.9841375. URL https://ieeexplore.ieee.org/document/9841375/. Simon Bachhuber, Dustin Lehmann, Eva Dorschky, Anne D. Koelewijn, Thomas Seel, and Ive Weygers. Plug-and-Play Sparse Inertial Motion Tracking With Sim-to-Real Transfer. *IEEE Sensors Letters*, 7(10): 1–4, October 2023. ISSN 2475-1472. doi: 10.1109/LSENS.2023.3307122. URL https://ieeexplore.ieee. org/document/10225275. Conference Name: IEEE Sensors Letters. James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax. Ao Buke, Fang Gaoli, Wang Yongcai, Song Lei, and Yang Zhiqi. Healthcare algorithms by wearable inertial sensors: a survey. *China Communications*, 12(4):1–12, April 2015. ISSN 1673-5447. doi: 10.1109/CC.2015. 7114054. URL https://ieeexplore.ieee.org/abstract/document/7114054. Conference Name: China Communications. Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation, September 2014. URL http://arxiv.org/abs/1406.1078. arXiv:1406.1078 [cs, stat]. Mark Euston, Paul Coote, Robert Mahony, Jonghyuk Kim, and T. Hamel. A Complementary Filter for Attitude Estimation of a Fixed-Wing UAV. October 2008. doi: 10.1109/IROS.2008.4650766. Roy Featherstone. *Rigid body dynamics algorithms*. Springer, New York, 2008. ISBN 978-0-387-74314-1 978-0-387-74315-8. OCLC: ocn190774140. Roy Featherstone. A Beginner's Guide to 6-D Vectors (Part 2) [Tutorial]. IEEE Robotics & Automation Magazine, 17(4):88–99, December 2010. ISSN 1070-9932, 1558-223X. doi: 10.1109/MRA.2010.939560. URL https://ieeexplore.ieee.org/document/5663690/. Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to Communicate with Deep Multi-Agent Reinforcement Learning. In *Advances in Neural Information Processing Systems*, volume 29. Curran Associates, Inc., 2016. URL https://proceedings.neurips.cc/paper/2016/hash/ c7635bfd99248a2cdef8249ef7bfbef4-Abstract.html. Matthew W. Givens and Calvin Coopmans. A Survey of Inertial Sensor Fusion: Applications in sUAS Navigation and Data Collection. In *2019 International Conference on Unmanned Aircraft Systems (ICUAS)*, pp. 1054–1060, June 2019. doi: 10.1109/ICUAS.2019.8798225. URL https://ieeexplore.ieee.org/ document/8798225. ISSN: 2575-7296. Aaron Grapentin, Dustin Lehmann, Ardjola Zhupa, and Thomas Seel. Sparse Magnetometer-Free Real-Time Inertial Hand Motion Tracking. In 2020 IEEE International Conference on Multisensor Fusion and Integration for Intelligent Systems (MFI), pp. 94–100, September 2020. doi: 10.1109/MFI49285.2020. 9235262. URL https://ieeexplore.ieee.org/document/9235262. Tom Hennigan, Trevor Cai, Tamara Norman, Lena Martens, and Igor Babuschkin. Haiku: Sonnet for JAX, 2020. URL http://github.com/deepmind/dm-haiku. Wenlong Huang, Igor Mordatch, and Deepak Pathak. One Policy to Control Them All: Shared Modular Policies for Agent-Agnostic Control, July 2020. URL http://arxiv.org/abs/2007.04976. arXiv:2007.04976 [cs, stat]. Yinghao Huang, Manuel Kaufmann, Emre Aksan, Michael J. Black, Otmar Hilliges, and Gerard PonsMoll. Deep inertial poser: learning to reconstruct human pose from sparse inertial measurements in real time. *ACM Transactions on Graphics*, 37(6):185:1–185:15, December 2018. ISSN 0730-0301. doi: 10.1145/3272127.3275108. URL https://dl.acm.org/doi/10.1145/3272127.3275108. Manon Kok, Jeroen D. Hol, and Thomas B. Schön. An optimization-based approach to human body motion capture using inertial sensors. *IFAC Proceedings Volumes*, 47(3):79–85, January 2014. ISSN 1474-6670. doi: 10.3182/20140824-6-ZA-1003.02252. URL https://www.sciencedirect.com/science/article/ pii/S147466701641596X. J.B. Kuipers. Quaternions and Rotation Sequences: A Primer with Applications to Orbits, Aerospace and Virtual Reality. Princeton University Press, September 2002. ISBN 978-0-691-10298-6. URL https://press. princeton.edu/books/paperback/9780691102986/quaternions-and-rotation-sequences. ISBN: 9780691102986. Daniel Laidig and Thomas Seel. VQF: Highly accurate IMU orientation estimation with bias estimation and magnetic disturbance rejection. *Information Fusion*, 91:187–204, March 2023. ISSN 15662535. doi: 10.1016/j.inffus.2022.10.014. URL https://www.sciencedirect.com/science/article/pii/ S156625352200183X. Daniel Laidig, Thomas Schauer, and Thomas Seel. Exploiting kinematic constraints to compensate magnetic disturbances when calculating joint angles of approximate hinge joints from orientation estimates of inertial sensors. In *2017 International Conference on Rehabilitation Robotics (ICORR)*, pp. 971–976, July 2017. doi: 10.1109/ICORR.2017.8009375. URL https://ieeexplore.ieee.org/document/8009375. ISSN: 1945-7901. Daniel Laidig, Marco Caruso, Andrea Cereatti, and Thomas Seel. BROAD—A Benchmark for Robust Inertial Orientation Estimation. *Data*, 6(7):72, July 2021. ISSN 2306-5729. doi: 10.3390/data6070072. URL https://www.mdpi.com/2306-5729/6/7/72. Number: 7 Publisher: Multidisciplinary Digital Publishing Institute. Dustin Lehmann, Daniel Laidig, and Thomas Seel. Magnetometer-free motion tracking of one-dimensional joints by exploiting kinematic constraints. *Proceedings on Automation in Medical Engineering*, 1(1):027– 027, February 2020. URL https://www.journals.infinite-science.de/index.php/automed/article/ view/335. Number: 1. Dustin Lehmann, Daniel Laidig, Simon Bachhuber, Thomas Seel, and Ive Weygers. Magnetometer-Free Inertial Motion Tracking of Kinematic Chains, April 2024. URL https://papers.ssrn.com/abstract=4785077. Irvin Hussein López-Nava and Angélica Muñoz-Meléndez. Wearable Inertial Sensors for Human Motion Analysis: A Review. *IEEE Sensors Journal*, 16(22):7821–7834, November 2016. ISSN 1558-1748. doi: 10. 1109/JSEN.2016.2609392. URL https://ieeexplore.ieee.org/document/7567551. Conference Name: IEEE Sensors Journal. Sebastian O H Madgwick. An efficient orientation filter for inertial and inertial/magnetic sensor arrays. 2010. Robert Mahony, Tarek Hamel, and Jean-Michel Pflimlin. Nonlinear Complementary Filters on the Special Orthogonal Group. *IEEE Transactions on Automatic Control*, 53(5):1203–1218, June 2008. ISSN 1558-2523. doi: 10.1109/TAC.2008.923738. URL https://ieeexplore.ieee.org/document/4608934. Conference Name: IEEE Transactions on Automatic Control. Timothy McGrath, Richard Fineman, and Leia Stirling. An Auto-Calibrating Knee Flexion-Extension Axis Estimator Using Principal Component Analysis with Inertial Sensors. *Sensors*, 18(6):1882, June 2018. ISSN 1424-8220. doi: 10.3390/s18061882. URL https://www.mdpi.com/1424-8220/18/6/1882. Number: 6 Publisher: Multidisciplinary Digital Publishing Institute. Fredrik Olsson, Manon Kok, Thomas Seel, and Kjartan Halvorsen. Robust Plug-and-Play Joint Axis Estimation Using Inertial Sensors. *Sensors*, 20(12):3534, January 2020. ISSN 1424-8220. doi: 10.3390/s20123534. URL https://www.mdpi.com/1424-8220/20/12/3534. Number: 12 Publisher: Multidisciplinary Digital Publishing Institute. Liviu Panait and Sean Luke. Cooperative Multi-Agent Learning: The State of the Art. Autonomous Agents and Multi-Agent Systems, 11(3):387–434, November 2005. ISSN 1573-7454. doi: 10.1007/s10458-005-2631-2. URL https://doi.org/10.1007/s10458-005-2631-2. Deepak Pathak, Christopher Lu, Trevor Darrell, Phillip Isola, and Alexei A Efros. Learning to Control SelfAssembling Morphologies: A Study of Generalization via Modularity. In *Advances in Neural Information* Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/ paper/2019/hash/c26820b8a4c1b3c2aa868d6d57e14a79-Abstract.html. Patrik Puchert and Timo Ropinski. A3GC-IP: Attention-oriented adjacency adaptive recurrent graph convolutions for human pose estimation from sparse inertial measurements. *Computers & Graphics*, 117:96– 104, December 2023. ISSN 0097-8493. doi: 10.1016/j.cag.2023.09.009. URL https://www.sciencedirect. com/science/article/pii/S0097849323002327. Thomas Seel and Stefan Ruppin. Eliminating the Effect of Magnetic Disturbances on the Inclination Estimates of Inertial Sensors**This work was conducted within the research project BeMobil, which is supported by the German Federal Ministry of Research and Education (FKZ 16SV7069K). *IFACPapersOnLine*, 50(1):8798–8803, July 2017. ISSN 2405-8963. doi: 10.1016/j.ifacol.2017.08.1534. URL https://www.sciencedirect.com/science/article/pii/S2405896317321201. Thomas Seel, Manon Kok, and Ryan S. McGinnis. Inertial Sensors—Applications and Challenges in a Nutshell. *Sensors*, 20(21):6221, January 2020. ISSN 1424-8220. doi: 10.3390/s20216221. URL https: //www.mdpi.com/1424-8220/20/21/6221. Number: 21 Publisher: Multidisciplinary Digital Publishing Institute. Sainbayar Sukhbaatar, Arthur Szlam, and Rob Fergus. Learning multiagent communication with backpropagation. In *Proceedings of the 30th International Conference on Neural Information Processing* Systems, NIPS'16, pp. 2252–2260, Red Hook, NY, USA, December 2016. Curran Associates Inc. ISBN 978-1-5108-3881-9. Luke Sy, Michael Raitor, Michael Del Rosario, Heba Khamis, Lauren Kark, Nigel H. Lovell, and Stephen J. Redmond. Estimating Lower Limb Kinematics Using a Reduced Wearable Sensor Count. *IEEE transactions* on bio-medical engineering, 68(4):1293–1304, April 2021. ISSN 1558-2531. doi: 10.1109/TBME.2020. 3026464. Luke Wicent F. Sy, Nigel H. Lovell, and Stephen J. Redmond. Estimating Lower Limb Kinematics Using a Lie Group Constrained Extended Kalman Filter with a Reduced Wearable IMU Count and Distance Measurements. *Sensors (Basel, Switzerland)*, 20(23):6829, November 2020. ISSN 1424-8220. doi: 10.3390/ s20236829. Bertram Taetz, Gabriele Bleser, and Markus Miezal. Towards Self-Calibrating Inertial Body Motion Capture, June 2016. URL http://arxiv.org/abs/1606.03754. arXiv:1606.03754 [cs]. Tom Van Wouwe, Seunghwan Lee, Antoine Falisse, Scott Delp, and C. Karen Liu. Diffusion Inertial Poser: Human Motion Reconstruction from Arbitrary Sparse IMU Configurations, August 2023. URL http://arxiv.org/abs/2308.16682. arXiv:2308.16682 [cs]. Timo von Marcard, Bodo Rosenhahn, Michael J. Black, and Gerard Pons-Moll. Sparse Inertial Poser: Automatic 3D Human Pose Estimation from Sparse IMUs, March 2017. URL http://arxiv.org/abs/ 1703.08014. arXiv:1703.08014 [cs]. He Wang, Wenwu Yu, Guanghui Wen, and Guanrong Chen. Fixed-Time Consensus of Nonlinear Multi-Agent Systems With General Directed Topologies. *IEEE Transactions on Circuits and Systems II: Express* Briefs, 66(9):1587–1591, September 2019. ISSN 1558-3791. doi: 10.1109/TCSII.2018.2886298. URL https://ieeexplore.ieee.org/document/8574981. Conference Name: IEEE Transactions on Circuits and Systems II: Express Briefs. Tingwu Wang, Renjie Liao, and Sanja Fidler. NerveNet: Learning Structured Policy with Graph Neural Networks. 2018. Daniel Weber, Clemens Gühmann, and Thomas Seel. RIANN—A Robust Neural Network Outperforms Attitude Estimation Filters. AI, 2(3):444–463, September 2021. ISSN 2673-2688. doi: 10.3390/ai2030028. URL https://www.mdpi.com/2673-2688/2/3/28. Number: 3 Publisher: Multidisciplinary Digital Publishing Institute. Ronald J. Williams and Jing Peng. An Efficient Gradient-Based Algorithm for On-Line Training of Recurrent Network Trajectories. *Neural Computation*, 2(4):490–501, December 1990. ISSN 0899-7667. doi: 10.1162/ neco.1990.2.4.490. URL https://ieeexplore.ieee.org/document/6797135. Conference Name: Neural Computation. Xinyu Yi, Yuxiao Zhou, and Feng Xu. TransPose: Real-time 3D Human Translation and Pose Estimation with Six Inertial Sensors, May 2021. URL http://arxiv.org/abs/2105.04605. arXiv:2105.04605 [cs]. Xinyu Yi, Yuxiao Zhou, Marc Habermann, Soshi Shimada, Vladislav Golyanik, Christian Theobalt, and Feng Xu. Physical Inertial Poser (PIP): Physics-aware Real-time Human Motion Tracking from Sparse Inertial Sensors, March 2022. URL http://arxiv.org/abs/2203.08528. arXiv:2203.08528 [cs]. Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojanapalli, Xiaodan Song, James Demmel, Kurt Keutzer, and Cho-Jui Hsieh. Large Batch Optimization for Deep Learning: Training BERT in 76 minutes, January 2020. URL http://arxiv.org/abs/1904.00962. arXiv:1904.00962 [cs, stat]. Zhaolong Zheng, Hao Ma, Weichao Yan, Haoyang Liu, and Zaiyue Yang. Training Data Selection and Optimal Sensor Placement for Deep-Learning-Based Sparse Inertial Sensor Human Posture Reconstruction. Entropy, 23(5):588, May 2021. ISSN 1099-4300. doi: 10.3390/e23050588. URL https://www.mdpi.com/ 1099-4300/23/5/588. Number: 5 Publisher: Multidisciplinary Digital Publishing Institute. ## A Preliminaries A.1 Notation - Scalars are lowercase or uppercase, italic, non-bold, e.g., x ∈ R, or, e.g., N ∈ N. - (Column) vectors are lowercase, italic, bold, e.g., x ∈ R 3, and, e.g., x = (1, 2, 3)⊺. - Matrices (or higher) are uppercase, upright, bold, e.g., X and X ∈ R 3×4. - Individual quaternions are denoted with q ∈ H. One-dimensional arrays of quaternions with q, e.g., q ∈ H5. Two dimensional arrays of quaternions with q, e.g., q ∈ H5×5. - (Programming) functions and structures are written in typewriter typestyle, e.g., sys. - The equal symbol = is overloaded and used for definitions, assignments, and comparison, and the context defines the current meaning. - The symbol 0 defines an arbitrarily large array of zeros that is automatically broadcasted to the required dimensionality. - The symbol 1 defines either the unity element of a given space, or the indicator function, such that, e.g., 10(i) is one for i = 0 and zero else. - The symbol ⊗ is used to denote the direct product of vector spaces, and additionally denotes quaternion multiplication, see Definition B.2. ## A.2 Array Indexing And Slicing Vectors and matrices are array-like objects that can be indexed and sliced dynamically. Indexing starts with 1 and slicing is inclusive on both sides. For example, let X ∈ R 3×4, then X[1]∈ R 4, or X[1:2]∈ R 2×4. Additionally, we define the following auto-completion rules by example, such that X[:2] is equivalent to X[1:2], and X[2:] is equivalent to X[2:3], and X[:] is equivalent to X[1:3]. Finally, multiple dimensions can be indexed or sliced simultaneously and are separated by a comma, e.g., X[:, 3:]∈ R 3×2. ## B Quaternion Algebra Definition B.1. We use H to denote the space of all unit quaternions, and we denote a unit quaternion with q = qw + qxi + qyj + qzk. Definition B.2. Let q1, q2 ∈ H be two unit quaternions, then we use ⊗ to denote quaternion multiplication of the two unit quaternions, that is q1 ⊗ q2 = (q1wq2w − q1xq2x − q1yq2y − q1zq2z) + (q1wq2x + q1xq2w + q1yq2z − q1zq2y)i + (q1wq2y − q1xq2z + q1yq2w + q1zq2x)j + (q1wq2z + q1xq2y − q1yq2x + q1zq2w)k Note that the space of unit quaternions H in combination with quaternion multiplication ⊗ forms a closed group, i.e., (q1 ⊗ q2) ∈ H ∀q1, q2. Definition B.3. The inverse of a quaternion q −1is given by the complex conjugate denoted by q ∗. Definition B.4. The quaternion that corresponds to a certain rotation around an axis j = (jx, jy, jz) ⊺ ∈ R 3 by an angle α ∈ R is given by q = quat(j, α) = cos( α 2 ) + (jx sin( α 2 ))i + (jy sin( α 2 ))j + (jz sin( α 2 ))k. Definition B.5. Extracting the angle α from a given quaternion q (the inverse operation of B.4) can be done using angle(q) = 2 arctan √q 2x+q 2y+q 2 z qw . Definition B.6. We define the projection project of a quaternion q onto a (primary) axis J as the decomposition into two quaternions, the primary rotation qp and the residual rotation qr, such that q = qr ⊗ qp while the angle of the residual rotation is minimized. This can be done with $1.\;\;\alpha_p\leftarrow\arctan\left(\frac{j_x q_x+j_y q_y+j_z q_z}{q_w}\right)$ . 2. qp ← quat(j, αp) 3. qr ← q ⊗ q ∗ p Definition B.7. We define the function zeroHead as the function that maps a quaternion q to the quaternion qr with zero heading component and returns qr. It can be obtained via 1. qp, qr ← project (q,(0, 0, 1)⊺) where project is given in Definition B.6. Definition B.8. The function randQuat that returns a random quaternion, uniform on the sphere, can be obtained by drawing i.i.d. four numbers from a normal distribution, interpreting them as the components qw, qx, qy, qz of a quaternion, and then normalizing the quaternion to obtain a unit quaternion. Definition B.9. The function rotate(q, r) applies a quaternion q to a vector r ∈ R 3. If the quaternion is interpreted as 01q (from 0 to 1) and the vector is expressed using the unit-vectors of coordinate system 0, then the function rotate returns the same vector but using the unit-vectors of coordinate system 1. Let r = (rx, ry, rz) ⊺ , then the rotate(q, r) function is given by (q ⊗ (0, rx, ry, rz) ⊺ ⊗ q ∗) [1:]. ## C Training Data: The Rcmg Algorithm C.1 The Motionconfig **Object** In the second step of the RCMG (see Section 4.2.2), random motion of the KC is simulated and, subsequently, training data is generated. Random motion of the KC is obtained by using PD control during a dynamical forward simulation such that the minimal coordinates of the KC track a randomly drawn set of reference trajectories for the minimal coordinates. The functions randFreeTraj and randHingTraj (see Definition C.6) are used to draw the minimal coordinates reference trajectories in Algorithm 3. Furthermore, the type of ## Algorithm 2 Randsys (Rcmg First Step) 1: **Input:** λN 2: **Output:** sys 3: sys ← initSys(λN ) {allocate empty structure} 4: sys ← randBase(sys,λN ) {see Definition C.1} 5: for i = 1 to N do 6: sys.J[i] = rotate(randQuat(), eˆx) {random hinge joint axis direction; unused if sys.λ[i] = 0} 7: for d = 1 to 3 do 8: sys.R[*i, d*] = randSegmentToSegment(d) {see Definition C.2} 9: sys.R[i + *N, d*] = randSensorToSegment(d) {see Definition C.2} 10: **end for** 11: {IMU of node 1 of the standard system is always rigidly attached, as there is no second IMU whose measurements may be fused to effectively eliminate motion due to the nonrigid attachment.} 12: if sys.n[1] = i or randBernoulli(0.25) **then** 13: k ← getRigidStif() {see Definition C.4} 14: γ ← getRigidDamp() {see Definition C.4} 15: **else** 16: k ← randNonRigidStif() {see Definition C.5} 17: γ ← randNonRigidDamp() {see Definition C.5} 18: **end if** 19: sys.K[i] = k 20: sys.Γ[i] = k · γ {element-wise multiplication} 21: **end for** ## Algorithm 3 Randmotion (Rcmg Second Step) 1: **Input:** sys, (motionConfig) {motionConfig object is used only by randFreeTraj and randHingTraj and it influences and constraints the random motion (see Appendix C.1)} 2: **Output:** T ∈H ⊗ R 32N×T 3: T ← int 60 sys.Ts {\# timesteps; duration of training sequences is 60 seconds} 4: Q = 0 {timeseries of minimal coordinates Q ∈ R Nq×T of system without IMU bodies; see Definition 3.2} 5: a ← 0 6: for i = 1 to N do 7: if sys.λ[i] = 0 **then** 8: b ← a + 7 9: Q[a:b] = randFreeTraj (motionConfig, T) {see Definition C.6} 10: **else** 11: b ← a + 1 12: Q[a:b] = randHingTraj (motionConfig, T) {see Definition C.6} 13: **end if** 14: a ← b 15: **end for** 16: Q˜ = 0 {timeseries of minimal coordinates Q˜ ∈ R T ×(Nq+7N) of system with IMU bodies; see Definition 3.2} 17: q˜ ← 0 18: q˜˙ ← 0 {q˜˙ ∈ R Nq˙+6N ; see Definition 3.2} 19: for t = 1 to T do 20: τ ← PDControl (sys, Q[:, t], q˜[:Nq]) {see Definition C.7} 21: τ ← concat τ , 0 ∈ R 6N⊺{N IMUs' *passive* free joints} 22: q˜, q˜˙ ← forDyn sys, q˜, q˜˙, τ{see Definition C.8} 23: Q˜ [t] = q˜ 24: **end for** 25: T ← forKin sys, Q˜{see Definition C.8} Algorithm 4 getXY (RCMG Third Step) 1: **Input:** sys, λN , T ∈H ⊗ R 32N×T 2: **Output:** X ∈ R N×9×T, Y ∈ HN×T 3: X ← 0 4: Y ← 0 5: for i = 1 to N do 6: p ← λN [i] 7: ˜i ← sys.n[i] 8: p˜ ← 0 9: if p ̸= 0 **then** 10: p˜ ← sys.n[p] 11: **end if** 12: Oi ← isOuter(i, sys.λ) {true if body i is an outer body; see Definition 3.1} 13: if Oi or randBernoulli(0.33) {inner IMU data might not be made available} **then** 14: j ← ˜i + N {body number IMU node} 15: X[i, :6] = simIMU (T[j], sys.Ts) {see Definition C.9} 16: **end if** 17: if p ̸= 0 and randBernoulli(0.5) {for hinge joints, joint axis might not be made available} **then** 18: X[i, 7:] = sys.J[˜i] 19: **end if** 20: 0pq ← 1 21: if p˜ ̸= 0 **then** 22: 0pq ← T[˜p, :4] 23: **end if** 24: 0iq ← T[˜i, :4] 25: ipq ← 0pq ⊗ 0iq ∗ {note that the expression 0pq ∗ ⊗ 0iq can not be used instead of 0pq ⊗ 0iq ∗, as it can dramatically reduce the network's ability to learn. The reason is that in the expression 0pq ⊗ 0iq ∗the joint axis direction is expressed in the (more meaningful) local coordinate system and not in the base's coordinate system.} 26: if p˜ = 0 **then** 27: ipq ← zeroHead ipq{see Definition B.7} 28: **end if** 29: Y[i] = ipq 30: **end for** ![22_image_0.png](22_image_0.png) Figure 8: RCMG generates random motion by drawing random trajectories of the minimal coordinates of the system. Exemplary random trajectories of the hinge joint's minimal coordinates are shown for the four different motionConfigs (see Appendix C.1). They are drawn using the function randHingeTraj, see Definition C.6. RCMG also draws the random trajectory of the minimal coordinates of the free joint, but they are not shown here for simplicity. motion generated by these functions can be manipulated with a motionConfig object which defines various parameters, e.g., upper limits on angular velocities or lower limits on the amount of motion. For an exhaustive list of parameters, the reader is referred to the software implementation (see Appendix 4.5). In this work, we use in total four different motionConfigs to generate training data. For each generated sequence, we randomly and uniformly draw from these four. The four motionConfigs are used to ensure that a wide range of different motion patterns are covered in the training data. Exemplary trajectories of the hinge joints' minimal coordinates are shown in Figure 8. ## C.2 Support Functions Used In Algorithms 2/3/4 In the following, the functions used in Algorithms 2/3/4 will be discussed. And while no pseudo-code is provided for these support functions, it should be noted that the majority of these functions should be understandable despite a textual description only. Additionally, the reader may always refer to the software implementation for additional details (see Appendix 4.5). Definition C.1. The function randBase(sys, λN ) randomly re-attaches the base of the system sys and afterwards the nodes in the graph are re-numbered according to Section 3.3. This process yields a new parent array λ. Additionally, the permutation of the new numbers of the nodes expressed in the numbering scheme that was used to obtain λN is captured in the numbering array n. Consider the three-segment KC given in Figure 2. The parent array is given by λ3 = (0, 1, 2)⊺ and we assume, without loss of generality, the numbering scheme that is shown in the figure. Here, the function randBase has three choices for attaching the base. The first is trivial and given by node 1. The second is given by node 2. In this case the parent array is always given by λ = (0, 1, 1)⊺, and two scenarios for the numbering array are possible. They are n = (2, 1, 3)⊺ and n = (3, 1, 2)⊺. The third and last option is given by node 3. In this case the parent array is unchanged but n = (3, 2, 1)⊺. ## A Second Example Is Given In Figure 3. Definition C.2. The functions randSegmentToSegment and randSensorToSegment randomize the body-tobody- and sensor-to-body positions expressed in the local coordinate, respectively. Internally, they both draw these vectors randomly from uniform values ranges. These value ranges are chosen such that there exists a dominant longitudinal direction (x-component), and two equal transversal directions. Definition C.3. The function randBernoulli(p) returns 1 (or true) with probability p and zero (or false) else. Definition C.4. The functions getRigidStif and getRigidDamp return the stiffness and damping parameters (both are six-dimensional) of the free joint that connects body i to IMU body i + N. This mechanism is used to simulate nonrigid IMU attachment. However, these functions provide a fixed set of values that leads to highly stiff and critically damped spring-damper system such that there is effectively no motion between body i and IMU body i + N. Definition C.5. The functions randRigidStif and randRigidDamp return the stiffness and damping parameters of the free joint that connects body i to IMU body i + N. Internally, both functions draw these six-dimensional vector randomly from log-uniform values ranges. Definition C.6. The function randFreeTraj(motionConfig, T) returns a random trajectory of minimal (for free joint minimal=maximal) coordinates ∈H ⊗ R 3Twith T timesteps for a free 6-DoF joint. The function randHingeTraj(motionConfig, T) returns a random trajectory of minimal coordinates ∈ R T with T timesteps for a hinge joint. Internally, they both use the motionConfig (see Appendix C.1) to constraint the random motion to physically relevant motion, i.e., the, e.g., angular velocity is bounded from above. Exemplary trajectories are shown in Figure 8. For additional details, the reader is referred to the software implementation, see Appendix 4.5. Definition C.7. The function PDControl(sys, qr , q) computes the generalized force vector τ ∈ R Nq˙ using a decentralized scheme using N independent PD controllers, and where qr ∈ R Nq denotes the reference minimal coordinates and q ∈ R Nq denotes the observed minimal coordinates. Note that the provided system object sys has 2N bodies but only the first N bodies are actuated. The remaining bodies are passive free joints. Definition C.8. The function forDyn (sys, q, q˙, τ ) applies forward dynamics in the system sys and integrates the minimal coordinates position and velocity vector q, q˙ by sys.Ts. The function forKin (sys, Q) applies forward kinematics in the system sys, i.e., it provides a map from minimal Q to maximal coordinates T. Here, it is additionally vectorized over the time dimension. A text-book reference for both well-known algorithms can be found in Featherstone (2008). Definition C.9. The function simIMU(T, Ts) simulates a 6D IMU from a trajectory of maximal coordinates. First, the maximal coordinates are butter-worth low-pass-filtered (both the quaternion and position trajectory). Then, a second-order numerical differentiation for both gyroscope and accelerometer is used. The accelerometer is low-pass-filtered. Gravity and simulated noise and bias terms are added. The cutoff frequencies have been optimized such that experimental IMU data is recovered with the highest fidelity from the maximal coordinate trajectories from OMC. Additional details can be found in Bachhuber et al. (2022). ## D Software Example This example code uses the published software (see Section 4.5) and showcases how RING is applied in Section 5.3.2, i.e., it solves an IMTP that consists of a three-segment KC with sparse 6D IMU attachment and with unknown joint axes directions. 1 import **ring** 2 import **numpy** as np 3 4 T : int = 30 *\# sequence length [s]* 5 Ts : float = 0.01 *\# sampling interval [s]* 6 B : int = 1 *\# batch size* 7 lam: list[int] = [0, 1, 2] *\# parent array* 8 N : int = len(lam) *\# number of bodies* 9 T_i: int = int(T/Ts) *\# number of timesteps* 10 11 X = np.zeros((B, T_i, N, 9)) 12 *\# where X is structured as follows:* 13 *\# X[..., :3] = acc* 14 *\# X[..., 3:6] = gyr* 15 *\# X[..., 6:9] = jointaxis* 16 17 *\# let's assume we have an IMU on each outer segment of the* 18 *\# three-segment kinematic chain* 19 X[..., 0, :3] = acc_segment1 20 X[..., 2, :3] = acc_segment3 21 X[..., 0, 3:6] = gyr_segment1 22 X[..., 2, 3:6] = gyr_segment3 23 24 ringnet = ring.RING(lam, Ts) 25 yhat, _ = ringnet.apply(X) 26 *\# yhat: unit quaternions, shape = (B, T_i, N, 4)*
Review 1: Summary: The paper presents a novel method for Inertial Motion Tracking (IMT) called the Recurrent Inertial Graph-Based Estimator (RING). This method aims to revolutionize the field of IMT by providing a versatile, problem-unspecific solution that does not require expert knowledge for implementation. RING utilizes a decentralized network of message-passing, parameter-sharing recurrent neural networks to process local inertial measurement unit (IMU) data and generate local orientations. The authors claim that RING can effectively tackle a wide range of IMT problems, including those that are magnetometer-free and involve sparse sensing configurations. Basically, the RING method represents a solid advancement in Inertial Motion Tracking technology, offering a versatile and user-friendly solution that can adapt to a wide range of problems. Its ability to generalize from simulated to experimental data is particularly noteworthy and positions RING as a promising tool for future research and applications. However, further experimental validation would enhance the paper's contributions and facilitate broader adoption. Overall, this work is a solid work. Strengths and Weaknesses: Strengths: 1: The decentralized architecture of RING is a significant advancement in the field of IMT. By allowing for parameter sharing and message passing among networks, RING can adapt to various configurations and problems, showcasing its pluripotency. 2: One of the most impressive aspects of RING is its ability to generalize from simulated training data to real-world experimental data without additional training. This capability is crucial for practical applications, as it reduces the need for extensive data collection and model retraining. 3: The versatility of RING opens up new possibilities for IMT applications across various fields, including biomechanics and autonomous systems. This could lead to wider adoption of motion tracking technologies in previously untapped areas. Weaknesses: 1: While the paper emphasizes the zero-shot generalization capability, the experimental validation appears to be limited to specific scenarios. More extensive testing across diverse real-world conditions would strengthen the claims made regarding RING's robustness and adaptability. 2: Although RING is designed to be a plug-and-play solution, the underlying architecture may still pose challenges for users without a strong background in machine learning or neural networks. Providing more detailed guidelines or user-friendly tools for implementation could enhance accessibility. It is thus suggested to provide time complexity analysis, both theoretically and empirically. Requested Changes: It is thus suggested to provide time complexity analysis, both theoretically and empirically. Broader Impact Concerns: No ethical concerns. ================================================== Review 2: Summary: The paper introduces the Recurrent Inertial Graph-Based Estimator (RING), a ML-based method for inertial motion tracking (IMT). RING offers a pluripotent, problem-unspecific solution that simplifies the use of IMT technology by eliminating the need for expert knowledge in selecting and parameterizing appropriate methods. The architecture utilizes a decentralized network of message-passing, parameter-sharing RNN that map local IMU data and nearest-neighbor messages to local orientations. This design enables RING to generalize across a broad range of IMT problems and outperforms several state-of-the-art solutions, even under challenging conditions such as magnetometer-free and sparse sensing with unknown sensor-to-segment parameters. Strengths and Weaknesses: + The use of a decentralized network of message-passing RNNs is novel and effectively handles the complexities of various IMT problems. The architecture's ability to generalize across different kinematic chains and sensor setups without retraining is impressive. + RING's ability to zero-shot generalize from simulation to experimental data and outperform specialized solutions in various scenarios is a significant contribution. - Although RING shows remarkable generalization from simulated to real-world data, the reliance on simulated training data may limit its performance in highly specialized or unforeseen real-world scenarios. - The paper focuses on accuracy but does not provide detailed insights into the real-time performance and computational efficiency of RING, which are critical for practical applications. Requested Changes: - My main concern is the robustness of RING in zero-shot learning when dealing with raw IMU data from different sensor configurations. The performance of a model that uses raw IMU data as input can indeed be sensitive to variations in sensor configurations, including differences in calibration, placement, and orientation between devices from different manufacturers. From my experience, the IMU data captured from apple and meta's platforms have large difference. These differences can impact the raw sensor readings, potentially affecting the model's ability to generalize effectively in zero-shot learning scenarios. The authors either needs to prove their model is robust to sensor configurations and why. Or verify that strategies like domain randomization, data transformation, and fine-tuning may be necessary. [critical to secure my recommendation for acceptance] - The paper focuses heavily on the accuracy and generalization capabilities of RING but provides limited information on its real-time performance, such as latency, computational efficiency, and resource utilization. These factors are crucial in many practical applications, particularly those requiring real-time feedback or low-latency responses. The authors should evaluate the system for real-time performance. [critical to secure my recommendation for acceptance] Broader Impact Concerns: N/A ================================================== Review 3: Summary: This paper proposes a problem-agnostic ML model for inertial motion tracking (IMT). This is based on representing systems in IMT by a graph and using message passing within an RNN cell to extract hidden representations and making predictions. The parameter sharing within the message passing makes the model independent of the system that it can predict. The network is trained on synthetic data generated randomly by the Random Chain Motion Generator (RCMG) procedure, yet can achieve zero-shot generalisation to several real-world settings. Strengths and Weaknesses: **Strengths:** - The introduction of a "pluripotent" model for IMT is an appealing idea and definitely of interest to some of the TMLR audience. - Experimental results are quite interesting, showing zero-shot generalisation of the general model to concrete real life examples. - The figures are mostly clear and help to understand the model, which has several moving components. **Weaknesses:** - The writing can be hard to understand at certain points. In particular, it requires quite a bit of familiarity within the field of motion tracking, which the general TMLR audience will not have. The paper is most certainly geared towards researchers in robotics than a general ML audience. See also __Requested changes__ below. Requested Changes: - The abbreviation "IMU" is not introduced - "see 2" (page 4) => "see Figure 2" - Throughout the paper I find the use of the **Definition** heading a little bit strange. I don't understand how the statements in Definitions 3.2 and 4.1 are definitions. They seem more like remarks. - Compared to the other figures, I find Figure 2 to be less informative. In particular, the `sys` representation next to the figure doesn't really tell us much. Additionally, the matrix size of __K__ and __$\Gamma$__ is cut off. - I don't understand the relative-to-parent position array in __Definition 4.2__. In particular, the last sentence. What are the first $N$ values due to the geometry of the KC and what are "sensor-to-body" positions and why do we need it? This can be a little confusing is one is not already familiar with the field. - Could you please give some more explanation of what the AMAE and RMAE (equations (8) and (9)) tells us? For example, why do we treat the first component $i=1$ separately from the others and build separate metrics for $i=1$ and $i=2, ..., N$? What is the implication of having a low or high AMAE/RMAE score? - "This pluripotent behavior origins from a" => "This pluripotent behavior *originates* from a" (page 16). Broader Impact Concerns: As far as I can see, there are not ethical concerns of the work. ==================================================
# Efficient Model-Based Multi-Agent Mean-Field Reinforcement Learning Barna Pásztor barna.pasztor@ai.ethz.ch ETH Zürich Ilija Bogunovic i.bogunovic@ucl.ac.uk University College London Andreas Krause *krausea@ethz.ch* ETH Zürich Reviewed on OpenReview: *https: // openreview. net/ forum? id= gvcDSDYUZx* ## Abstract Learning in multi-agent systems is highly challenging due to several factors including the non-stationarity introduced by agents' interactions and the combinatorial nature of their state and action spaces. In particular, we consider the *Mean-Field Control* (MFC) problem which assumes an asymptotically infinite population of identical agents that aim to collaboratively maximize the collective reward. In many cases, solutions of an MFC problem are good approximations for large systems, hence, efficient learning for MFC is valuable for the analogous discrete agent setting with many agents. Specifically, we focus on the case of *unknown* system dynamics where the goal is to simultaneously optimize for the rewards and learn from experience. We propose an efficient *model-based* reinforcement learning algorithm, M3–UCRL, that runs in episodes, balances between exploration and exploitation during policy learning, and *provably* solves this problem. Our main theoretical contributions are the first general regret bounds for model-based reinforcement learning for MFC, obtained via a novel mean-field type analysis. To learn the system's dynamics, M3–UCRL can be instantiated with various statistical models, e.g., neural networks or Gaussian Processes. Moreover, we provide a practical parametrization of the core optimization problem that facilitates gradient-based optimization techniques when combined with differentiable dynamics approximation methods such as neural networks. ## 1 Introduction Multi-Agent Reinforcement Learning (MARL) extends the scope of reinforcement learning (RL) to multiple agents acting in a shared system. It is receiving considerable attention given a great number of real-world applications including autonomous driving (Shalev-Shwartz et al., 2016), finance (Lee et al., 2002; Lee et al., 2007; Lehalle & Mouzouni, 2019), social science (Castelfranchi, 2001; Leibo et al., 2017), swarm motion (Almulla et al., 2017), e-sports (Vinyals et al., 2019; Pachocki et al., 2018), and traffic routing (El-Tantawy et al., 2013), to name a few. Despite the recent popularity, analyzing agents' performance in these systems remains a particularly challenging task for several reasons including non-stationarity, scalability, competing learning goals, and varying information availability of agents. In this work, we target the challenges of non-stationarity and *scalability*. From the perspective of an individual agent, the dynamics of the system are non-stationary, since other agents update their behaviour, which alters over time how the environment reacts to certain actions of the agent. Multi-agent systems also suffer from a *combinatorial nature* due to the exponential growth of the state and action space as the number of agents in the system increases. To tackle the previous challenges, *Mean-Field Control* (MFC) exploits the insight that many relevant MARL problems involve a large number of *very similar* agents that are coordinated via a centralized controller. As a motivating application, consider a ride-hailing service in which a central dispatcher coordinates the routes of many drivers around the city. MFC considers the limiting regime of controlling infinitely many identical collaborative agents, and utilizes the notion of mean-field approximation from statistical physics (Weiss, 1907) to model their interactions. Specifically, instead of focusing on the individual agents and their interactions, the state of the system is described via the agents' state distribution and the dynamics and rewards are formulated accordingly. Despite the introduced approximations, the solution to the MFC problem often remains adequate for the finite agent equivalent (Lacker, 2017). The focus of this work is on learning the optimal policies in MFC when the underlying dynamics are *unknown*. In complex domains such as fleets of autonomous vehicles or robot swarms, this is often the case, and the models consequently need to be learnt from data, giving rise to a well-known exploration–exploitation dilemma. In this paper, we propose the *Model-Based Multi-Agent Mean-Field Upper-Confidence RL* algorithm (M3– UCRL) that is provably efficient and can effectively trade-off between exploration and exploitation during policy learning. Similarly to other Model-Based Reinforcement Learning (MBRL) algorithms, M3–UCRL collects data about the unknown dynamics online (i.e., by proposing and executing a policy in the true system) and estimates the possible dynamics the system might follow. To optimize the agent's actions, it simulates the unknown system by using the estimated dynamics. Chua et al. (2018) has shown that MBRL can solve challenging single-agent RL problems with low sample complexity. We transfer this property to multi-agent problems and show that M3–UCRL can efficiently solve the MFC problem with unknown dynamics. Related work. Our M3–UCRL extends the class of Model-Based Reinforcement Learning (MBRL) algorithms that rely on the *optimism-in-the-face-of-uncertainty* principle. Algorithms based on this approach achieve optimal regret for tabular MDPs (Brafman & Tennenholtz, 2002; Auer et al., 2009; Efroni et al., 2019; Domingues et al., 2020), while in the continuous setting, Abbasi-Yadkori & Szepesvaŕi (2011) and Jin et al. (2020) show O˜( √T) regret bounds for LQR and linear MDPs, respectively. The recently designed episodic model-based algorithms (Chowdhury & Gopalan, 2019; Kakade et al., 2020; Curi et al., 2020; Sessa et al., 2022) achieve similar regret in the kernelized setting. Sessa et al. (2022) consider the general multi-agent setting, and prove a regret bound with O(N H/2) dependence on the number N of agents. In comparison, M3–UCRL assumes an asymptotically large population of identical agents. Crucially, as we will show, its performance does not depend on the number of agents, making it more suitable for large systems. Multi-Agent Reinforcement Learning (MARL) has seen tremendous progress in recent years as many real-world applications involve interactions among a number of agents. Buşoniu et al. (2008) provide an overview of classical and early MARL results. Several other MARL surveys focus on: non-stationarity induced by the agent interactions (Hernandez-Leal et al., 2017), deep MARL (Hernandez-Leal et al., 2019; Nguyen et al., 2020), theoretical foundations in Markov/stochastic/extensive-form games (Zhang et al., 2019) and cooperative MARL (OroojlooyJadid & Hajinezhad, 2019). Recently, Zhang et al. (2019) and Nguyen et al. (2020) recognize the lack of practical model-based MARL algorithms (with an early exception of the R-Max algorithm proposed by Brafman & Tennenholtz (2000; 2002) for two-player zero-sum Markov Games). We fill this gap by designing a practical model-based algorithm that considers a large population of agents, and that is compatible with deep models. Modeling interaction via the mean-field approach in MARL has recently gained popularity due to the introduction of Mean-Field Games (MFG) (Lasry & Lions, 2006a;b; Huang et al., 2006; 2007). MFG consider the limiting regime of a competitive game among identical agents with the objective of reaching a Nash Equilibrium. Various works (Yin et al., 2010; 2013; Cardaliaguet & Hadikhanloo, 2017; Guéant et al., 2011; Bensoussan et al., 2013; Carmona & Delarue, 2013; Carmona et al., 2018; Gomes et al., 2014) mainly consider solving MFGs in continuous-time, while some very recent ones (Yang et al., 2017; 2018; Fu et al., 2020; Guo et al., 2019; 2020; Elie et al., 2020; Agarwal et al., 2019) analyze the problem from the discrete-time RL perspective. The progress of the field has been recently summarized by Laurière et al. (2022). At the same time, cooperative discrete-time *Mean-Field Control*, the main focus of this paper, has received significantly less attention. Gast et al. (2012); Motte & Pham (2019); Gu et al. (2020; 2021) and Bäuerle (2021) consider planning with known dynamics. In the learning setting, Wang et al. (2020); Carmona et al. (2019b); Gu et al. (2021); Angiuli et al. (2022; 2021) extend the Q-Learning algorithm and show convergence for specific variants of MFC focusing on discrete state and action spaces. The mean-field extension of the linear-quadratic problem has been studied by Carmona et al. (2019a); Wang et al. (2021); Carmona et al. (2021) with policy optimisation methods. Subramanian & Mahajan (2019) also proposes a policy-gradient based algorithm that solves Mean-Field Games and Control problems locally. Additionally, Chen et al. (2021); Li et al. (2021); Wang et al. (2020) consider the approximation error between the Mean-Field and the related Multi-Agent Reinforcement Learning problems. These previous model-free methods are either sample inefficient, assume access to a simulator or consider finite state and action spaces. On the contrary, our algorithm is model-based, sample-efficient, works for continuous spaces and learns the policy online by performing exploration on a real system. Main contributions. We design a novel *Model-based Multi-agent Mean-field Upper Confidence* RL (M3– UCRL) algorithm for the centralized control problem of a large population of collaborative agents. M3– UCRL is practical, performs exploration on a real system (requires no simulator and efficient in terms of samples), and is compatible with neural network policy learning. Our main contributions are the general theoretical regret bounds obtained via a novel mean-field-based analysis, that we also specialize to Gaussian Process models. In the main step of our theoretical analysis, we bound the distance between the mean-field distributions under the true and the approximated dynamics via the model's total estimated uncertainty. Finally, we pose the exploration via entropy maximization problem used in a recent MFG survey (Laurière et al., 2022) in the continuous state and action domain and demonstrate the performance of our algorithm in it. Our results show that M3–UCRL is capable of finding close-to-optimal policies within a few episodes, in contrast to model-free algorithms that require at least six orders of magnitude more samples. ## 2 Problem Statement We consider the episodic Mean-Field Control (MFC) problem with time-horizon H, compact state space S ⊆ R p and compact action space A ⊆ R qthat are common for all the agents in the system. We index episodes with the variable t and use T to denote the number of episodes passed. In standard N-agent settings, the system's state in episode t at time h ∈ {0*, . . . , H* − 1} is described with individual agents' states (s (1) t,h*, . . . , s* (N) t,h ) ∈ SN which grows exponentially in the number of agents N and represents a common issue in scaling MARL algorithms. In MFCs, we assume that all agents are *identical* and the population is *asymptotically infinite*, i.e., N → ∞, therefore, the agents' states can be described by the *mean-field* distribution: $$\mu_{t,h}(s)=\operatorname*{lim}_{N\to\infty}{\frac{1}{N}}\sum_{i=1}^{N}\mathbb{I}_{\{s_{t,h}^{(i)}=s\}},$$ where µt,h belongs to the space of probability measures P(S) over S. Due to the assumption of *identical* agents in MFC, we can focus on a *representative agent* from the population that interacts with the distribution of agents instead of individual agents and interactions. System Dynamics. Before every episode t, the representative agent selects a policy profile πt = (πt,0, . . . , πt,H−1) where the H individual policies πt,h : S × P(S) → A are chosen from a set of admissible policies Π (e.g., we parametrize our polices via neural networks; see below). At every time h, the representative agent selects an action at,h = πt,h(st,h, µt,h). The environment then returns reward r(st,h, at,h, µt,h), and the agent observes its new state st,h+1 and the mean-field distribution µt,h+1. In MFCs, the system's dynamics are typically given by a McKean-Vlasov type of stochastic processes and depend on the agent's state, action and the mean-field distribution: $$s_{t,h+1}=f(s_{t,h},a_{t,h},\mu_{t,h})+\omega_{t,h},$$ st,h+1 = f(st,h, at,h, µt,h) + ωt,h, (1) where ωt,h is an *i.i.d.* additive noise vector. This is in contrast to the standard single-agent model-based RL (cf. Chowdhury & Gopalan (2019); Curi et al. (2020); Kakade et al. (2020)), where the dynamics only depend on agent's action and state. Crucially, since the focus of this work is on *learning* in MFC, we assume that the true dynamics are *unknown*, and the goal is to explore the space and learn about f over a number of episodes. 1 To do so, the representative agent relies on the collected random observations, 1We expect our results to easily extend and account for unknown rewards by using the same modeling assumptions for the reward function (e.g., as in Chowdhury & Gopalan (2019)). $$(1)$$ Dt = {((st,h, at,h, µt,h), st,h+1)} H−1 h=0 , which come from the interaction with the true system (i.e., from policy rollouts) during episode t. Finally, after every episode, we assume that the whole system is reset and the agent's initial state s0 is drawn from a known initial distribution µ0, i.e., s0 ∼ µ0, that remains the same in every episode. Mean-field Flow. Since, in MFC, all agents are identical, interact in a common environment, and follow the *same policy* πt = (πt,0, . . . , πt,H−1), the subsequent mean-field distributions satisfy the following mean-field flow property as shown by Gu et al. (2020): Lemma 1. For a given initial distribution µ0, dynamics f *and policy* π = (π0, . . . , πh−1), the mean-field distribution trajectory {µh} H−1 h=0 *, follows* $$\mu_{h+1}(ds^{\prime})=\int_{s\in\mathcal{S}}\mu_{h}(ds)\mathbb{P}[s_{h+1}\in ds^{\prime}],\tag{2}$$ _where $\mu_{h}\in\mathcal{P}(\mathcal{S})$ for all $h\geq0$, $a_{h}=\pi_{h}(s_{h},\mu_{h})$, $s_{h+1}$ is given by Eq. (1), and $\mu_{h}(ds)=\mathbb{P}[s_{h}\in ds]$ under $\pi$._ We provide the proof in Appendix B.2. To shorten the notation, we use Φ(µt,h, πt,h, f) to denote the mean-field transition function from Eq. (2), i.e., we have µt,h+1 = Φ(µt,h, πt,h, f). The lemma shows that the next mean-field distribution explicitly depends on the unknown f (since st,h+1 = f(st,h, at,h, µt,h) + ωt,h), policy played by the agents πt,h, and previous state distribution µt,h. Performance metric. Given a policy profile π = (π1*, . . . , π*H−1), the performance of the representative agent is measured via the expected cumulative reward: $$\mathbb{J}(\mathbf{\pi})=\mathbb{E}\bigg{[}\sum_{h=0}^{H-1}r\big{(}s_{h},a_{h},\mu_{h}\big{)}\bigg{]}$$ s.t. $a_{h}=\pi_{h}(s_{h},\mu_{h})$, $s_{h+1}=f(s_{h},a_{h},\mu_{h})+\omega_{h}$, $\mu_{h+1}=\Phi(\mu_{h},\pi_{h},f)$, $$\left(2\right)$$ $$(3\mathrm{a})$$ $$\left({\boldsymbol{4}}\right)$$ where the expectation is taken over the noise in the transitions and initial distribution s0 ∼ µ0. By considering the representative agent's perspective, the goal is to discover a *socially* optimal policy π ∗that maximizes the expected total reward, i.e., $$\pi^{*}\in\arg\operatorname*{max}\ \mathbb{J}(\pi)$$ J(π) (4) In our theoretical analysis, we make the following assumptions regarding the system's true dynamics, reward function and the set of admissible policies. We use z, z′ ∈ Z = *S ×A×P*(S) to denote (*s, a, µ*) and (s ′, a′, µ′), respectively, and we make use of the Wasserstein-1 metric: W1(*µ, µ*′) = infν RS×S ∥x − y∥2 dν(*x, y*), where ν is any probability measure on *S × S* with marginals µ and µ ′(see Appendix A for useful properties of W1(*µ, µ*′) that are used in our analysis). Assumption 1. The transition function f is Lf –Lipschitz-continuous, i.e., ∥f(z) − f(z)∥2 ≤ Lf d(*z, z*′) where d(*z, z*′) := ∥s − s ′∥2 + ∥a − a ′∥2 + W1(µ, µ′) and ωt,h are i.i.d. additive σ-sub-Gaussian noise vectors for all t ≥ 1 and h ∈ {0*, . . . , H* − 1}. Assumption 2. The set of admissible policies Π consists of Lπ*–Lipschitz-continuous policies such that for* any π ∈ Π: ∥π(*s, µ*) − π(s ′, µ′)∥2 ≤ Lπ(∥s − s ′∥2 + W1(µ, µ′)), and the reward function is Lr*–Lipschitzcontinuous, i.e.,* |r(z) − r(z ′)| ≤ Lrd(*z, z*′). Regularity assumptions like these are standard in the single-agent model-based reinforcement learning literature (Jaksch et al., 2010; Curi et al., 2020; Chowdhury & Gopalan, 2019; Sessa et al., 2022) and mild since, in practice, the policy and reward function classes are typically chosen to satisfy the previous smoothness assumptions. In our experiments (see Section 5), we parametrize our policies with Neural Networks with Lipschitz continuous activations (e.g., tanh, ReLU and linear). We note that the Lipschitzness of such policies then follows from that of the activations when the network's weights are bounded (in practice, this can be done by directly bounding them or via regularization). Remark 1. *The episodic Mean-Field Control problem relates closely to the finite-horizon case of the evolutive* Mean-Field Game problem described in Laurière et al. (2022). Both settings consider mean-field distributions evolving over time depending on the agents' policies, however, the MFC problem focuses on collaborative agents while agents in the evolutive MFG are competitive. This distinction leads to different solution concepts of the problems; social welfare in MFC and Nash Equilibrium in MFG. ## 3 The M3**–Ucrl Algorithm** In this section, we tackle the Mean-Field Control Problem with unknown dynamics from Eq. (4) by relying on a *model-based* learning scheme. Our *Model-based Multi-agent Mean-field Upper Confidence* RL (M3–UCRL) algorithm uses a statistical model to estimate the system's dynamics and to effectively trade-off between exploration and exploitation during policy learning. Before stating our algorithm, we consider the main properties of the considered dynamics models. Statistical Model. Our representative agent learns about the unknown dynamics from the data collected during the interactions with the environment, i.e., the policy rollouts. In particular, we take a model-based perspective (see Algorithm 1), where the agent models the unknown dynamics and sequentially, after every episode t, updates and improves its model estimates based on the previous transition observations, i.e., D1 *∪ · · · ∪ D*t where Dt = {((st,h, at,h, µt,h), st,h+1)} H−1 h=0 is the set of state transition observations in episode t. To reason about plausible models at every episode t, the representative agent can take a frequentist or Bayesian perspective. In the first case, it estimates the mean mt : *Z → S* and confidence Σt : Z → R p×p functions. In the second case, the agent estimates the posterior distribution over dynamical models p( ˜f|Dt), that leads to mt(z) = Ef˜∼p(f˜|Dt) [ ˜f(z)], and Σ2 t (z) = Var[ ˜f(z)]. We denote σt(·) = diag(Σt(·)) and make the following assumptions regarding the considered statistical model irrespective of the taken perspective: Assumption 3 (Calibrated model). The statistical model is calibrated w.r.t. f*, i.e., there is a known* non-decreasing sequence of confidence parameters {βt}t≥0, each βt ∈ R>0 and depending on δ*, such that* with probability at least 1 − δ, it holds jointly for all t and z ∈ Z that |f(z) − mt(z)| ≤ βtσt(z) *elementwise.* Assumption 4. The function σt(·) is Lσ*-Lipschitz-continuous for all* t ≥ 1. The calibrated model assumption (or its equivalents) is standard in online model-based learning (Srinivas et al., 2010; Chowdhury & Gopalan, 2017; 2019; Curi et al., 2020; Sessa et al., 2022). It states that the agent can build high probability confidence bounds around the unknown dynamics at the beginning of every episode. As more observations become available, we expect the *epistemic* uncertainty of the model (that arises due to the lack of data and is encoded in σ(·)) to shrink, and consequently allow the representative agent to make better decisions as it becomes more confident about the true dynamics. Our theoretical results obtained in Section 4 hold for general model classes as long as Assumption 3 and Assumption 4 are satisfied. Below and in Section 4, we provide concrete conditions (about f) and models for which this assumption provably holds. Algorithm. At the beginning of episode t, the representative agent constructs the confidence set of dynamics functions, denoted by Ft−1, satisfying the elementwise confidence interval in Assumption 3 with mt−1(·) and σt−1(·) estimated based on the observations up until the end of the previous episode t − 1, i.e., $\mathcal{F}_{t-1}=\left\{\tilde{f}:|\tilde{f}(z)-\boldsymbol{m}_{t-1}(z)|\leq\beta_{t-1}\boldsymbol{\sigma}_{t-1}(z)\text{elementwise and}\forall z\in\mathcal{Z}\right\}$. Then, the agent selects the optimistic policy πt which achieves the highest possible cumulative reward over the set of admissible policies, Π, and plausible system dynamics Ft−1. In particular, the representative agent solves the following problem: $\pi_{t}=\operatorname*{arg\,max}_{\pi\in\Pi}\ \max_{\tilde{f}\in\mathcal{F}_{t-1}}\ \mathbb{E}\left[\sum_{h=0}^{H-1}r(\tilde{s}_{t,h},\tilde{a}_{t,h},\tilde{\mu}_{t,h})\right]$ s.t. $\tilde{a}_{t,h}=\pi_{t,h}(\tilde{s}_{t,h},\tilde{\mu}_{t,h})$, $\tilde{s}_{t,h+1}=\tilde{f}(\tilde{s}_{t,h},\tilde{a}_{t,h},\tilde{\mu}_{t,h})+\tilde{\omega}_{t,h}$, $\tilde{\mu}_{t,h+1}=\Phi(\tilde{\mu}_{t,h},\pi_{t,h},\tilde{f})$, (5b) $\left(5\text{c}\right)$ $$(5\mathrm{d})$$ $$(5\mathrm{a})$$ Algorithm 1 Model-based RL for Mean-field Control Input: Calibrated dynamical model, reward function r(st,h, at,h, µt,h), horizon H, initial state s1,0 ∼ µ0 for t = 1, 2*, . . .* do Use M3–UCRL to select policy profile πt = (πt,0, . . . , πt,h−1) by using the current dynamics model and reward function, i.e., solve Eq. (5) for h = 0*, . . . , H* − 1 do at,h = πt,h(st,h, µt,h), st,h+1 = f(st,h, at,h, µt,h) + ωt,h µt,h+1 = Φ(µt,h, πt,h, f) end for Update agent's statistical model with new observations {(st,h, at,h, µt,h), st,h+1} H−1 h=0 Reset the system to µt+1,0 ← µ0 and st+1,0 ∼ µt+1,0 end for where the expectation in Eq. (5a) is taken w.r.t. the initial state distribution µ0 and noise in transitions. The policy πt found by solving the previous problem is then used in the true multi-agent system (e.g., used by every driver in a ride-hailing service) for one episode. It induces the observed mean-field flow, and aims to improve the total collective reward. After the episode ends, the representative agent augments its observed data, i.e., D1:t = D1:t−1 ∪ Dt, and improves its model estimates mt(·) and σt(·). The algorithm is summarized in Algorithm 1. Since solving Eq. (5) is a challenging task even for known dynamics and the focus of this work is on the statistical complexity of learning in MFC (similarly to Kakade et al. (2020); Chowdhury & Gopalan (2019); Curi et al. (2020); Sessa et al. (2022)), we assume that we can solve Eq. (5) for a given Ft−1 and Π. We propose a practical implementation below with details on solving Eq. (5). The algorithm implements the *upper-confidence bound* principle, since the system's true dynamics f belong to the confidence set Ft−1 with high-probability (by Assumption 3). Consequently, the reward achieved by πt under the best possible dynamics ˜f upper bounds the performance of πt under the true dynamics f. Practical Implementation. In general, optimizing over the set Ft−1 is not tractable. However, a practical problem reformulation has been designed (Moldovan et al., 2015; Curi et al., 2020) for single-agent problems, which defines an auxiliary policy to select the dynamics function ˜f ∈ Ft−1. We generalize this approach to the MFC setting to implement M3–UCRL for our experiments (see Appendix D.1 for details). M3–UCRL can be combined with any statistical model that satisfies Assumption 3. For example, under mild assumptions on the unknown dynamics, Gaussian Processes (GP) models (Rasmussen, 2003) can be provably calibrated under some regularity assumptions on the dynamics (Srinivas et al., 2010; Abbasi-Yadkori & Szepesvaŕi, 2011). Neural Network (NN) models (Anthony & Bartlett, 2009) such as Probabilistic and Deterministic Ensembles (Lakshminarayanan et al., 2017; Chua et al., 2018) are more scalable, and even though they are not calibrated by default, their empirical recalibration is possible (Kuleshov et al., 2018). Finally, using such differentiable dynamics models and parameterizing πt(·) and the auxiliary policy selecting ˜f via separate neural networks, allows for optimizing Eq. (5) by using gradient-based approaches (see Appendix D). Remark 2. M3–UCRL uses an optimistic upper-confidence bound strategy similarly to single-agent modelbased upper-confidence algorithms (Chowdhury & Gopalan, 2019; Kakade et al., 2020; Curi et al., 2020; Sessa et al., 2022), however, it addresses several important differences: (i) dynamics and rewards explicitly depend on the states of all agents through the mean-field distribution; (ii) each agent's action depends on the mean-field distribution and the evolution of the mean-field trajectory is induced by the collection of actions taken by the agents; (iii) crucially, M3*–UCRL employs the principle that each agent in the system executes* the same policy selected by the representative agent; Moreover, we note that single-agent MBRL algorithms are inherently unsuitable for solving the Mean Field Control problem. ## 4 Theoretical Analysis We analyze our approach using the standard notion of *cumulative regret*. It measures the difference in the cumulative expected reward between the socially optimal policy π ∗(from Eq. (4)) and the individual policies selected by M3–UCRL in every episode: RT =PT t=1(J(π ∗) − J(πt)). We also use rt to denote the regret incurred during episode t, i.e., rt := J(π ∗) − J(πt). We aim to show that M3–UCRL achieves sublinear cumulative regret, i.e., limT→∞ 1 T RT = 0. This implies that as the number of episodes increases, the performance of the selected policies converges to that of the optimal policy: J(πt) → J(π ∗). We defer all the proofs from this section to Appendix B and only highlight the main contributions of our work. In general, the speed of convergence of M3–UCRL will depend on the difficulty of estimating f. For more complex functions, we expect our models to require more observations to achieve close approximation of the underlying dynamics. Consequently, we use the following model-based complexity measure to quantify this aspect of the learning problem: $$I_{T}=\operatorname*{max}_{\hat{D}_{1},\ldots,\hat{D}_{T}}\,\sum_{t=1}^{T}\,\sum_{z\in\hat{D}_{1}\cup\cdots\cup\hat{D}_{t}}\|\boldsymbol{\sigma}_{t-1}(z)\|_{2}^{2}\,,$$ $$({\mathfrak{G}})$$ , (6) where D˜t is a set of possible observations in an episode for each t = 1*, . . . , T*, and σt−1(·) is the confidence estimate of the selected statistical model computed based on D˜1 *∪ · · · ∪* D˜t−1. We note that the analogous notion of model complexity has been recently used in single agent model-based RL (Chowdhury & Gopalan, 2019; Curi et al., 2020) and the multi-agent setting (Sessa et al., 2022). Intuitively, IT measures the chosen model's total confidence in estimating the dynamics over T episodes in the worst-case, i.e., when the sets of observations D˜1*, . . . ,* D˜T are the least informative about the unknown dynamics f. For statistical models that fail to learn and generalize, IT may grow linearly with T. On the other hand, for models that learn from a "small" number of samples, we expect σt−1(·) to shrink fast. General Model-based Regret Bound. The following theorem bounds the cumulative regret after T episodes in terms of the model complexity measure IT defined in Eq. (6). Theorem 1. *Under Assumptions 1 to 4, let* LT −1 = 1 + 2(1 + Lπ) [Lf + 2βT −1Lσ], and let µt,h ∈ P(S) for all t, h > 0. Then for all T ≥ 1 and fixed constant H > 0, with probability at least 1 − δ, the regret of M3*–UCRL is at most:* $$R_{T}={\mathcal{O}}\Big(\beta_{T}L_{r}(1+L_{\pi})\overline{{L}}_{T-1}^{H-1}\sqrt{H^{3}T I_{T}}\Big).$$ The obtained regret bound explicitly depends on constant factors that describe the environment such as the episode horizon H and the Lipschitz constants. The dependence on the size of the problem, i.e., p and q, is implicit in βT and IT and specific to the statistical model used in the algorithm. We provide more explicit dependencies for Gaussian Processes below and in Appendix C.1. We also note that βT is a function of δ (see Assumption 3). When polices are selected according to Eq. (5) at every episode, our result implies that the obtained performance J(πt) eventually converges to the optimal one J(π ∗) if the joint dependence on the model-dependent quantities IT and βT scales as O( √T). In comparison to other model-based algorithms, both M3–UCRL and H-UCRL (Curi et al., 2020) achieve O( √H3T IT ) regret while H-MARL (Sessa et al., 2022) achieves O(N H/2 √H3T IT ). The additional factor of O(N H/2) comes from the fact that H-MARL considers separate agents with individual action spaces while M3–UCRL optimises for a representative agent instead. In terms of tightness of our results, we expect that the dependency on O( √T IT ) in the regret bound is unavoidable. Scarlett et al. (2017) showed that this is a lower bound for the kernelized bandit problem for specific kernels and using a Gaussian Process. This result relates to the special case of MFC when H = 1 and using Gaussian Process statistical model to estimate the transition dynamics. The dependency on H3, however, could be improved under more restrictive assumptions. In our theoretical analysis, we address non-trivial challenges that arise from considering an infinite number of agents. In particular, we first translate the Mean Field Control to a non-standard MDP with the distributional state space P(S) and action space Π of all admissible policies (for details, see Appendix B.2). This enables us to use the upper-confidence bound principle with the assumption of well-calibrated models to show the following bound on the episodic regret: $$r_{t}\leq2L_{r}(1+L_{\pi})\sum_{h=1}^{H-1}W_{1}(\mu_{t,h},\tilde{\mu}_{t,h}),$$ ![7_image_0.png](7_image_0.png) Figure 1: Fig. 1a shows the initial mean-field distribution µh,0 for each episode h. Fig. 1b shows the mean-field distribution at the end of an episode using a policy that selects actions uniformly at random. where µt,h and µ˜t,h are the mean-field distributions when the policy πt is deployed in (i) the true multi-agent system and (ii) the system with dynamics given by the transition function ˜ft selected by the oracle corresponding to πt. The main theoretical contribution of our work is provided in Lemma 5 (see Appendix B.3) which shows the following bound on the Wasserstein-1 distance between the two mean-field distributions: $$W_{1}(\tilde{\mu}_{t,h},\mu_{t,h})\leq2\beta_{t-1}\overline{{{L}}}_{t-1}^{h-1}\sum_{i=1}^{h-1}\int_{\mathcal{S}}\left\|\mathbf{\sigma}_{t-1}(s,\pi_{t}(s,\mu_{t,i}),\mu_{t,i})\right\|_{2}\mu_{t,i}(d s).$$ This shows that the deviation between the used µ˜t,h and µt,h is bounded by the uncertainty of the statistical model integrated over µt,h. As the model's uncertainty decreases, the set Ft shrinks towards the true dynamics f and the dynamics ˜f selected in Eq. (5) is restricted to be close to f. Next, we show an example of how the previously obtained regret bounds can be instantiated for particular models. To do so, we consider the case of Gaussian Process models. Bounds for Gaussian Process (GP) Models. GP models are frequently used to model unknown dynamics in the model-based literature (see, e.g., Srinivas et al. (2010); Chowdhury & Gopalan (2019); Curi et al. (2020); Sessa et al. (2022)). They can successfully distinguish between model's and noise uncertainty, while their expressiveness follows from different kernel functions that can be used to model different types of correlation in data. Under some regularity assumptions on f, i.e., when the true f has a bounded norm in the Reproducing Kernel Hilbert Space (RKHS) induced by the GP kernel function, these models provably satisfy Assumption 3. Moreover, we formally show in Appendix C that for such a GP statistical model, we can bound IT by the *GP maximum mutual information (MMI)*. Similarly, we can express βT via the same quantity, and conclude that sublinearity of our regret depends on the MMI rates. Srinivas et al. (2010) obtain sublinear (in the number of episodes T) upper bounds for this quantity in case of the most commonly-used kernels, such as the linear, squared-exponential, or Matérn kernels, while Krause & Ong (2011) prove sublinear bounds for certain composite kernels. Finally, we note that the aforementioned works consider kernels defined on Euclidean spaces while our input space for f, namely Z = *S × A × P*(S), includes the space of probability densities P(S). Providing bounds on the GP maximum mutual information capacity in case of kernels defined on probability spaces is an interesting direction for future work. ![8_image_1.png](8_image_1.png) (a) (b) ![8_image_0.png](8_image_0.png) Figure 2: Convergence of the M3–UCRL algorithm under system dynamics given by Eq. (7). Fig. 2a shows the rewards defined in Eq. (4) achieved by M3–UCRL over 30 episodes. Confidence bounds show the minimum and maximum over 10 independent experiments. The BPTT line corresponds to the rewards achieved under known dynamics and considered to be optimal in the environment. Fig. 2b shows the close to uniform mean-field distribution at the end of the episode, h = 20, for a policy optimised by M3–UCRL. ## 5 Experiments In this section, we demonstrate the performance of the M3–UCRL algorithm on the exploration via entropy maximization problem introduced by Geist et al. (2021) and used as a benchmark problem in a recent survey on Mean-Field Games (Laurière et al., 2022). Different from previous works, we formulate the problem in the continuous state and action spaces as follows. The state-space of the model is described by a 2-dimensional space in [0, 11]2 which is split into 4 equal-sized rooms separated by unit-sized walls with one corridor connecting neighboring rooms (See Fig. 1a). Agents are free to move around within the area and are stopped by the walls if they try to move through them. Each episode t consists of 21 steps starting from h = 0 and in each time-step h the representative agent chooses its actions from the action space A = [0, 1]2. The dynamics of the system in Eq. (1) are of the following form $$f(s_{t,h},a_{t,h},\mu_{t,h})=s_{t,h}+a_{t,h},$$ $\left(7\right)$. f(st,h, at,h, µt,h) = st,h + at,h, (7) and the additive noise is Gaussian with zero mean, variance σ 2 and independent dimensions, i.e., ωt,h ∼ N(0,σ 2I2) for all t and h where I2 is the 2 × 2 unit matrix. The individual reward function is defined as r(*s, a, µ*) = − log(µ(s)) meaning that the representative agent aims to avoid crowded areas. On the whole population's level, the average one-step reward is given by Es∼µ[− log(µ(s)] = −Rs∈S µ(s) log(µ(s)), so maximizing the average reward is equivalent of maximizing the population's entropy. The population is initially condensed in the bottom-left corner (as shown in Fig. 1a) in a unit square, therefore, a policy is optimal if it disperses the population quickly to reach a uniform distribution. We parameterize our policy with a Neural Network and use a Deep Ensemble model (Lakshminarayanan et al., 2017) for estimating the system dynamics. To represent the mean-field distribution, we discretize the state-space to unit squares and assign each cell the probability of the representative agent is inside of it. We provide further details on the implementation in Appendix D. Additionally, we ran experiments with Gaussian Process models for the swarm motion problem to showcase the flexibility of design choices in M3–UCRL. Details and results are described in Appendix E.2. Laurière et al. (2022) shows that exploration is not trivial in the discrete state and action space equivalent of this environment by considering the uniform random policy which fails to reach the uniform distribution within the episode. This result holds in the continuous environment as well as shown by Fig. 1b. Results. Due to the lack of an analytical solution to the problem, we compare the rewards achieved by M3–UCRL in the policy roll-outs (i.e., the interactions with the environment) to the rewards achieved by the policy optimised via the back-propagation through time (BPTT) algorithm with *known* dynamics. We denote this policy by π BP T T and find it to be adequate since when it is used, the population's entropy quickly reaches the maximum achievable corresponding to a uniform distribution. We provide further analysis of this policy in Appendix D.4. Fig. 2a shows the rewards achieved by M3–UCRL over 30 episodes. The learning can be characterized by two phases; in the first 10 episodes M3–UCRL learns how to navigate the whole state-space, after which it reduces exploration and focuses more on fine-grained improvements. Learning to navigate the environment is challenging due to the precise movements needed to enter the corridors, especially, from an angle. Small changes in the action can decide whether the representative agent moves through the corridor to another room or is stopped by a wall. As shown by the swift improvement in M3–UCRL's performance, it successfully accumulates information in the first phase of the learning process in order to have sufficiently precise policies that can navigate the agent population through the corridors. In the second phase, it gradually refines its policy further to distribute the agents among the rooms quicker and achieve a much closer to uniform distribution as shown on Fig. 2b. The optimised policy after 30 episodes achieves a reward of 77.86 compared to 78.26 that of π BP T T , i.e., less than 1% difference. 2 While M3–UCRL converges within 30 episodes, a comparable tabular Q-learning algorithm for the MeanField Control problem fails to achieve similar performance in more than 10 million training episodes in the discrete problem defined in Geist et al. (2021) and Laurière et al. (2022). This is most likely due to the large state space, the limitation of deterministic actions, and challenging exploration in the environment. We provide further details of the comparison and why Q-learning requires long training for convergence in Appendix E.1. ## 6 Conclusion In this work, we propose the first model-based algorithm for the Mean-Field Control problem. The M3–UCRL algorithm runs in episodes, builds optimistic performance estimates, and uses them to efficiently explore the space during policy learning. We proved general regret bounds and showed how they can be specialized to Gaussian Process models. Furthermore, our experiments showcase the practicality of the algorithm and how it can be easily combined with deep Neural Networks. We believe that our approach provides an important step towards making model-based MARL algorithms more principled, scalable, and sample-efficient. We see the following topics important for the further progression of the model-based mean-field learning for both the mean-field control and mean-field game problems: 1) Planning with known dynamics to solve Eq. (5) similarly to Gu et al. (2020); Motte & Pham (2019), 2) Eliminating the need of recalibration to have Neural Networks satisfying Assumption 3, 3) Maximum mutual information bounds for kernels defined on probability spaces. ## Acknowledgments This project has received funding from the European Research Council (ERC) under the European Unions Horizon 2020 research and innovation program grant agreement No 815943 and ETH Zurich Postdoctoral Fellowship 19-2 FEL-47. This publication was made possible by an ETH AI Center doctoral fellowship to Barna Pasztor. ## References Yasin Abbasi-Yadkori and Csaba Szepesvaŕi. Regret bounds for the adaptive control of linear quadratic systems. *Journal of Machine Learning Research*, 19:1–26, 2011. Mridul Agarwal, Vaneet Aggarwal, Arnob Ghosh, and Nilay Tiwari. Reinforcement learning for mean field game. *arXiv preprint arXiv:1905.13357*, 2019. Noha Almulla, Rita Ferreira, and Diogo Gomes. Two numerical approaches to stationary mean-field games. Dynamic Games and Applications, 7(4):657–682, 2017. 2Animations of episodes with the BPTT policy (known_dynamics_animation.mp4) and the M3–UCRL policy (m3_ucrl_animation_episode_t.mp4) are included in the supplementary material. Episode 1 to 10 illustrate the quick learning during the exploration phase while episode 26 is the best-performing one also used for Fig. 2b. Andrea Angiuli, Jean-Pierre Fouque, and Mathieu Lauriere. Reinforcement Learning for Mean Field Games, with Applications to Economics. *arXiv preprint arXiv:2106.13755*, 2021. Andrea Angiuli, Jean-Pierre Fouque, and Mathieu Laurière. Unified reinforcement q-learning for mean field game and control problems. *Mathematics of Control, Signals, and Systems*, pp. 1–55, 2022. Martin Anthony and Peter L Bartlett. *Neural network learning: Theoretical foundations*. Cambridge University Press, 2009. Peter Auer, Thomas Jaksch, and Ronald Ortner. Near-optimal regret bounds for reinforcement learning. In Advances in Neural Information Processing Systems, 2009. Nicole Bäuerle. Mean Field Markov Decision Processes. *arXiv preprint arXiv:2106.08755*, 2021. Alain Bensoussan, Jens Frehse, Phillip Yam, et al. *Mean field games and mean field type control theory*, volume 101. Springer, 2013. Ronen I Brafman and Moshe Tennenholtz. A near-optimal polynomial time algorithm for learning in certain classes of stochastic games. *Artificial Intelligence*, 121(1-2):31–47, 2000. Ronen I Brafman and Moshe Tennenholtz. R-max-a general polynomial time algorithm for near-optimal reinforcement learning. *Journal of Machine Learning Research*, 3:213–231, 2002. Lucian Buşoniu, Robert Babuška, and Bart De Schutter. A comprehensive survey of multiagent reinforcement learning. *IEEE Transactions on Systems, Man and Cybernetics Part C: Applications and Reviews*, 38(2): 156–172, 2008. Pierre Cardaliaguet and Saeed Hadikhanloo. Learning in mean field games: the fictitious play. ESAIM: Control, Optimisation and Calculus of Variations, 23(2):569–591, 2017. René Carmona and François Delarue. Probabilistic analysis of mean-field games. SIAM Journal on Control and Optimization, 51(4):2705–2734, 2013. René Carmona, François Delarue, et al. *Probabilistic Theory of Mean Field Games with Applications I-II*. Springer, 2018. René Carmona, Mathieu Laurière, and Zongjun Tan. Linear-quadratic mean-field reinforcement learning: convergence of policy gradient methods. *arXiv preprint arXiv:1910.04295*, 2019a. René Carmona, Mathieu Laurière, and Zongjun Tan. Model-free mean-field reinforcement learning: meanfield mdp and mean-field q-learning. *arXiv preprint arXiv:1910.12802*, 2019b. René Carmona, Kenza Hamidouche, Mathieu LauriÉre, and Zongjun Tan. Linear-quadratic zero-sum meanfield type games: Optimality conditions and policy optimization. *Journal of Dynamics and Games. 2021,* Volume 8, Pages 403-443, 8(4):403, 2021. ISSN 21646074. Cristiano Castelfranchi. The theory of social functions: challenges for computational social science and multi-agent learning. *Cognitive Systems Research*, pp. 5–38, 2001. Minshuo Chen, Yan Li, Ethan Wang, Zhuoran Yang, Zhaoran Wang, and Tuo Zhao. Pessimism Meets Invariance: Provably Efficient Offline Mean-Field Multi-Agent RL. *Advances in Neural Information Processing* Systems, 34:17913–17926, 12 2021. Sayak Ray Chowdhury and Aditya Gopalan. On kernelized multi-armed bandits. In *International Conference* on Machine Learning, 2017. Sayak Ray Chowdhury and Aditya Gopalan. Online learning in kernelized Markov decision processes. In Proceedings of Machine Learning Research, volume 89, pp. 3197–3205, 2019. Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. In Advances in Neural Information Processing Systems, pp. 4754–4765, 2018. Sebastian Curi, Felix Berkenkamp, and Andreas Krause. Efficient model-based reinforcement learning through optimistic policy search and planning. In *Advances in Neural Information Processing Systems*, 2020. Omar Darwiche Domingues, Pierre Ménard, Matteo Pirotta, Emilie Kaufmann, and Michal Valko. Regret bounds for kernel-based reinforcement learning. *arXiv preprint arXiv:2004.05599*, 2020. Audrey Durand, Odalric-Ambrym Maillard, and Joelle Pineau. Streaming kernel regression with provably adaptive mean, variance, and regularization. *The Journal of Machine Learning Research*, 2018. Yonathan Efroni, Nadav Merlis, Mohammad Ghavamzadeh, and Shie Mannor. Tight regret bounds for model-based reinforcement learning with greedy policies. In Advances in Neural Information Processing Systems, pp. 12224–12234, 2019. S. El-Tantawy, B. Abdulhai, and H. Abdelgawad. Multiagent reinforcement learning for integrated network of adaptive traffic signal controllers (marlin-atsc): Methodology and large-scale application on downtown toronto. *IEEE Transactions on Intelligent Transportation Systems*, 14(3):1140–1150, 2013. Romuald Elie, Julien Pérolat, Mathieu Laurière, Matthieu Geist, and Olivier Pietquin. On the convergence of model free learning in mean field games. *AAAI Conference on Artificial Intelligence*, 34(05):7143–7150, 2020. Zuyue Fu, Zhuoran Yang, Yongxin Chen, and Zhaoran Wang. Actor-critic provably finds nash equilibria of linear-quadratic mean-field games. In *International Conference on Learning Representations*. OpenReview.net, 2020. Nicolas Gast, Bruno Gaujal, and Jean-Yves Le Boudec. Mean field for Markov decision processes: from discrete to continuous optimization. *IEEE Transactions on Automatic Control*, pp. 2266–2280, 2012. Matthieu Geist, Julien Pérolat, Mathieu Laurière, Romuald Elie, Sarah Perrin, Olivier Bachem, Rémi Munos, and Olivier Pietquin. Concave Utility Reinforcement Learning: the Mean-Field Game Viewpoint. *Proceedings of the International Joint Conference on Autonomous Agents and Multiagent Systems, AAMAS*, 1:489–497, 6 2021. ISSN 15582914. Diogo A Gomes et al. Mean field games models—a brief survey. *Dynamic Games and Applications*, 4(2): 110–154, 2014. Haotian Gu, Xin Guo, Xiaoli Wei, and Renyuan Xu. Dynamic programming principles for mean-field controls with learning. *arXiv preprint arXiv:1911.07314*, 2020. Haotian Gu, Xin Guo, Xiaoli Wei, and Renyuan Xu. Mean-field controls with q-learning for cooperative marl: Convergence and complexity analysis. *SIAM Journal on Mathematics of Data Science*, 3(4):1168–1196, 2021. Olivier Guéant, Jean-Michel Lasry, and Pierre-Louis Lions. Mean field games and applications. In *ParisPrinceton lectures on mathematical finance 2010*, pp. 205–266. Springer, 2011. Xin Guo, Anran Hu, Renyuan Xu, and Junzi Zhang. Learning mean-field games. In Advances in Neural Information Processing Systems, volume 32, pp. 4966–4976, 2019. Xin Guo, Anran Hu, Renyuan Xu, and Junzi Zhang. A general framework for learning mean-field games. arXiv preprint arXiv:2003.06069, 2020. Pablo Hernandez-Leal, Michael Kaisers, Tim Baarslag, and Enrique Munoz de Cote. A survey of learning in multiagent environments: Dealing with non-stationarity. *arXiv preprint arXiv:1707.09183*, 2017. Pablo Hernandez-Leal, Bilal Kartal, and Matthew E. Taylor. A survey and critique of multiagent deep reinforcement learning. *Autonomous Agents and Multi-Agent Systems*, 33(6):750–797, 2019. Minyi Huang, Roland P Malhamé, Peter E Caines, et al. Large population stochastic dynamic games: closedloop mckean-vlasov systems and the nash certainty equivalence principle. Communications in Information & Systems, 6(3):221–252, 2006. Minyi Huang, Peter E Caines, and Roland P Malhamé. Large-population cost-coupled lqg problems with nonuniform agents: individual-mass behavior and decentralized ϵ-equilibria. *IEEE Transactions on Automatic Control*, 52(9):1560–1571, 2007. Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 2010. Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. In *Conference on Learning Theory*, pp. 2137–2143, 2020. Sham Kakade, Akshay Krishnamurthy, Kendall Lowrey, Motoya Ohnishi, and Wen Sun. Information theoretic regret bounds for online nonlinear control. *arXiv preprint arXiv:2006.12466*, 2020. Leonid Kantorovich and Gennady S. Rubinstein. On a space of totally additive functions. *Vestnik Leningrad.* Univ, 13:52–59, 1958. Andreas Krause and Cheng Soon Ong. Contextual Gaussian process bandit optimization. *Advances in* Neural Information Processing Systems, 2011. Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning using calibrated regression. In *International Conference on Machine Learning*, pp. 2796–2804, 2018. Daniel Lacker. Limit theory for controlled mckean–vlasov dynamics. *SIAM Journal on Control and Optimization*, 55(3):1641–1672, 2017. Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In *Advances in Neural Information Processing Systems*, 2017. Jean-Michel Lasry and Pierre-Louis Lions. Jeux à champ moyen. i–le cas stationnaire. *Comptes Rendus* Mathématique, 343(9):619–625, 2006a. Jean-Michel Lasry and Pierre-Louis Lions. Jeux à champ moyen. ii–horizon fini et contrôle optimal. Comptes Rendus Mathématique, 343(10):679–684, 2006b. Mathieu Laurière, Sarah Perrin, Matthieu Geist, and Olivier Pietquin. Learning Mean Field Games: A Survey. *arXiv preprint arXiv:2205.12944v2*, 2022. J. W. Lee, J. Park, J. O, J. Lee, and E. Hong. A multiagent approach to q-learning for daily stock trading. IEEE Transactions on Systems, Man, and Cybernetics - Part A: Systems and Humans, pp. 864–877, 2007. Jae Won Lee, Byoung-Tak Zhang, et al. Stock trading system using reinforcement learning with cooperative agents. In *International Conference on Machine Learning*, pp. 451–458, 2002. Charles-Albert Lehalle and Charafeddine Mouzouni. A mean field game of portfolio trading and its consequences on perceived correlations. *arXiv preprint arXiv:1902.09606*, 2019. Joel Z. Leibo, Vinicius Zambaldi, Marc Lanctot, Janusz Marecki, and Thore Graepel. Multi-agent reinforcement learning in sequential social dilemmas. In Conference on Autonomous Agents and MultiAgent Systems, pp. 464–473, 2017. Yan Li, Lingxiao Wang, Jiachen Yang, Ethan Wang, Zhaoran Wang, Tuo Zhao, and Hongyuan Zha. Permutation Invariant Policy Optimization for Mean-Field Multi-Agent Reinforcement Learning: A Principled Approach. *arXiv preprint arXiv:2105.08268*, 2021. Teodor Mihai Moldovan, Sergey Levine, Michael I Jordan, and Pieter Abbeel. Optimism-driven exploration for nonlinear systems. In *IEEE International Conference on Robotics and Automation*, 2015. Médéric Motte and Huyên Pham. Mean-field Markov decision processes with common noise and open-loop controls. *arXiv preprint arXiv:1912.07883*, 2019. Thanh Thi Nguyen, Ngoc Duy Nguyen, and Saeid Nahavandi. Deep reinforcement learning for multiagent systems: A review of challenges, solutions, and applications. *IEEE transactions on cybernetics*, 50(9): 3826–3839, 2020. Afshin OroojlooyJadid and Davood Hajinezhad. A review of cooperative multi-agent deep reinforcement learning. *arXiv preprint arXiv:1908.03963*, 2019. Jakub Pachocki, Greg Brockman, Jonathan Raiman, Susan Zhang, Henrique Pondé, Jie Tang, Filip Wolski, Christy Dennison, Rafal Jozefowicz, Przemyslaw Debiak, et al. Openai five. URL https://blog. openai. com/openai-five, 2018. Victor M. Panaretos and Yoav Zemel. Statistical Aspects of Wasserstein Distances. Annual Review of Statistics and Its Application, 6(1):405–431, 2019. ISSN 2326-8298. Carl Edward Rasmussen. Gaussian processes in machine learning. In *Summer School on Machine Learning*, 2003. Jonathan Scarlett, Ilija Bogunovic, and Volkan Cevher. Lower bounds on regret for noisy Gaussian process bandit optimization. In Satyen Kale and Ohad Shamir (eds.), Proceedings of the 2017 Conference on Learning Theory, volume 65 of *Proceedings of Machine Learning Research*, pp. 1723–1742. PMLR, 07–10 Jul 2017. Pier Giuseppe Sessa, Maryam Kamgarpour, and Andreas Krause. Efficient Model-based Multi-agent Reinforcement Learning via Optimistic Equilibrium Computation, 2022. ISSN 2640-3498. Shai Shalev-Shwartz, Shaked Shammah, and Amnon Shashua. Safe, multi-agent, reinforcement learning for autonomous driving. *arXiv preprint arXiv:1610.03295*, 2016. Niranjan Srinivas, Andreas Krause, Sham Kakade, and Matthias Seeger. Gaussian process optimization in the bandit setting: No regret and experimental design. In *International Conference on Machine Learning*, pp. 1015–1022, 2010. Ingo Steinwart and Christmann Andreas. Support vector machines. In Climate Change 2013 - The Physical Science Basis. Springer, 2008. ISBN 978-0-387-77241-7. Jayakumar Subramanian and Aditya Mahajan. Reinforcement learning in stationary mean-field games. In International Conference on Autonomous Agents and MultiAgent Systems, pp. 251–259, 2019. Oriol Vinyals, Igor Babuschkin, Wojciech M Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H Choi, Richard Powell, Timo Ewalds, Petko Georgiev, et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. *Nature*, 575(7782):350–354, 2019. Lingxiao Wang, Zhuoran Yang, and Zhaoran Wang. Breaking the curse of many agents: Provable mean embedding q-iteration for mean-field reinforcement learning. In International Conference on Machine Learning, pp. 10092–10103, 2020. Weichen Wang, Jiequn Han, Zhuoran Yang, and Zhaoran Wang. Global Convergence of Policy Gradient for Linear-Quadratic Mean-Field Control/Game in Continuous Time, 2021. ISSN 2640-3498. Pierre Weiss. L'hypothèse du champ moléculaire et la propriété ferromagnétique. *J. Phys. Theor. Appl.*, 6 (1):661–690, 1907. Jiachen Yang, Xiaojing Ye, Rakshit Trivedi, Huan Xu, and Hongyuan Zha. Learning deep mean field games for modeling large population behavior. *International Conference on Learning Representations*, pp. 1–15, 2017. Yaodong Yang, Rui Luo, Minne Li, Ming Zhou, Weinan Zhang, and Jun Wang. Mean field multi-agent reinforcement learning. In *International Conference on Machine Learning*, pp. 5571–5580, 2018. Huibing Yin, Prashant G Mehta, Sean P Meyn, and Uday V Shanbhag. Learning in mean-field oscillator games. In *49th IEEE Conference on Decision and Control (CDC)*, pp. 3125–3132, 2010. Huibing Yin, Prashant G Mehta, Sean P Meyn, and Uday V Shanbhag. Learning in mean-field games. *IEEE* Transactions on Automatic Control, 59(3):629–644, 2013. Kaiqing Zhang, Zhuoran Yang, and Tamer Başar. Multi-agent reinforcement learning: A selective overview of theories and algorithms. *arXiv preprint arXiv:1911.10635*, 2019. ## A Preliminaries On The Wasserstein Distance In this section, we provide a brief overview on the Wasserstein distance and its properties used in the proof of our general regret bound in Theorem 1. Definition 1 (Wasserstein Distance). Let µ and ν *be two probability distributions on* R d, then for k ∈ {1, 2, ...} the Wasserstein distance of order k *is defined by* $$W_{k}(\mu,\nu)=\left[\operatorname*{inf}_{\gamma}\int_{\Omega\times\Omega}\left\|x-y\right\|^{k}d\gamma(x,y)\right]^{1/k}$$ where the infimum is taken over all joint distributions γ with marginals µ, ν*. For* k = 1, a standard dual formulation derived by Kantorovich & Rubinstein (1958) is given by: $$W_{1}(\mu,\nu)=\operatorname*{sup}_{f\in{\mathcal{F}}}\Big\{\int f(x)d(\mu-\nu)(x)\Big\}$$ $$(8)$$ where F = {f : R d → R such that |f(x) − f(y)| ≤ ∥x − y∥ ∀*x, y* ∈ R d}. Both formulations above generalises to laws defined on more general space, e.g., complete and separable metric spaces and infinitedimensional function spaces such as L 2[0, 1]. The Wasserstein distance is usually interpreted as the minimum transportation distance between the distributions µ and ν. For random variables X ∼ µ and Y ∼ ν, we use the notations Wk(*X, Y* ) and Wk(*µ, ν*) interchangeably. Assuming that Wk(*X, Y* ) is finite, i.e., E[∥X∥ k] + E[∥Y ∥ k] < ∞, the distance obeys the following properties Panaretos & Zemel (2019): - For m ≤ n, by Jensen's Inequality, we have: $$W_{m}(X,Y)\leq W_{n}(X,Y)$$ $$({\mathfrak{g}})$$ $$W_{k}(a X,a Y)=|a|W_{k}(X,Y)$$ $$(10)$$ $$(11)$$ $\left(12\right)^{2}$ Wm(X, Y ) ≤ Wn(*X, Y* ) (9) - For a ∈ R, it holds Wk(*aX, aY* ) = |a|Wk(*X, Y* ) (10) - For $x\in\mathbb{R}^p$, it holds. Wk(X + *x, Y* + x) = Wk(*X, Y* ) (11) - For x ∈ R p, we have that $$W_{k}(X+x,Y+x)=W_{k}(X,Y)$$ $$W_{2}^{2}(X+x,Y)=\|x+\mathbb{E}[X]-\mathbb{E}[Y]\|^{2}+W_{2}^{2}(X,Y)$$ (*X, Y* ) (12) Corollary 1. Let X, Y *be independent identically distributed random variables on* R p *with* E[∥X∥ k] < ∞ and *x, y* ∈ R p*. Then,* W1(X + x, Y + y) ≤ ∥x − y∥2 Proof. W2 2 (X + x, Y + y) = W2 2 (X + x − y, Y ) By Eq. (11) = ∥x − y + E[X] − E[Y ]∥ 2 2 + W2 2 (X, Y ) By Eq. (12) = ∥x − y∥ 2 2 X and Y are i.i.d. Therefore, W1(X + x, Y + y) ≤ W2(X + x, Y + y) By Eq. (9) $$\begin{array}{r}{W_{1}(X+x,Y+y)\leq W_{2}(X+x,Y+y)}\\ {\leq\|x-y\|_{2}}\end{array}$$ By $Eq.\ (9)$ . ## B Regret Bound Proof In the following subsections, we present the theoretical analysis that leads to the results of Theorem 1. ## B.1 Measuring Performance Under Arbitrary Transition Function Before we start proving the main theorem, we introduce the following notation of ˜J(π, ˜f) to measure the performance of a policy π under the transition function ˜f: $$\tilde{\mathbb{J}}(\boldsymbol{\pi},\tilde{f}):=\mathbb{E}\left[\sum_{h=0}^{H-1}r(\tilde{s}_{h},\tilde{a}_{h},\tilde{\mu}_{h})\right]$$ s.t. $\tilde{a}_{h}=\pi_{h}(\tilde{s}_{h},\tilde{\mu}_{h})$ $\tilde{s}_{h+1}=\tilde{f}(\tilde{s}_{h},\tilde{a}_{h},\tilde{\mu}_{h})+\tilde{\omega}_{h}$ $\tilde{\mu}_{h+1}=\Phi(\tilde{\mu}_{h},\pi_{h},\tilde{f})$, (13a) $\begin{array}{l}\left(13\text{b}\right)\\ \text{\hspace{0.17em}}\left(13\text{c}\right)\\ \text{\hspace{0.17em}}\left(13\text{d}\right)\end{array}$ where the expectation in Eq. (13a) is taken with respect to initial state distribution µ0 and noise in transitions. We note that we can rewrite the optimization problems in Eq. (4) and Eq. (5) such that π ∗ ∈ arg maxπ∈Π J(π) = arg maxπ∈Π ˜J(π, f) and πt = arg maxπ∈Π maxf˜∈Ft−1 ˜J(π, ˜f), respectively. ## B.2 Measure Formulation First, we provide the proof of Lemma 1. Then, we reformulate the optimization problems in Eq. (4) and Eq. (5a) as a Markov Decision Process on a probability measure space with transition dynamics defined in Lemma 1. The following proof follows Lemma 2.2 in Gu et al. (2020). We are stating it here for the sake of completeness. Proof of Lemma 1. Fix π and let φ be a bounded measurable function on S. Recall that sh denotes random variable of the representative agent's state at time t and, by the definition of µh, sh ∼ µh. First note that $$\mathbb{E}_{s_{h+1}}[\varphi(s_{h+1})]=\int_{s^{\prime}\in S}\mu_{h+1}(d s^{\prime})\varphi(s^{\prime}).$$ On the other hand, by the law of iterated conditional expectation, Esh+1 [φ(sh+1)] = Es0,...,sh hEsh+1 [φ(sh+1)|s0, . . . , sh] i = Es0,...,sh " Z s ′∈S φ(s ′)P[sh+1 ∈ ds′|s0, . . . , sh] # = Es0,...,sh " Z s ′∈S φ(s ′)P[f(sh, πh(sh, µh), µh) + ωh ∈ ds′] # = Z s ′∈S φ(s ′)Es0,...,sh hP[f(sh, πh(sh, µh), µh) + ωh ∈ ds′] i = Z s ′∈S φ(s ′) Z s∈S µh(ds)P[f(s, πh(s, µh), µh) + ωh ∈ ds′]. In the third equality, we used the dynamics of the system Eq. (1) which states that sh+1 is determined by sh, ah, µh as sh+1 ∼ f(sh, ah, µh) + ωh. The last equality follows from µh(ds) = P[sh ∈ ds]. Therefore, $$\int_{s^{\prime}\in S}\mu_{h+1}(d s^{\prime})\varphi(s^{\prime})=\int_{s^{\prime}\in S}\varphi(s^{\prime})\int_{s\in S}\mu_{h}(d s)\mathbb{P}[f(s,\pi_{h}(s,\mu_{h}),\mu_{h})+\omega_{h}\in d s^{\prime}],$$ which implies the desired results $$\mu_{h+1}(d s^{\prime})=\int_{s\in{\mathcal{S}}}\mu_{h}(d s)\mathbb{P}[f(s,\pi_{h}(s,\mu_{h}),\mu_{h})+\omega_{h}\in d s^{\prime}].$$ Remark 2. *The relationship described in Lemma 1 is the discrete-time equivalent of the Fokker-Planck* (Kolmogorov forward) equation for the McKean-Vlasov Process. While we provided a proof for the dynamics in Eq. (1), it holds for any other functions ˜ft ∈ Ft for t = 1, 2*, . . .* . Now, we consider the objective under the true dynamics, Eq. (4). The following lemma is based on Lemma 2.1. in Gu et al. (2020). Lemma 2. *For any policy* π = (π0*, . . . , π*H−1), $$\mathbb{J}(\pi)=\sum_{h=0}^{H-1}{\hat{r}}(\mu_{h},\pi_{h}),$$ where rˆ *is the integrated reward function defined as* $$\hat{r}(\mu,\pi)=\int_{\cal S}\mu(ds)r(s,\pi(s,\mu),\mu),\tag{14}$$ and µh is the mean-field distribution induced by the policy π *following the dynamics defined in Eq.* (2). Proof. J(π) = Es0∼µ0,ω0,...,ωH−1 "HX−1 h=0 r(sh, πh(sh, µh), µh) # = H X−1 h=0 -Es0∼µ0,ω0,...,ωh−1 r(sh, πh(sh, µh), µh) = H X−1 h=0 Z S P[sh ∈ ds]r(s, πh(s, µh), µh) = H X−1 h=0 Z S µh(ds)r(s, πh(s, µh), µh) = H X−1 h=0 rˆ(µh, πh). The expectation in the first line is taken over the random variables s0, ω0*, . . . , ω*H−1 that induce the state trajectory s0, s1*, . . . , s*H. In particular, for a fixed policy the continuous random variable sh is a function of s0, ω0*, . . . , ω*h−1. In the second line, we use the linearity of expectation and sh's independence of ωh*, . . . , ω*H−1. The third line follows from the definition of expectation. Note that the fixed and known initial distribution µ0, the true transition function f, and the fixed policy π define the mean-field distributions µh, for all 0 ≤ h ≤ H via Eq. (2). The fourth equality follows from Lemma 1, i.e., µh(ds) = P[sh ∈ ds]. Corollary 2. The arguments in Lemma 2 apply in the case when the transition function of the system is unknown but approximated via ˜f*. We can rewrite* ˜J(π, ˜f) *defined in Eq.* (13a) as $$\tilde{\mathbb{J}}(\pi,\tilde{f})=\sum_{h=0}^{H-1}\hat{r}(\tilde{\mu}_{t,h},\pi_{h}).$$ where µ˜t,h is the mean-field distribution induced by the policy π *under the estimated transition function* ˜f. Corollary 3. *By using the objective formulation from Lemma 2, we can restate the optimization problem* Eq. (4) as $$\max_{\pi}\mathbb{J}(\pi)=\sum_{h=0}^{H-1}\hat{r}(\mu_{h},\pi_{h})\tag{15}$$ $$s.t.\ \mu_{h+1}=\Phi(\mu_{h},\pi_{h},f),\tag{16}$$ where Φ *is defined in Eq.* (2)*. The same holds for the optimization under any other transition function* ˜f in Eq. (5). Remark 3. *Corollary 3 turns the optimization problem Eq.* (4) *into a Markov Decision Process where* the state space is the space of probability measures P(S) *and the action space is the space of functions* Π = {π : S ×P(S) → A}. This reformulation comes with a certain trade-off: P(S) and Π are more complex than S ⊂ R q and A ⊂ R p*but, in contrast to Eq.* (4)*, the transition function in Eq.* (16) *is deterministic.* ## B.3 Proof Of Theorem 1 As described in Section 3, at the beginning of episode t, the representative agent optimizes over both the set of admissible policies, Π, and plausible transition functions, Ft−1, satisfying Assumptions 1 to 3. In the following, we denote the transition function corresponding to the optimal policy by ˜ft−1 ∈ Ft−1, i.e., $$\pi_{t},\tilde{f}_{t-1}=\arg\operatorname*{max}_{\pi,\tilde{f}}\tilde{\mathbb{J}}(\pi,\tilde{f}).$$ Lemma 3. Conditioning on the event in Assumption 3 holding true in episode t, the following holds for episodic regret: $$r_{t}=\mathbb{J}(\pi^{*})-\mathbb{J}(\pi_{t})\leq\tilde{\mathbb{J}}(\pi_{t},\tilde{f}_{t-1})-\mathbb{J}(\pi_{t}).$$ ˜ft−1) − J(πt). (17) Proof. Recall that π ∗ denotes the socially optimal policy from Eq. (4) and let ˜f ∗ t−1 = arg maxf˜∈Ft−1 ˜J(π ∗, ˜f). The well-calibrated property from Assumption 3 implies that the true transition function f is in the set of functions Ft−1 meaning that the true dynamics of the system f has been considered in Eq. (5) at the beginning of episode t. Then, since we provide additional flexibility to the optimization, we have $$\tilde{\mathbb{J}}(\pi^{*},\tilde{f}_{t-1}^{*})\geq\mathbb{J}(\pi^{*})$$ Using this inequality we can bound the episodic regret as follows: $$\begin{array}{c}{{r_{t}=\mathbb{J}(\pi^{*})-\mathbb{J}(\pi_{t})\leq\tilde{\mathbb{J}}(\pi^{*},\tilde{f}_{t-1}^{*})-\mathbb{J}(\pi_{t})}}\\ {{\leq\tilde{\mathbb{J}}(\pi_{t},\tilde{f}_{t-1}^{})-\mathbb{J}(\pi_{t}),}}\end{array}$$ $$(17)$$ where the last inequality comes from the fact that M3–UCRL selects the policy πt according to (πt, ˜ft−1) = arg maxπ,f˜ ˜J(π, ˜f). Lemma 4. Under Assumptions 2 to 3 and conditioning on that the event defined in Assumption 3 holds true, it follows for all t ≥ 1: $$r_{t}\leq\tilde{\mathbb{J}}(\pi_{t},\tilde{f}_{t-1})-\mathbb{J}(\pi_{t})\leq2L_{r}(1+L_{\pi})\sum_{h=1}^{H-1}W_{1}(\tilde{\mu}_{t,h},\mu_{t,h}),$$ $$(18)$$ where µt,h is the mean-field distribution observed in the true unknown environment with dynamics f *as in* Eq. (3) when agents follow πt and µ˜t,h *is the mean-field distribution under the approximated dynamics* ˜ft−1 as in Eq. (13a). Proof. By Lemma 3, we have that $$r_{t}\leq\tilde{\mathbb{J}}(\pi_{t},\tilde{f}_{t-1})-\mathbb{J}(\pi_{t}).$$ By using Lemma 2, Corollary 2 and the triangle inequality we get $$\tilde{\mathbb{J}}(\pi_{t},\tilde{f}_{t-1})-\mathbb{J}(\pi_{t})|=\left|\sum_{h=0}^{H-1}\hat{r}(\tilde{\mu}_{t,h},\pi_{t,h})-\sum_{h=0}^{H-1}\hat{r}(\mu_{t,h},\pi_{t,h})\right|$$ $$\leq\sum_{h=0}^{H-1}|\hat{r}(\tilde{\mu}_{t,h},\pi_{t,h})-\hat{r}(\mu_{t,h},\pi_{t,h})|.$$ $$(19)$$ $$(20)$$ Consider a fixed h ∈ {0*, ..., H* − 1}, then |rˆ(˜µt,h, πt,h) − rˆ(µt,h, πt,h)| = Z S r(s, πt,h(s, µ˜t,h), µ˜t,h)˜µt,h(ds) − Z S r(s, πt,h(s, µt,h), µt,h)µt,h(ds) From Eq. (14) = Z S r(s, πt,h(s, µ˜t,h), µ˜t,h)˜µt,h(ds) − Z S r(s, πt,h(s, µt,h), µt,h)˜µt,h(ds) + Z S r(s, πt,h(s, µt,h), µt,h)˜µt,h(ds) − Z S r(s, πt,h(s, µt,h), µt,h)µt,h(ds) ≤ Z S |r(s, πt,h(s, µ˜t,h), µ˜t,h) − r(s, πt,h(s, µt,h), µt,h))|µ˜t,h(ds) (19) + Z S r(s, πt,h(s, µt,h), µt,h)(˜µt,h(ds) − µt,h(ds)) , (20) where the last inequality follows from the triangle inequality and the inequality for the absolute value of definite integrals. We start by considering the integrand of the term in Eq. (19) $$|r(s,\pi_{t,h}(s,\hat{\mu}_{t,h}),\hat{\mu}_{t,h})-r(s,\pi_{t,h}(s,\mu_{t,h}),\mu_{t,h})|$$ $$\leq L_{r}(\|s-s\|_{2}+\|\pi_{t,h}(s,\hat{\mu}_{t,h})-\pi_{t,h}(s,\mu_{t,h})\|_{2}+W_{1}(\hat{\mu}_{t,h},\mu_{t,h}))$$ $$\leq L_{r}(L_{r}(\|s-s\|_{2}+W_{1}(\hat{\mu}_{t,h},\mu_{t,h}))+W_{1}(\hat{\mu}_{t,h},\mu_{t,h}))$$ $$\leq L_{r}(1+L_{\pi})W_{1}(\hat{\mu}_{t,h},\mu_{t,h}),\tag{21}$$ where the inequalities follow from Assumption 2. Next, we consider the function g(s) = 1 Lr(1+Lπ ) r(s, πt,h(s, µt,h), µt,h) $$|g(x)-g(y)|=\frac{1}{L_{r}(1+L_{\pi})}|r(x,\pi_{t,h}(x,\mu_{t,h}),\mu_{t,h})-r(y,\pi_{t,h}(y,\mu_{t,h}),\mu_{t,h})|$$ $$\leq\frac{L_{r}}{L_{r}(1+L_{\pi})}(\|x-y\|_{2}+\|\pi_{t,h}(x,\mu_{t,h})-\pi_{t,h}(y,\mu_{t,h})\|_{2}+\underbrace{W_{1}(\mu_{t,h},\mu_{t,h})}_{=0})$$ $$\leq\frac{L_{r}}{L_{r}(1+L_{\pi})}(\|x-y\|_{2}+L_{\pi}(\|x-y\|_{2}+\underbrace{W_{1}(\mu_{t,h},\mu_{t,h})}_{=0}))$$ $$=\|x-y\|_{2}\,,$$ where Assumption 2 has been applied in the second and third lines. Therefore, g is a Lipschitz-1 function. We bound the second term in Eq. (20) by using the previously defined function g $$\begin{array}{l}{{\int_{\mathcal{S}}r(s,\pi_{t,h}(s,\mu_{t,h}),\mu_{t,h})(\hat{\mu}_{t,h}(d s)-\mu_{t,h}(d s))}}\\ {{=L_{r}(1+L_{\pi})\int_{\mathcal{S}}\underbrace{\frac{1}{L_{r}(1+L_{\pi})}r(s,\pi_{t,h}(s,\mu_{t,h}),\mu_{t,h})(\hat{\mu}_{t,h}(d s)-\mu_{t,h}(d s))}_{=g(s)}}\\ {{\ }}\\ {{<L_{r}(1+L_{\pi})W_{1}(\hat{\mu}_{t,h},\mu_{t,h}).}}\end{array}$$ $$(22)$$ $$\leq L_{r}(1+L_{\pi})W_{1}(\tilde{\mu}_{t,h},\mu_{t,h}).$$ ≤ Lr(1 + Lπ)W1(˜µt,h, µt,h). (22) The last inequality comes from the Kantorovich-Rubinstein dual formulation of the Wasserstein-1 distance in Eq. (8). Using the inequalities in Eq. (21) and Eq. (22) for Eq. (19) and Eq. (20), respectively, we get that $$|\hat{r}\big(\tilde{\mu}_{t,h},\pi_{t,h}\big)-\hat{r}\big(\mu_{t,h},\pi_{t,h}\big)|\leq2L_{r}(1+L_{\pi})W_{1}\big(\tilde{\mu}_{t,h},\mu_{t,h}\big).$$ Summing it up from h = 1 to h = H − 1, we obtain the desired result: $$|\tilde{\mathbb{J}}(\pi_{t},\tilde{f}_{t-1})-\mathbb{J}(\pi_{t})|\leq2L_{r}(1+L_{\pi})\sum_{h=1}^{H-1}W_{1}(\tilde{\mu}_{t,h},\mu_{t,h}).$$ We note that h = 0 is removed from the sum since the initial distribution is fixed, µ˜t,0 = µt,0 = µ0, therefore W1(˜µt,0, µt,0) = 0. Lemma 5. *Under Assumptions 1 to 4, and assuming that event in Assumption 3 holds true, and for* h ∈ {1, ..., H} and t ≥ 1 and fixed policy πt*, it holds:* $$W_{1}(\bar{\mu}_{t,h},\mu_{t,h})\leq2\beta_{t-1}\overline{L}_{t-1}^{h-1}\sum_{i=0}^{h-1}\int_{S}\|\mathbf{\sigma}_{t-1}(s,\pi_{t,hh}(s,\mu_{t,i}),\mu_{t,i})\|_{2}\,\mu_{t,i}(ds),\tag{23}$$ where Lt−1 = 1 + 2(1 + Lπ) [Lf + 2βt−1Lσ]. Proof. To simplify the notation when it comes to both f and ˜ft−1, we omit the action variable as it is determined via π, µ and the current state, i.e., f(*s, µ*) := f(s, πt(*s, µ*), µ) and similarly for ˜ft−1. Furthermore, we fix t ≥ 1. First, we establish a relationship between W1(˜µt,h+1, µt,h+1) and W1(˜µt,h, µt,h), i.e., the change in the Wasserstein distance between the state distributions under the true dynamics and the approximated dynamics ˜ft−1. Then, we will use this relationship and the fact that the initial distribution is fixed, i.e., µt,0 = ˜µt,0, to bound the distance at time h. First, we rewrite W1(˜µt,h+1, µt,h+1) in terms of πt,h, µ˜t,h and µt,h, use the triangle inequality for the Wasserstein-1 distance, and use the Kantorovich and Rubinstein formulation from Eq. (8). W1(˜µt,h+1, µt,h+1) = W1(Φ(πt,h, µ˜t,h, ˜ft−1), Φ(πt,h, µt,h, f)) ≤ W1(Φ(πt,h, µ˜t,h, ˜ft−1), Φ(πt,h, µt,h, ˜ft−1)) + W1(Φ(πt,h, µt,h, ˜ft−1), Φ(πt,h, µt,h, f)) = sup v:Lip(v)≤1 Z s ′∈S v(s ′) Z s∈S P[ ˜ft−1(s, µ˜t,h) + ˜ωt,h ∈ ds′](˜µt,h(ds) − µt,h(ds))!(24) + sup v:Lip(v)≤1 Z s ′∈S v(s ′) Z s∈S P[ ˜ft−1(s, µ˜t,h) + ˜ωt,h ∈ ds′] − P[f(s, µt,h) + ωt,h ∈ ds′]µt,h(ds) ! . (25) Next, we consider terms from Eq. (24) and Eq. (25) separately, and obtain upper-bounds for both of them in terms of W1(˜µt,h, µt,h) and σt−1(s, πt,h(s, µ˜t,h), µ˜t,h). Step 1: Bounding Eq. (25) First, we fix v such that Lip(v) ≤ 1. Then, consider Eq. (25) s ′∈S v(s ′) Z s∈S P[ ˜ft−1(s, µ˜t,h) + ˜ωt,h ∈ ds′] − P[f(s, µt,h) + ωt,h ∈ ds′]µt,h(ds) ! Z = Z s∈S Z s ′∈S v(s ′) hP[ ˜ft−1(s, µ˜t,h) + ˜ωt,h ∈ ds′] − P[f(s, µt,h) + ωt,h ∈ ds′] iµt,h(ds) Fubini's thm. ≤ Z s∈S W1( ˜ft−1(s, µ˜t,h) + ˜ωt,h, f(s, µt,h) + ωt,h)µt,h(ds) Eq. (8) ≤ Z s∈S ˜ft−1(s, µ˜t,h) − f(s, µt,h)2 µt,h(ds). Corollary 1 (26) Note that the state space is compact hence the first moment of µ˜t,h+1 and µt,h+1 exist and W1(˜µt,h+1, µt,h+1) < ∞, therefore, the integration above is finite and Fubini's theorem is applicable. Next, we consider the following two claims. Claim 5.1. *Under Assumption 3 and assuming that the event defined in it holds true, we have that* $$C o r o l l a r y\ 1\ \ \ (26)$$ $$\left\|\tilde{f}_{t-1}(s,\tilde{\mu}_{t,h})-f(s,\tilde{\mu}_{t,h})\right\|_{2}\leq2\beta_{t-1}\left\|\sigma_{t-1}(s,\pi_{t,h}(s,\tilde{\mu}_{t,h}),\tilde{\mu}_{t,h})\right\|_{2}.$$ Proof. ˜ft−1(s, µ˜t,h) − f(s, µ˜t,h)2 = ˜ft−1(s, µ˜t,h) − mt−1(s, µ˜t,h) + mt−1(s, µ˜t,h) − f(s, µ˜t,h)2 ≤ ˜ft−1(s, µ˜t,h) − mt−1(s, µ˜t,h)2 + ∥mt−1(s, µ˜t,h) − f(s, µ˜t,h)∥2 = vuutXp i=1 -˜ft−1(s, µ˜t,h) − mt−1(s, µ˜t,h)2 i + vuutXp i=1 [mt−1(s, µ˜t,h) − f(s, µ˜t,h)]2 i ≤ 2 vuutXp i=1 β 2 t−1 [σt−1(s, πt,h(s, µ˜t,h), µ˜t,h)]2 i = 2βt−1 ∥σt−1(s, πt,h(s, µ˜t,h), µ˜t,h)∥2 where [·]i denotes the i-th coordinate. The first inequality follows from the triangle inequality, after which, we used the event defined in Assumption 3 and the fact that ˜ft−1 is chosen to satisfy the same condition. Claim 5.2. *Under Assumption 1 and Assumption 2, we have that* $$\|f(s,\tilde{\mu}_{t,h})-f(s,\mu_{t,h})\|_{2}\leq L_{f}(1+L_{\pi})W_{1}(\tilde{\mu}_{t,h}\mu_{t,h})).$$ Proof. From Assumption 1 and Assumption 2, it follows that $$\|f(s,\hat{\mu}_{t,h})-f(s,\mu_{t,h})\|_{2}\leq L_{f}(\|\pi_{t,h}(s,\hat{\mu}_{t,h})-\pi_{t,h}(s,\mu_{t,h})\|_{2}+W_{1}(\hat{\mu}_{t,h}\mu_{t,h}))$$ $$\leq L_{f}(1+L_{\pi})W_{1}(\hat{\mu}_{t,h}\mu_{t,h}).$$ Now, we can combine Claim 5.1 and Claim 5.2 to get $$\|\tilde{f}_{t-1}(s,\tilde{\mu}_{t,h})-f(s,\mu_{t,h})\|_{2}$$ $$\leq\|\tilde{f}_{t-1}(s,\tilde{\mu}_{t,h})-f(s,\tilde{\mu}_{t,h})\|_{2}+\|f(s,\tilde{\mu}_{t,h})-f(s,\mu_{t,h})\|_{2}$$ $$\leq2\beta_{t-1}\|\boldsymbol{\sigma}_{t-1}(s,\pi_{t,h}(s,\tilde{\mu}_{t,h}),\tilde{\mu}_{t,h})\|_{2}+L_{f}(1+L_{\pi})W_{1}(\tilde{\mu}_{t,h},\mu_{t,h}).$$ $$\square$$ $$(27)$$ $$(28)$$ Substituting back Eq. (28) into Eq. (26) at the beginning of Step 1, we obtain: Z s ′∈S v(s ′) Z s∈S hP[ ˜ft−1(s, µ˜t,h) + ˜ωt,h ∈ ds′] − P[f(s, µt,h) + ωt,h ∈ ds′] iµt,h(ds) ≤ Z s ′∈S ˜ft−1(s, µ˜t,h) − f(s, µt,h)2 µt,h(ds) ≤ Lf (1 + Lπ)W1(˜µt,h, µt,h) + 2βt−1 Z s ′∈S ∥σt−1(s, πt,h(s, µ˜t,h), µ˜t,h)∥2 µt,h(ds). (29) Therefore, we obtain an upper bound for Eq. (25). (30) $\binom{31}{2}$ (31) . Step 2: Bounding Eq. (24) Next, we consider the other part, Eq. (24). Again let v be a fixed function such that Lip(v) ≤ 1. We have: Z s ′∈S Z s∈S v(s ′)P[ ˜ft−1(s, µ˜t,h) + ˜ωt,h ∈ ds′](˜µt,h(ds) − µt,h(ds)) = Z s∈S Z s ′∈S v(s ′) P[ ˜ft−1(s, µ˜t,h) + ˜ωt,h ∈ ds′] − P[f(s, µ˜t,h) + ωt,h ∈ ds′] (˜µt,h(ds) − µt,h(ds)) (30) + Z s∈S Z s ′∈S v(s ′)P[f(s, µ˜t,h) + ωt,h ∈ ds′](˜µt,h(ds) − µt,h(ds)). (31) We use Fubini's theorem again to change the order of integration, and we consider the inner integration from Eq. (30): $$\int_{s^{\prime}\in S}v(s^{\prime})\Big{(}\mathbb{P}[\hat{f}_{t-1}(s,\hat{\mu}_{t,h})+\tilde{\omega}_{t,h}\in ds^{\prime}]-\mathbb{P}[f(s,\hat{\mu}_{t,h})+\omega_{t,h}\in ds^{\prime}]\Big{)}$$ $$\leq W_{1}(\hat{f}_{t-1}(s,\hat{\mu}_{t,h})+\tilde{\omega}_{t,h},f(s,\hat{\mu}_{t,h})+\omega_{t,h})$$ $$\leq\big{\|}\,\hat{f}_{t-1}(s,\hat{\mu}_{t,h})-f(s,\hat{\mu}_{t,h})\big{\|}_{2}$$ $$\leq2\beta_{t-1}\|\boldsymbol{\sigma}_{t-1}(s,\pi_{t,h}(s,\hat{\mu}_{t,h}),\hat{\mu}_{t,h})\|_{2}\,.$$ Let g(s) = 1 Lσ (1+Lπ ) ∥σt−1(s, πt,h(s, µ˜t,h), µ˜t,h)∥2 , then note that |g(x) − g(y)| =1 Lσ(1 + Lπ) ∥σt−1(x, πt,h(x, µ˜t,h), µ˜t,h)∥2 − ∥σt−1(y, πt,h(y, µ˜t,h), µ˜t,h)∥2 ≤1 Lσ(1 + Lπ) ∥σt−1(x, πt,h(x, µ˜t,h), µ˜t,h) − σt−1(y, πt,h(y, µ˜t,h), µ˜t,h)∥2 ≤1 1 + Lπ (∥x − y∥2 + ∥π(x, µ˜t,h) − π(y, µ˜t,h)∥2 ) Assumption 4 ≤ ∥x − y∥2 , Assumption 2 where the first inequality follows from the reverse triangle inequality. Therefore, we can bound Eq. (30) as s∈S Z s ′∈S v(s ′) P[ ˜ft−1(s, µ˜t,h) + ˜ωt,h ∈ ds′] − P[f(s, µt,h) + ωt,h ∈ ds′] ! (˜µt,h(ds) − µt,h(ds)) Z ≤ 2βt−1 Z s∈S ∥σt−1(s, πt,h(s, µ˜t,h), µ˜t,h)∥2 (˜µt,h(ds) − µt,h(ds)) = 2βt−1Lσ(1 + Lπ) Z s∈S g(s)(˜µt,h(ds) − µt,h(ds)) ≤ 2βt−1Lσ(1 + Lπ)W1(˜µt,h, µt,h). (32) The last inequality comes from the dual formulation of the Wasserstein-1 distance Eq. (8) and the previously shown fact that g is 1-Lipschitz. $$(32)$$ Next, we consider the remaining term in Eq. (31), namely, $$\int_{s\in\mathcal{S}}\int_{s^{\prime}\in\mathcal{S}}v(s^{\prime})\mathbb{P}[f(s,\hat{\mu}_{t,h})+\omega_{t,h}\in ds^{\prime}](\hat{\mu}_{t,h}(ds)-\mu_{t,h}(ds)).$$ Let $q(s)=\frac{1}{L_{f}(1+L_{\mathbb{T}})}\int_{s^{\prime}\in\mathcal{S}}v(s^{\prime})\mathbb{P}[f(s,\hat{\mu}_{t,h})+\omega_{t,h}\in ds^{\prime}]$, then $$|q(x)-q(y)|=\frac{1}{L_{f}(1+L_{\pi})}\Bigg|\int_{s^{\prime}\in\mathcal{S}}v(s^{\prime})\Big(\mathbb{P}[f(x,\tilde{\mu}_{t,h})+\omega_{t,h}\in d s^{\prime}]$$ $$-\mathbb{P}[f(y,{\tilde{\mu}}_{t,h})+\omega_{t,h}\in d s^{\prime}])\Bigg|$$ $Eq.\ (8)\\ \\ Corollary\ 1\\ \\ Assumption\ 1\\ \\ Assumption\ 2$ Eq. (8) $$\leq\frac{1}{L_{f}(1+L_{\pi})}\left|W_{1}(f(x,\tilde{\mu}_{t,h})+\omega_{t,h},f(y,\tilde{\mu}_{t,h})+\omega_{t,h})\right|$$ $$\leq\frac{1}{L_{f}(1+L_{\pi})}\left\|f(x,\tilde{\mu}_{t,h})-f(y,\tilde{\mu}_{t,h})\right\|_{2}$$ $$\leq\frac{1}{L_{f}(1+L_{\pi})}\Big{(}\left\|x-y\right\|_{2}+\left\|\pi_{t,h}(x,\tilde{\mu}_{t,h})-\pi_{t,h}(y,\tilde{\mu}_{t,h})\right\|_{2}\Big{)}$$ $$\leq\left\|x-y\right\|_{2}.$$ *Assumption* 1 It follows that q is 1-Lipschitz, and therefore $$\begin{array}{l}{{\int_{s\in{\mathcal{S}}}\int_{s^{\prime}\in{\mathcal{S}}}v(s^{\prime})\mathbb{P}[f(s,\mu_{t,h})+\omega_{t,h}\in d s^{\prime}](\tilde{\mu}_{t,h}(d s)-\mu_{t,h}(d s))}}\\ {{=L_{f}(1+L_{\pi})\int_{s\in{\mathcal{S}}}q(s)(\tilde{\mu}_{t,h}(d s)-\mu_{t,h}(d s))}}\\ {{\leq L_{f}(1+L_{\pi})W_{1}(\tilde{\mu}_{t,h},\mu_{t,h})}}\end{array}$$ The first equality follows directly from the definition of the function q, while the last inequality comes from the Wasserstein Dual formulation of W1 in Eq. (8). Combining Step 1 and Step 2: By combining Eq. (29), Eq. (32) and Eq. (33), we get $$W_{1}(\tilde{\mu}_{t,h+1},\mu_{t,h+1})\leq[2L_{f}(1+L_{\pi})+2\beta_{t-1}L_{\sigma}(1+L_{\pi})]W_{1}(\tilde{\mu}_{t,h}\mu_{t,h}))$$ $$+2\beta_{t-1}\int_{s\in{\mathcal{S}}}\|\mathbf{\sigma}_{t-1}(s,\pi_{t,h}(s,\tilde{\mu}_{t,h}),\tilde{\mu}_{t,h})\|_{2}\,\mu_{t,h}(d s).$$ $$(33)$$ Also, note that ∥σt−1(s, πt,h(s, µ˜t,h), µ˜t,h)∥2 = ∥σt−1(s, πt,h(s, µ˜t,h), µ˜t,h) − σt−1(s, πt,h(s, µt,h), µt,h) + σt−1(s, πt,h(s, µt,h), µt,h)∥2 ≤ Lσ(∥πt,h(s, µ˜t,h) − πt,h(s, µt,h)∥2 + W1(˜µt,h, µt,h)) + ∥σt−1(s, πt,h(s, µt,h), µt,h)∥2 ≤ Lσ(1 + Lπ)W1(˜µt,h, µt,h) + ∥σt−1(s, πt,h(s, µt,h), µt,h)∥2 , where the first inequality comes from Assumption 4 and the second from Assumption 2. Therefore, we have the following upper-bound on W1(˜µt,h+1, µt,h+1): $$W_{1}(\tilde{\mu}_{t,h+1},\mu_{t,h+1})\leq2(1+L_{\pi})\left[L_{f}+2\beta_{t-1}L_{\sigma}\right]W_{1}(\tilde{\mu}_{t,h}\mu_{t,h})$$ $$+2\beta_{t-1}\int_{s\in\mathcal{S}}\left\|\mathbf{\sigma}_{t-1}(s,\pi_{t,h}(s,\mu_{t,h}),\mu_{t,h})\right\|_{2}\mu_{t,h}(ds).$$ The above inequality establishes the relationship between W1(˜µt,h+1, µt,h+1) and W1(˜µt,h, µt,h). We use the fact that W1(˜µt,0, µt,0) = 0 and apply this relationship repeatedly h − 1 times to derive the following upper bound for W1(˜µt,h, µt,h): W1(˜µt,h, µt,h) ≤ 2βt−1 h X−1 i=0 [2(1 + Lπ) [Lf + 2βt−1Lσ]]h−1−iZ s∈S ∥σt−1(s, πt,i(s, µt,i), µt,i)∥2 µt,i(ds) ≤ 2βt−1 h X−1 i=0 h1 + 2(1 + Lπ) [Lf + 2βt−1Lσ] | {z } =:Lt−1 ih−1−iZ s∈S ∥σt−1(s, πt,i(s, µt,i), µt,i)∥2 µt,i(ds) ≤ 2βt−1L h−1 t−1 h X−1 i=0 Z s∈S ∥σt−1(s, πt,i(s, µt,i), µt,i)∥2 µt,i(ds). Remark 4. Consider the setting of Lemma 5. Note that {µt,i} h−1 i=0 is the trajectory of state distributions i.e. P[st,i ∈ A] = µt,i(A) for all A ⊆ S *as shown in Lemma 1. Therefore,* $$\sum_{i=0}^{h-1}\int_{s\in\mathcal{S}}\left\|\boldsymbol{\sigma}_{t-1}(s,\pi_{t,i}(s,\mu_{t,i}),\mu_{t,i})\right\|_{2}\mu_{t,i}(d s)=\sum_{i=0}^{h-1}\mathbb{E}\left[\left\|\boldsymbol{\sigma}_{t-1}(z_{t,i})\right\|_{2}\right]$$ $$=\mathbb{E}\left[\sum_{i=0}^{h-1}\left\|\boldsymbol{\sigma}_{t-1}(z_{t,i})\right\|_{2}\right],$$ where zt,i = (st,i, πt,i(st,i, µt,i), µt,i) and the expectation is taken over the initial distribution and the transition stochasticity. The first equality comes from the aforementioned fact, P[st,i ∈ A] = µt,i(A)*, while the* second equality comes from the linearity of expectation. Therefore, $$W_{1}(\tilde{\mu}_{t,h},\mu_{t,h})\leq2\beta_{t-1}\overline{L}_{t-1}^{h-1}\mathbb{E}\left[\sum_{i=0}^{h-1}\|\mathbf{\sigma}_{t-1}(z_{t,i})\|_{2}\right].\tag{34}$$ Lemma 6. *Under the setting of Lemma 5 and assuming that the event in Assumption 3 holds true,* $$r_{t}\leq4\beta_{t-1}L_{r}(1+L_{\pi})\overline{{{L}}}_{t-1}^{H-1}H\mathbb{E}\left[\sum_{h=0}^{H-1}\left\|\mathbf{\sigma}_{t-1}(z_{t,h})\right\|_{2}\right].$$ Proof. First, note that under the setting of Lemma 6, Lemmas 3 to 5 also hold. $$r_{t}\leq\|\bar{\mathbb{J}}(\boldsymbol{\pi}_{t},\bar{f}_{t-1})-\mathbb{J}(\boldsymbol{\pi}_{t})|$$ $$\leq2L_{r}(1+L_{\pi})\sum_{h=1}^{H-1}W_{1}(\bar{\mu}_{t,h},\mu_{t,h})$$ $$\leq4\beta_{t-1}L_{r}(1+L_{\pi})\sum_{h=1}^{H-1}\overline{L}_{t-1}^{h-1}\mathbb{E}\left[\sum_{i=0}^{h-1}\|\boldsymbol{\sigma}_{t-1}(z_{t,i})\|_{2}\right]$$ $$\leq4\beta_{t-1}L_{r}(1+L_{\pi})\overline{L}_{t-1}^{H-1}H\mathbb{E}\left[\sum_{i=0}^{H-1}\|\boldsymbol{\sigma}_{t-1}(z_{t,i})\|_{2}\right].$$ $Eq.\ (17)\\ \\ \\ Eq.\ (18)\\ \\ \\ Eq.\ (34)\\$ . In the last inequality, we used the fact that Lt−1 ≥ 1 hence L H−1 t−1 ≥ L h−1 t−1 . Furthermore, ∥σt−1(zt,i)∥2 ≥ 0 for any input combination, hence PH−1 i=0 ∥σt−1(zt,i)∥2 ≥Ph−1 i=0 ∥σt−1(zt,i)∥2 . Now, we are ready to prove Theorem 1. Proof of Theorem 1. t=1 rt !2 R 2 T = X T ≤ T X T t=1 r 2 t Cauchy-Schwartz ineq. t=1 16pβ2T −1L 2 r (1 + Lπ) 2L 2H−2 T −1 H2E "HX−1 i=0 ∥σt−1(zt,i)∥2 #2 ≤ T X T t=1 E "HX−1 i=0 ∥σt−1(zt,i)∥2 #2 ≤ 16pT β2T −1L 2 r (1 + Lπ) 2L 2H−2 T −1 H2X T ≤ 16pT β2T −1L 2 r (1 + Lπ) 2L 2H−2 T −1 H3E "X T t=1 H X−1 i=0 ∥σt−1(zt,i)∥ 2 2 # ≤ 16pT β2T −1L 2 r (1 + Lπ) 2L 2H−2 T −1 H3IT . $$L e m m a\ 6$$ $\text{Cauchy-}$ . Jensen's in$\mathrm{eq}$... The expectations in the expressions above are taken over the initial state and transition noises. For the second inequality, we used that βt−1 is non-decreasing in t by Assumption 3 while the last inequality follows from PT t=1 PH−1 i=0 ∥σt−1(zt,i)∥ 2 2 ≤ IT for all zt,i ∈ Z for t = 1*, . . . , T* and i = 0*, . . . , H* − 1. Taking square root of both sides yields the desired result. ## C Gaussian Processes In this section, we specialize our main theorem, Theorem 1, to Gaussian Process models. ## C.1 Gaussian Process The main step of relating Theorem 1 to the Gaussian Process models is to use a Gaussian Process to approximate the unknown dynamics function f. In particular, we select a GP with prior GP(0, k) where k is a positive semi-definite kernel on Z × [p] where [p] = {1*, . . . , p*} and i ∈ [p] specifies the index of the output dimension. The posterior of this Gaussian Process is calculated under the assumption that the observed noise, ξi,h = si,h+1 − f(zi,h), is drawn independently from N (0, λIp) for all i and h. Here λ is a free-parameter that does not necessarily depend on the distribution of ωt,h for any t and h. Then, at the beginning of episode t, the posterior mean and variance functions conditioned on D1 *∪ · · · ∪ D*t−1 obtain a closed-form solution (Rasmussen, 2003): $$\begin{array}{l}{{m_{t-1}(z,j)=\mathbf{k}_{t-1}(z,j)^{\intercal}(\mathbf{K}_{t-1}+\lambda\mathbf{I}_{t-1})^{-1}\mathbf{y}_{t-1},}}\\ {{\sigma_{t-1}^{2}(z,j)=k((z,j),(z,j))-\mathbf{k}_{t-1}(z,j)^{\intercal}(\mathbf{K}_{t-1}+\lambda\mathbf{I}_{t-1})^{-1}\mathbf{k}_{t-1}(z,j),}}\end{array}$$ where It−1 ∈ R (t−1)Hp×(t−1)Hp is the identity matrix and $${\boldsymbol{y}}_{t-1}=\left[\left[s_{i,h}\right]_{t}\right]_{i,h,l=1}^{t-1,H,p}\in\mathbb{R}^{(t-1)H p},$$ $$\boldsymbol{k}_{t-1}(z)=\big{[}k\big{(}(z,j),(z_{i,h},l)\big{)}\big{]}_{i,h,l=1}^{t-1,H,p}\in\mathbb{R}^{(t-1)Hp},$$ $$\boldsymbol{K}_{t-1}=\big{[}k\big{(}(z_{i,h},l),\big{(}z_{i^{\prime},h^{\prime}},l^{\prime})\big{)}\big{]}_{i,h,l,i^{\prime},h^{\prime},l^{\prime}=1}^{t-1,H,p}\in\mathbb{R}^{(t-1)Hp\times(t-1)Hp},$$ is the $l$-th element of the vector $\boldsymbol{\varepsilon}_{t-1}$. We use the following notation: where [si,h]l denotes the l-th element of the vector si,h. We use the following notation for the mean and variance vectors mt−1(z) := [mt−1(z, 1), . . . ,mt−1(*z, p*)] and σ 2 t−1 (z) := [σ 2 t−1 (z, 1)*, . . . ,*σ 2 t−1 (*z, p*)] for all z in Z. In particular, we choose λ = pH. $$(35\mathrm{a})$$ $$(35\mathrm{b})$$ ## C.2 Assumptions And Relevant Results We make the following assumptions on the semi-definite kernel k and the true dynamics f of the system. Assumption 5. The unknown function f *belongs to the Reproducing Kernel Hilbert Space (RKHS) of a* positive semi-definite kernel k : (Z × [p]) × (Z × [p]) → R*, and has bounded RKHS norm, i.e.,* ∥f∥ p k = ⟨f, f⟩k ≤ Bf where ⟨·, ·⟩k is the inner product of the RKHS and Bf *is a fixed known positive constant.* Furthermore, we assume that ωt,h is σ-sub-Gaussian for all t and h. This assumption is standard when Gaussian Process models are used (e.g., Srinivas et al. (2010); Chowdhury & Gopalan (2019); Curi et al. (2020)). Assumption 6. The positive semi-definite kernel k is symmetric, continuously differentiable with bounded derivative, and k(z, z) ≤ 1, ∀z ∈ Z. We define the kernel metric as dk(*z, z*′) = pk(*z, z*) + k(z ′, z′) − 2k(*z, z*′) and assume that it is Lipschitz-continuous, i.e., dk(z, z′) ≤ Ldd(z, z′) where d(*z, z*′) := ∥s − s ′∥2+∥a − a ′∥2+ W1(µ, µ′) and Ld *is some positive constant.* We note that the previous assumption is very mild since it holds for the most commonly used kernel functions. Assumption 5 and Assumption 6 also imply Assumption 1 which states that the unknown function f is Lipschitz-continuous, i.e., ∥f(z) − f(z ′)∥2 ≤ Lf d(*z, z*′) where Lf is a positive constant (see Corollary 4.36 in Steinwart & Andreas (2008)). First, we show that under Assumption 5 the Gaussian Process conditioned on D1 *∪ · · · ∪ D*t is calibrated for all t ≥ 1. Our argument follows from the following lemma: Lemma 7 (Concentration of an RKHS member, Lemma 5 in Chowdhury & Gopalan (2019) ). Let k : X × X → R be a symmetric, positive semi-definite kernel and f : X → R *be a member of the RKHS* Hk(X ) of real-valued functions on X with kernel k. Let {xt}t≥1 and {ϵt}t≥1 is conditionally R-sub-Gaussian for a positive constant R*, i.e.,* $$\forall t\geq0,\forall\lambda\in\mathbb{R},\mathbb{E}\left[e^{\lambda\epsilon_{t}}|{\mathcal{F}}_{t-1}\right]\leq\exp\left({\frac{\lambda^{2}R^{2}}{2}}\right),$$ where Ft−1 is the σ-algebra generated by {xs, ϵs} t−1 s=1 and xt. Let {yt}t≥1 *be a sequence of noisy observations* at the query points {xt}t≥1*, where* yt = f(xt) + ϵt. For λ > 0 and x ∈ X *, let* $$\begin{array}{l}{{\mu_{t-1}(x):=k_{t-1}(x)^{\mathsf{T}}(K_{t-1}+\lambda I)^{-1}Y_{t-1},}}\\ {{\sigma_{t-1}^{2}(x):=k(x,x)-k_{t-1}(x)^{\mathsf{T}}(K_{t-1}+\lambda I)^{-1}k_{t-1}(x),}}\end{array}$$ where Yt−1 := [y1*, . . . , y*t−1] ⊺ denotes the vector of observations at {x1, . . . , xt−1}. Then, for any 0 < δ ≤ 1, with probability at least 1 − δ, uniformly over t ≥ 1, x ∈ X , $$|f(x)-\mu_{t-1}(x)|\leq\left(\|f\|_{k}+\frac{R}{\sqrt{\lambda}}\sqrt{2\bigg{(}\log(1/\delta)+\frac{1}{2}\sum_{s=1}^{t-1}\log(1+\lambda^{-1}\sigma_{t-1}^{2}(x_{s}))\bigg{)}}\right)\sigma_{t-1}(x).$$ We note that similar results have been shown independently in Durand et al. (2018). Before showing that the above specified Gaussian Process is calibrated, we define the maximum mutual information, γt, to measure the maximum information gain the representative agent could possibly obtain on f by observing any set A *⊂ Z ×* [p] of size t. Definition 2 (Maximum Mutual Information). Let f : X → R *be a real-valued function defined on a domain* X , and t a positive integer. For each subset A ⊂ X , let yA denote a noisy version of fA with P[yA|fA]*. The* Maximum Mutual Information after t *noisy observations is defined as* $$\gamma_{t}(f,{\mathcal{X}}):=\operatorname*{max}_{A\subset{\mathcal{X}}:|A|=t}I(f_{A};y_{A}),$$ where I(fA; yA) denotes the mutual information between fA and yA. Using the Maximum Mutual Information, the following corollary shows that the Gaussian Process satisfies Assumption 3 under Assumption 5 and Assumption 6. Corollary 4. Under Assumption 5 and Assumption 6, with probability 1 − δ for all t ≥ 0 and z ∈ Z $$(37)$$ $$\|f(z)-m_{t}(z)\|_{2}\leq\beta_{t}\,\|\sigma_{t}(z)\|_{2}\,,$$ , (37) where $$\beta_{t}=B_{f}+\frac{\sigma}{\sqrt{\lambda}}\sqrt{2(\log(1/\delta)+\gamma_{p t H}(k,\mathcal{Z}\times[p]))}.$$ Proof. This corollary follows from Lemma 10 in Chowdhury & Gopalan (2019). Additionally, the GP also satisfies Assumption 4 under Assumption 5 and Assumption 6. Lemma 8 follows from Lemma 12 from Curi et al. (2020) Lemma 8. For all z and z ′in Z and all t ≥ 0*, we have* $$\square$$ $$\|\sigma_{t}(z)-\sigma_{t}(z^{\prime})\|_{2}\leq d_{k}(z,z^{\prime})$$ where dk *is the kernel metric defined in Assumption 6.* We note that Lemma 8 and Assumption 6 immediately imply that σt satisfies Assumption 4 with Lipschitz constant Ld for all t ≥ 0. ## C.3 Regret Bound Now, we are ready to show the regret bound under the choice of a Gaussian Process model. First, we recall a partial result in Eq. (39) from Lemma 11 in Chowdhury & Gopalan (2019) stating that under Assumption 5 and Assumption 6 $$\sum_{t=1}^{T}\sum_{z\in D_{1}\cup\cdots\cup D_{t-1}}\|\sigma_{t-1}(z)\|_{2}^{2}\leq2e p H\gamma_{p H T}(k,{\mathcal{Z}}\times[p])$$ where D˜t is an arbitrary observation sets during episode t for t = 1, 2, 3*, . . .* . Theorem 2. Let LT −1 = 1 + 2(1 + Lπ) [Lf + 2βT −1Lσ], and let µt,h ∈ P(S) for all t, h > 0*. Then, under* Assumption 2, Assumption 5, and Assumption 6 and using a Gaussian Process as described in Appendix C.1, for all T ≥ 1 and fixed constant H > 0, with probability at least 1 − δ, the regret of M3*–UCRL is at most:* $$R_{T}\leq\mathcal{O}\Bigg(\beta_{T-1}L_{r}(1+L_{\pi})\overline{{{L}}}_{T-1}^{H-1}H^{2}\sqrt{T\gamma_{p H T}(k,\mathcal{Z}\times[p])}\Bigg).$$ Proof. As noted before, Assumption 5 and Assumption 6 imply Assumption 1, Assumption 3, and Assumption 4, hence, by Theorem 1, with probability at least 1 − δ $$R_{T}=\mathcal{O}\Big{(}\beta_{T}L_{r}(1+L_{\pi})\overline{L}_{T-1}^{H-1}\sqrt{H^{3}T\!I_{T}}\Big{)}$$ $$=\mathcal{O}\Bigg{(}\beta_{T}L_{r}(1+L_{\pi})\overline{L}_{T-1}^{H-1}\sqrt{H^{3}T\max_{D_{1},\ldots,D_{T}}\sum_{t=1}^{T}\sum_{z\in\tilde{D}_{1}\cup\cdots\cup\tilde{D}_{t}}\|\boldsymbol{\sigma}_{t-1}(z)\|_{2}^{2}}\Bigg{)},$$ $$(38)$$ $$(39)$$ where Lt−1 = 1 + 2(1 + Lπ) [Lf + 2βt−1Lσ]. Then we can substitute in Eq. (38) to reach the desired result. Theorem 2 shows that the sublinearity of our regret depends on the Maximum Mutual Information rates, in particular, for sublinear MMI rate the regret is sublinear. Srinivas et al. (2010) consider the most commonly used kernels, and obtain the following sublinear rates for D ⊂ R d: Linear kernels γt(*f, D*) = O(d log t), Squared Exponential kernels γt(*f, D*) = O((log t) d+1), and Matérn kernels γt(*f, D*) = O(t d(d+1)/(2α+d(d+1))(log t)) with α > 1. Furthermore, Krause & Ong (2011) show the sublinear property of specific composite kernels. We note that this line of work provides large freedom for kernel design on Euclidean spaces, however, the state space in our problem includes the mean-field distribution space P(S), therefore, the results are not readily applicable. Proving similar bounds on probability measure spaces is a promising direction for future works. ## D Experiment Implementation D.1 Hallucinated Control Implementation In Section 3, we introduced M3–UCRL, an algorithm that optimizes over the set of plausible dynamics Ft−1 and admissible policies Π (see Eq. (5)). However, as noted in the paper, optimizing over Ft−1 is intractable in most of the cases. In this sections, we describe a practical and equivalent reformulation of Eq. (5) that helps parametrizing the problem and enables using gradient based optimization to find πt at every episode t. First, we introduce an auxiliary function η : Z → [−1, 1]p(as in Moldovan et al. (2015); Curi et al. (2020)) where p is the dimensionality of the state space S and define the following hypothetical dynamics model: $$\tilde{f}_{t-1}(z)=\mathbf{m}_{t-1}(z)+\beta_{t-1}\mathbf{\Sigma}_{t-1}(z)\eta(z).$$ ˜ft−1(z) = mt−1(z) + βt−1Σt−1(z)η(z). (40) Conditioned on the event from Assumption 3 holding true, ˜ft−1 for any η is calibrated, i.e., ˜ft−1 ∈ Ft−1. Furthermore, by the confidence interval in Assumption 3, every function in Ft−1 can be written in the form of Eq. (40), i.e., $\forall f_{t-1}\in{\cal F}_{t-1},\quad\exists\eta:{\cal Z}\to[-1,1]^{p}\quad\mbox{such that}\quad\hat{f}_{t-1}(z)={\mathbf{m}}_{t-1}(z)+\beta_{t-1}{\mathbf{\Sigma}}_{t-1}(z)\eta(z)\quad\forall z\in{\cal Z}.$ Therefore, we can reformulate Eq. (5) as an optimization over the set of admissible policies Π and auxiliary function η : Z → [−1, 1]p as πt = arg max π∈Π max η:Z→[−1,1]p E "HX−1 h=0 r(˜st,h, a˜t,h, µ˜t,h) # s.t. a˜t,h = πt,h(˜st,h, µ˜t,h), z˜t,h = (˜zt,h), (41b) ˜ft−1(˜zt,h) = mt−1(˜zt,h) + βt−1Σt−1(˜zt,h)η(˜zt,h), (41c) s˜t,h+1 = ˜ft−1(˜zt,h) + ˜ωt,h, (41d) µ˜t,h+1 = Φ(˜µt,h, πt,h, ˜ft−1). (41e) $$(40)$$ (41b) (41c) (41d) $\underline{}$ $$(41\mathrm{a})$$ We note that for a fixed policy π, the auxiliary function η(·) can be rewritten as η(*s, a, µ*) = η(s, π(*s, µ*), µ) = η(*s, µ*). In essence, this turns the function η(·) into an additional policy that exerts "hallucinated" control over the set of plausible models F (Curi et al., 2020).3 Taking expectation in Eq. (41a) still hinders the practicality of the algorithm, however, we note that Corollary 3 applies to Eq. (41) and the following optimization problem is equivalent, $$\pi_{t}=\operatorname*{arg\,max}_{\pi\in\Pi}\max_{\eta\in\Pi}\max_{\pi_{t}\geq t-[1,1]^{p}}\sum_{h=0}^{H-1}\hat{r}(\bar{\mu}_{h},\pi_{t,h})$$ (42a) s.t. $$\tilde{f}_{t-1}(\tilde{z}_{t,h})=\boldsymbol{m}_{t-1}(\tilde{z}_{t,h})+\beta_{t-1}\boldsymbol{\Sigma}_{t-1}(\tilde{z}_{t,h})\eta(\tilde{z}_{t,h}),\tag{42b}$$ $$\tilde{\mu}_{t,h+1}=\Phi(\tilde{\mu}_{t,h},\pi_{t,h},\tilde{f}_{t-1})\tag{42c}$$ 3We remark that the introduction of η(·) policy is a simple trick used before in Moldovan et al. (2015) and Curi et al. (2020) that is suitable for practical implementation of model-based reinforcement learning algortihms. where Φ is defined in Eq. (2) and rˆ is defined in Eq. (14) as $$\hat{r}(\mu,\pi)=\int_{\mathcal{S}}\mu(d s)r(s,\pi(s,\mu),\mu).$$ Reformulating the optimization problem as in Eq. (42) and choosing parametrizable functions, e.g., Neural Networks, for π, η, and the statistical estimators mt−1 and Σt−1 allow using gradient ascent to find an optima for Eq. (42a). Even though running gradient ascent does not guarantee the discovery of global optimum, we found in our experiments (see in Section 5) that it still provides a close approximation. We provide further details on the implementation of the transition function Φ in Appendix D.2 ## D.2 Transition Function Implementation The main challenges of implementing the mean-field distribution function Φ from Eq. (2) are representing the mean-field distributions and taking the integral over the state space S. For our experiments, we discretize the state-space S with 104 unit-sized cells. We denote these cells by Cij for i, j ∈ {0*, . . . ,* 10} where Cij denotes the cell [*i, i* + 1) × [*j, j* + 1). Note that cells corresponding to walls (see Fig. 1a), e.g., C5,0, C5,1, or C55, are not part of the state-space. For each episode t and time-step h, the *i, j* entry of µt,h represents the probability that the representative agent lies in that cell, i.e., [µt,h]i,j = P[st,h ∈ [*i, i* + 1) × [*j, j* + 1)]. Furthermore, we denote the middle of each cell Ci,j by ci,j , i.e., ci,j = (i + 0.5, j + 0.5). The transition function Φ is then implemented as follows, for every i, j ∈ {0*, . . . ,* 10} (for which Cij does not correspond to a wall), every episode t = 1, 2*, . . .* , and every time-step h = 0*, . . . ,* 19 $$[\mu_{t,h+1}]_{i,j}=\sum_{k,l}\mathbb{P}[f(c_{k,l},\pi_{t,h}(c_{k,l},\mu_{t,h}),\mu_{t,h})+\omega_{t,h}\in C_{i,j}][\mu_{t,h}]_{k,l}$$ We assume that the noise term ωt,h is Gaussian with 0 mean and σ 2 variance and the two dimensions are independent, therefore, $\mathbb{P}[f(c_{k,l},\pi_{t,h}(c_{k,l},\mu_{t,h}),\mu_{t,h})+\omega_{t,h}\in C_{i,j}]$ $=\mathbb{P}[f(c_{k,l},\pi_{t,h}(c_{k,l},\mu_{t,h}),\mu_{t,h})_{1}+\omega_{t,h},_{1}\in\mathbb{P}]$ $=(\phi(i-f(c_{k,l},\pi_{t,h}(c_{k,l},\mu_{t,h}),\mu_{t,h})_{1})-\phi)$ × (ϕ(j − f(ck,l, πt,h(ck,l, µt,h), µt,h)2) − ϕ(j + 1 − f(ck,l, πt,h(ck,l, µt,h), µt,h)2)) = P[f(ck,l, πt,h(ck,l, µt,h), µt,h)1 + ωt,h,1 ∈ [i, i + 1)] × P[f(ck,l, πt,h(ck,l, µt,h), µt,h)2 + ωt,h,2 ∈ [j, j + 1)] = (ϕ(i − f(ck,l, πt,h(ck,l, µt,h), µt,h)1) − ϕ(i + 1 − f(ck,l, πt,h(ck,l, µt,h), µt,h)1)) where ϕ is the cumulative distribution function of N(0,σ 2). In the implementation, we also redistribute some of the probability mass during transition based on the walls location. If there is a wall between Ci,j and f(ck,l, πt,h(ck,l, µt,h), µt,h) + ωt,h, we set P[f(ck,l, πt,h(ck,l, µt,h), µt,h) + ωt,h ∈ Ci,j ] = 0. Similarly, for Ci,j adjacent to a wall or border we increase P[f(ck,l, πt,h(ck,l, µt,h), µt,h) + ωt,h ∈ Ci,j ] by the amount that is set to zero due to the adjacent wall. ## D.3 Transition Model Estimation To estimate the unknown transition function f in Section 5, we use deep ensemble models (Lakshminarayanan et al., 2017). In particular, we use an ensemble of 10 feed-forward Neural Networks (NNs) with one hidden layer of size 32 and leaky ReLu action functions. We use two output layers joined to the hidden middle layer. The first one uses linear activation and returns the mean of the function while the second returns the estimated variance using softplus activation. We follow the optimisation procedure described in (Lakshminarayanan et al., 2017) that minimizes the negative log-likelihood for each NN under the assumption of heteroscedastic Gaussian noise. We included the adversarial training procedure as well for robustness and smoothing. In prediction time, the ensemble estimates the mean and variance of the unknown function via the empirical mean and variance of the Neural Networks' mean outputs. ![30_image_0.png](30_image_0.png) ![30_image_1.png](30_image_1.png) ![30_image_2.png](30_image_2.png) (a) Mean-field distribution under the BPTT optimised pol- (b) Mean-field distribution under the BPTT optimised policy at time-step h = 3. ![30_image_4.png](30_image_4.png) icy at time-step h = 5. ![30_image_3.png](30_image_3.png) ![30_image_5.png](30_image_5.png) (c) Mean-field distribution under the BPTT optimised pol- (d) Mean-field distribution under the BPTT optimised policy at time-step h = 8. icy at time-step h = 20. Figure 3: Mean-field distribution following the policy optimised via BPTT at four time-steps (h = 3, 5, 8, 20) in a single policy roll-out. Arrows depict the actions taken by the agents in the corresponding squares. Note that the coloring range changes with the time-steps. ## D.4 Policy Optimisation With Known Environment We consider the policy optimised via back-propagation through time, \#BPTT, as a reasonable point-ofreference for our convergence analysis as it successfully disperses the population in the state space quickly without any notable improvements in its strategy. Fig. 3 shows the mean-field distribution over one episode following 7 BPTT 4. As shown on Fig. 3a, in the first few steps TBPTT spreads the distribution evenly in the bottom-left corner, however, in the next two steps as shown on Fig. 3b it concentrates a larger mass into the corridors to the neighbouring rooms. It is an optimal choice of action because the corridors act as bottlenecks hence the more it can push through at once the easier it will be to achieve a uniform distribution in the latter time-steps. In the next 3 steps until h = 8, nBPTT further propagates a larger portion of the population mass to the empty top-right room. In the meanwhile, it starts to distribute the population in the top-left and bottom-right rooms as well. In the following time-steps, nBPTT focuses on achieving an even distribution within the rooms without pushing 4The supplementary material includes animation of the whole episode named as known_dynamics_animation.mp4 ![31_image_0.png](31_image_0.png) Figure 4: Reward and population action size per time-step in one episode. The policy followed by the agents were optimised via BPTT. ![31_image_1.png](31_image_1.png) Figure 5: Rewards achieved by U2-MF-QL-FH over 10 million training episodes. Training Rewards show the estimated reward by U2-MF-QL-FH while Evaluation Rewards show the performance of the greedy policy in a roll-out. The policy is evaluated after every million training episodes. The hyperparameters of the training were w = 0.7, w' = 0.05 and € = 0.15. significant population mass through the corridors. Finally, Fig. 3d shows the mean-field distribution at the end of the episode, h = 20, when the population is distributed uniformly and maximized its entropy. We provide a further animation with every time-steps as part of the supplementary material. Fig. 4 shows the mean-field distribution entropy over the time-steps of the same episode as in Fig. 3. ㅠBPTT successfully increases the entropy until time-step 14 where it reaches the maximum achievable by the uniform distribution and then maintains this level. The small stagnation in entropy from h = 4 to h = 5 is due to the bottleneck of the corridors as shown on Fig. 3b. ## E Additional Experiments E.1 Comparison To Model-Free Reinforcement Learning M3–UCRL is a unique algorithm in the Mean-Field Control literature because it considers continuous state and action spaces and finite time-horizon. As described in Section 2, the goal in this setting is to find an optimal policy that considers the evolution of the mean-field distribution over one episode for a fixed initial distribution. In comparison, the majority of the works consider finite spaces and infinite time-horizon in which the goal is to find the optimal stationary pair of policy and mean-field distribution. We note that this is a significantly different solution concept to ours, hence, proposed algorithms are not suitable to solve the exploration via entropy maximization problem described in Section 5. To the best of our knowledge, the only algorithm that considers a finite time-horizon problem is the *U2-MF-QL-FH* proposed by Angiuli et al. (2021). This algorithm is a Q-Learning variant that optimises the Q values via a two timescale approach. Even though, the problem formulation for *U2-MF-QL-FH* is similar to ours described in Section 2, there are notable differences. First, *U2-MF-QL-FH* is proposed for finite state and action spaces, uses a tabular representation for the Q values and select deterministic actions. Second, it is model-free and assumes access to simulator of one-step transitions. On the other hand, M3–UCRL does not rely on a tabular representation, learns in continuous spaces, and have limited interactions with the environment to reduce costs associated with these interactions. Due to the formulation of *U2-MF-QL-FH*, we ran experiments in the finite state and action space variant of the Exploration via entropy maximization problem as described in Geist et al. (2021); Laurière et al. (2022). As we demonstrate below, the deterministic policy used by *U2-MF-QL-FH* is a significant limitation, therefore, we also alter its action space to be a set of 9 distributions over the 5 potential actions from which U2-MF-QL-FH chooses 5. We call the former *Standard* formulation and the latter *Extended*. As shown on Fig. 5, *U2-MF-QL-FH* converges slowly with high variance in rewards for both formulations, however, the *Extended* version outperforms the *Standard* version for both training and evaluation performance as expected. One of the main factors for slow learning is that the Q values are hard to estimate due to the large number of state-action-time pairs and infrequent visits of many states. In particular, the Q value table has *|S| × |A| ×* H = 104 × 5 × 20 = 10, 400 entries (18, 720 for the *Extended* version), and states far from the bottom left corner are rarely visited because they can be reached only in the later steps of an episode. While extending the action-space to non-deterministic actions clearly improves performance, it increases significantly the tabular representation leading to even longer training required. Even after 10 million episodes, we observed large changes in the Q value table indicating that the algorithm would need further iterations, but we had to terminate it due to computational limits. These results further highlights the contribution of M3–UCRL to the literature. ## E.2 Swarm Motion Experiments To complement experiments in Section 5, we also implemented M3–UCRL with Gaussian Process models for the *swarm motion* problem. This setting considers an asymptotically large (N → ∞) population of agents moving around in a space, maximizing a location-dependent reward function, and avoiding congested areas (Almulla et al., 2017). We choose the state space S as the [0, 1] interval with periodic boundary conditions, i.e., the unit torus, and the action space A as the compact interval [−7, 7]. Each episode partitions the unit time length into H = 200 equal steps of length ∆h = 1/200. The unknown dynamics of the system is given by $$f(s,a)=s+a\Delta h,$$ f(*s, a*) = s + a∆h, (43) and ωt,h ∼ N(0, ∆h) for all t and h. We note that, for now, the dynamics do not depend on the mean-field distribution, but later on in Eq. (45), we also consider such a case. The reward function is of the form 5The set of distribution consists of the following: 5 deterministic actions (4 directions plus staying idle), 4 50% − 50% split between adjacent moves (up-right, right-down, down-left, left-up) and 1 distribution that assigns 25% to all 4 directions. Note that the action space of the *Standard* formulation is a subset of this action space, therefore, it is expected that the *Extended* version achieves better performance. $\left(43\right)^{2}$ ![33_image_0.png](33_image_0.png) Figure 6: Results for dynamics model: **(Left column)** f(*s, a*) = s+a∆h , and **(Right column)** f(*s, a, µ*) = s + a(4 − 4µ(s))∆h. (π ∗ C , µ∗C ) represent an analytic solution to the continuous time swarm motion problem, and thus, it is not discrete-time optimal. The main discrete-time benchmark is Known Dynamics that unlike our M3–UCRL knows the true dynamics. In both cases (left and right), M3–UCRL converges in a small number of episodes and discovers a near-optimal policy. r(*s, a, µ*) = φ(s) − 1 2 |a| − ln(µ(s)), where the second term penalizes large actions, the third term introduces the aversion to crowded regions and the first term defines the reward received at the position s, namely, φ(s) = −2π 2[− sin(2πs) + | cos(2πs)| 2] + 2 sin(2πs). The advantage of this task is that one can analytically obtain the following optimal solution in the *continuoustime* setting when ∆h → 0 and the time horizon is infinite, i.e., H → ∞ Almulla et al. (2017): $$\pi_{C}^{*}(s,\mu)=2\pi\cos(2\pi s),$$ $$\mu_{C}^{*}(s)=\frac{\exp(2\sin(2\pi s)}{\int\exp(2\sin(2\pi s^{\prime}))d s^{\prime}},$$ $$(44)$$ where π ∗ C and µ ∗ C form an ergodic solution, i.e., µ ∗ C = Φ(µ ∗ C , π∗C , f). We use the continuous time optimal solutions from Eq. (44) (where the subscript C stands for continuous-time solutions) as a benchmark for comparison, however, we note that our time discretization introduces certain deviations. Consequently, π ∗ C might no longer be optimal, and so we also compare our solution to the one obtained under the same setup of discrete time steps and optimization procedure when the true dynamics are *known* (Known Dynamics). This corresponds to our main benchmark. ![34_image_0.png](34_image_0.png) $$(45)$$ Figure 7: Mean-Field distributions over one episode with different initial distributions and dynamics given by Eq. (43) after training has converged. (**Left side**) µ0 ∼ N (0.5, 0.04) (**Right side**) µ0 ∼ U(0, 1). Already at h = 16, the distribution induced by M3–UCRL policy nearly-matches the one when dynamics are known. Finally, we also consider the modified swarm motion problem with dynamics given by $$f(s,a,\mu)=s+a(4-4\mu(s))\Delta h.$$ f(*s, a, µ*) = s + a(4 − 4µ(s))∆h. (45) The additional term that depends on the mean-field distribution models the effect of congestion on the transition. Specifically, in comparison to Eq. (43), the more congested an area is, the larger the action an agent must exert to achieve the same movement. While swarm motion resembles the exploration via entropy maximization problem in Section 5, there are meaningful differences besides the lower dimensional state and action spaces. Namely, certain areas in the state space rewarded differently and large actions are explicitly penalized, therefore, agents not only have to explore the state space but also learn the trade-off between areas and actions. Eq. (45) further extends the swarm motion problem with a dependency on the mean-field distribution that increases the complexity of the agent's learning problem. Fig. 6 depicts the results when the true dynamics are given by Eq. (43) (Left column) and Eq. (45) (Right column). In Fig. 6a (Left), we show the rewards achieved over 20 episodes. In Fig. 6b (Left) and Fig. 6c (Left), we show the ergodic solution of M3–UCRL and compare it with (π ∗ C , µ∗C ) and the solution found when dynamics are known. As expected, the introduced time-discretization results in some deviations from Eq. (44) which allow the policy found when the dynamics are known to exploit them and achieve higher reward. On the other hand, M3–UCRL converges in a small number of episodes and drives the environment into an ergodic state with policy and mean-field distribution almost identical to the solution under known dynamics (see Fig. 6b (Left) and Fig. 6c (Left)) . We note that, while minimal fluctuations in the episodic rewards are present, the M3–UCRL is robust in finding close to optimal solutions. In Fig. 6 (Right column), we show the results obtained for the dynamics from Eq. (45). Even though π ∗ and µ ∗in Eq. (44) are no longer applicable for this problem, we include them in the figures to show the effect of the introduced congestion term. Similarly to our previous experiments, M3–UCRL successfully converges to the solution obtained under known dynamics. Fig. 6b (Right) shows that the two policies are not completely aligned after the same number of episodes as before, which is due to the harder estimation problem and larger confidence estimates. In the previous experiments, we selected µ ∗ as the initial distribution to focus on finding an optimal policy function π. To evaluate the robustness of M3–UCRL and its ability to drive an arbitrary initial distribution towards the optimal solution, we perform additional experiments with uniform and normal initial distributions. Fig. 7 shows the subsequent mean-field distributions in one episode after the algorithm reached a stable policy. We observe that M3–UCRL is robust to the initial distribution and swiftly drives the mean-field distribution towards a steady state that maximizes the rewards over time.
Review 1: Summary: The authors study multi-agent reinforcement learning, wherein they tackle the mean-field control problem. This formulation assumes an asymptotically infinite population of agents interacting with a common environment and aiming to collaboratively maximize a collective reward. A model-based algorithm is proposed, for which regret bounds are provided. The algorithm is tested in numerical simulations. Strengths and Weaknesses: The problem studied in this work is of interest to the community. The manuscript is well written and the ideas introduced, while simple, appear to be novel and work sufficiently well. The supporting theory introduced is treated with rigor and its analysis appears to be correct. Overall, the biggest weakness of the manuscript is in its Experiments section. The problem considered is quite simple, even though it has been used previously as a comparison benchmark in Laurière et al., 2022. However, the case considered previously is for discrete state-action spaces, while the authors consider the continuous case, making performance comparisons difficult. The manuscript would benefit from either more complex simulations and/or the application of the authors method to the discrete case to better compare it with the previous state of the art. Requested Changes: A better experimental section would improve the manuscript. Nonetheless, I found this work well-written and deserving of publication. Broader Impact Concerns: None ================================================== Review 2: Summary: This work presents a novel model-based reinforcement learning (MORL) approach for mean-field control (MFC) entitled Model-based Multi-agent Mean-field Upper Confidence RL (M$^3$– UCRL). It provides the first general regret bounds for model-based reinforcement learning for MFC, along with a practical parametrisation that allows the use of gradient-optimisation based techniques to solve the problem. Strengths and Weaknesses: **Strengths:** The work proposes a novel MORL approach for MFC, based on Hallucinated-Upper-Confidence Reinforcement Learning (H-UCRL), together with a general theoretical analysis on the regret bound. A practical implementation of M^3– UCRL is provided and evaluated in the exploration via entropy maximization problem. **Weaknesses:** The main body of the paper does not currently encompass all the necessary details for a clear and reproducible work, thus some restructuring is in order. There are a few aspects and statements that require clarification. The theoretical and empirical evaluation are not in full alignment. (more details below). Requested Changes: As far as I can tell, currently, the work follows the structure of the H-UCRL contribution, but I think it could benefit for a stronger positioning in the MFC literature. Following for example the survey of Laurière et al. (2022), you can describe/highlight in your setting details such as evolutive setting, cooperative games, social welfare optimisation. To improve the clarity of the work, there are a couple of statements that should be strengthen throughout the work: - "a novel mean-field type analysis" - concretely specify what is the the novelty of the analysis - the sample-efficiency of M^3– UCRL. This property is also present in the title, however I do not find it is concretely and sufficiently supported in the work currently - related to the previous point, statements such as "Our results show that M3–UCRL is capable of finding close-to-optimal policies within a few episodes, in contrast to model-free algorithms that require at least six orders of magnitude more samples." should also be supported by empirical evidence present in the main body of the paper. To this end, I suggest to include results from Appendix E4 in the main paper. The theoretical analysis also includes bounds for GP models, however, as far as I can tell, there is no empirical evaluation that employs GPs. Would it be possible to extend the results with experiments that include the use of a GP model, perhaps on a different environment? (e.g., a congestion game). Additionally, for the deep ensemble model, can you present more implementation details on the model calibration (or how Assumptions 3 and 4 are met), and how the posterior distribution over dynamical models is derived. Finally, in my opinion, appendix A should also be part of the main paper. Broader Impact Concerns: No concerns at this moment. ================================================== Review 3: Summary: This paper addresses the problem of learning an optimal control policy in cooperative mean-field games with unknown transition dynamics. It proposes a model-based reinforcement learning approach that is an adaptation of the UCRL algorithm to this specific setting. Especially, it provides an analysis of the proposed algorithm, which results in a $O( \sqrt{H^3 T})$ regret upper bound under smoothness and calibration assumptions over the transition dynamics. The paper further explains how the proposed algorithm can be implemented with GPs or neural networks retaining some of the theoretical guarantees. Finally, the algorithm is numerically validated in a continuous gridworld in which the rewards are the entropy of the mean-field distribution. Strengths and Weaknesses: Strengths - (Analysis) The paper provides a regret analysis for a typical optimistic RL procedure adapted to cooperative mean-field control, which is claimed to be novel in the paper (I am not familiar with the mean-field games literature, and unaware of previous comparable results); - (Minor. Suggested application) The paper numerically validate the proposed algorithm in a maximum state entropy exploration setting, which suggests an interesting application domain for mean-field control, although this was considered in the literature (e.g., Geist et al., 2021); - (Minor. Clarity) The paper is well-written and easy to follow. Weaknesses - (Interpretation of the regret) The paper does not compare the regret bound of the proposed algorithm neither to previous MFGs results nor to statistical limits of the settings, which makes hard to fully understand the value of the analysis; - (Discussion of the model assumptions) The regret analysis is provided under two model assumptions (smoothness of the dynamics and calibration) that looks relatively strong. Especially, it is not clear from the paper how much expressive the setting is under those assumptions; - (Minor. Numerical validation in toy domain) The paper stresses the practical upside of the procedure, but only provides a numerical validation in a simple domain, without comparing against any alternative approach. This paper tackles an interesting multi-agent learning setting addressing sample efficiency and scalability through a mean-field game formulation. I have limited knowledge on the related literature, but I was not aware of a previous analysis of UCRL-based approaches in this setting. However, I think the paper is somewhat weak in terms of interpretation of the value of the provided analysis and discussion of the modeling assumptions (see comments below). If the paper could improve in those aspects (see requested changes), I believe it might be a valuable contribution within the TMLR journal. Detailed Comments (C1. Notation) The notation looks to be closer to previous works in mean-field games rather than RL, e.g., denoting the transition dynamics through a McKean-Vlasov stochastic process instead of MDP-like notation. This makes the paper slightly harder to process for an RL audience, and I would consider making a clearer connection between the proposed notation and usual MDP components. (C2. Strength of the model assumptions) In the proposed setting, the transition dynamics is modeled through a Lipschitz function with additive noise. How expressive is the setting under this assumption? What kind of applications can actually model? Especially, it does not seem to include tabular domains in general, which might limit its applicability. (C3. Model calibration) The calibration of the statistical model requires the existence of element-wise confidence bounds over then transition function. This seems to be relatively strong, especially if the environment admits states-distribution pairs that cannot be frequently reached with any policy. (C4. Regret bound interpretation) The regret upper bound provided in the paper does not include any explicit dependence with the size of the problem (from the appendix, it appears to be linear in the state dimensions p, but the action dimensions q does not appear). Moreover, the paper does not compare the obtained result with previous works. Even if this might be the first paper tackling this specific setting, can the authors at least roughly compare their results with previous analyses in finite domains? (C5. Regret lower bound) Without a lower bound setting a statistical barrier for this specific setting, it is hard to understand how far is the proposed algorithm from minimax optimality. Even without a lower bound, can the authors discuss the reported dependencies and whether they think the bound can be improved? (C6. Experiments) The paper stresses the fact that the proposed approach has practical upside, especially in combination with GPs or neural networks. However, it only reports a numerical validation in a toy domain, and does not compare against alternative approaches for mean-field games or state entropy maximization (e.g., Hazan et al., Provably efficient maximum entropy exploration, 2019). Requested Changes: I believe that the current manuscript would need the following changes in order to reach the bar for acceptance: 1) An interpretation of the regret results in comparison to other (possibly model-free) approaches for mean-field games or against a lower bound; 2) A thorough discussion of the model assumptions, how much is the resulting setting expressive and what kind of applications can be modeled under these assumptions. Other changes that can add value to this work are: - A more substantial experimental analysis of the proposed algorithm in challenging domains and against some relevant baseline; - A revised notation that draws a better link between the considered setting and the usual MDP setting. Broader Impact Concerns: This paper provides an essentially theoretical contribution. While the presented approaches might be employed in sensible applications in the future, I do not think that an impact statement is needed at this stage of development. ================================================== Metareview: Recommendation: Accept as is Comment: Reviewers find the work novel and interesting, while offering a number of detailed suggestions to improve the paper. Most of them are about improving clarity of the positioning, limitations of assumptions, technical novelty, among others. The authors provided a revised version that addresses these questions. We are happy to recommend acceptance. ==================================================
# Distributed Newton-Type Methods With Communication Compression And Bernoulli Aggregation Rustem Islamov rustem.islamov@ip-paris.fr Institut Polytechnique de Paris Palaiseau, France Xun Qian JD Explore Academy Beijing, China Slavomír Hanzely King Abdullah University of Science and Technology Thuwal, Saudi Arabia Mher Safaryan King Abdullah University of Science and Technology Thuwal, Saudi Arabia Peter Richtárik King Abdullah University of Science and Technology Thuwal, Saudi Arabia Reviewed on OpenReview: *https: // openreview. net/ forum? id= NekBTCKJ1H* ## Abstract Despite their high computation and communication costs, Newton-type methods remain an appealing option for distributed training due to their robustness against ill-conditioned convex problems. In this work, we study *communication compression* and *aggregation mechanisms* for curvature information in order to reduce these costs while preserving theoretically superior local convergence guarantees. We show that the recently developed class of three point compressors (3PC) of (Richtárik et al., 2022) for gradient communication can be generalized to Hessian communication as well. This result opens up a wide variety of communication strategies, such as *contractive compression* and *lazy aggregation*, available to our disposal to compress prohibitively costly curvature information. Moreover, we discovered several new 3PC mechanisms, such as *adaptive thresholding* and *Bernoulli aggregation*, which require reduced communication and occasional Hessian computations. Furthermore, we extend and analyze our approach to bidirectional communication compression and partial device participation setups to cater to the practical considerations of applications in federated learning. For all our methods, we derive fast *condition-number-independent* local linear and/or superlinear convergence rates. Finally, with extensive numerical evaluations on convex optimization problems, we illustrate that our designed schemes achieve state-ofthe-art communication complexity compared to several key baselines using second-order information. ## 1 Introduction In this work we consider the distributed optimization problem given by the form of ERM: $$\operatorname*{min}_{x\in\mathbb{R}^{d}}\left\{f(x):={\frac{1}{n}}\sum_{i=1}^{n}f_{i}(x)\right\},$$ , (1) 1 where d is the (potentially large) number of parameters of the model x ∈ R d we aim to train, n is the (potentially large) number of devices in the distributed system, fi(x) is the loss/risk associated with the data stored on machine i ∈ [n] := {1, 2*, . . . , n*}, and f(x) is the empirical loss/risk. In order to jointly train a single machine learning model using all devices' local data, *collective efforts* are necessary from all compute nodes. Informally, each entity should invest some "knowledge" from its local "wisdom" to create the global "wisdom". The classical approach in distributed training to implement the collective efforts was to literally collect all the raw data devices acquired and then perform the training in one place with traditional methods. However, the mere access to the raw data hinders the clients' *data* privacy in federated learning applications (Konečný et al., 2016b;a; McMahan et al., 2017). Besides, even if we ignore the privacy aspect, accumulating all devices' data into a single machine is often *infeasible* due to its increasingly large size (Bekkerman et al., 2011). Because of these considerations, there has been a serious stream of works studying distributed training with decentralized data. This paradigm of training brings its own advantages and limitations. Perhaps the major advantage is that each remote device's data can be processed simultaneously using local computational resources. Thus, from another perspective, we are scaling up the traditional single-device training to a distributed training of multiple parallel devices with decentralized data and local computation. However, the cost of scaling the training over multiple devices forces *intensive communication* between nodes, which is the key bottleneck in distributed systems. ## 1.1 Related Work: From First-Order To Second-Order Distributed Optimization Currently, first-order optimization methods are the default options for large-scale distributed training due to their cheap per-iteration costs. Tremendous amount of work has been devoted to extend and analyze gradient-type algorithms to conform to various practical constraints such as efficient communication through compression mechanisms (Alistarh et al., 2017; 2018b; Wen et al., 2017; Wangni et al., 2018; Sahu et al., 2021; Tyurin & Richtárik, 2022) and local methods (Gorbunov et al., 2021b; Stich, 2020; Karimireddy et al., 2020; Nadiradze et al., 2021a; Mishchenko et al., 2022), peer-to-peer communication through graphs (Koloskova et al., 2019; 2020; Kovalev et al., 2021), asynchronous communication (Feyzmahdavian & Johansson, 2021; Nadiradze et al., 2021b), partial device participation (Yang et al., 2021), Byzantine or adversarial attacks (Karimireddy et al., 2021; 2022), faster convergence through acceleration (Allen-Zhu, 2017; Li et al., 2020b; Qian et al., 2021) and variance reduction techniques (Lee et al., 2017; Mishchenko et al., 2019; Horváth et al., 2019; Cen et al., 2020; Gorbunov et al., 2021a), data privacy and heterogeneity over the nodes (Kairouz et al, 2019; Li et al., 2020a), Nevertheless, despite their wide applicability, all first-order methods (including accelerated ones) inevitably suffer from ill-conditioning of the problem. In the past few years, several algorithmic ideas and mechanisms to tackle the above-mentioned constraints have been adapted for second-order optimization. The goal in this direction is to enhance the convergence by increasing the resistance of gradient-type methods against ill-conditioning using the knowledge of curvature information. The basic motivation that the Hessian computation will be useful in optimization is the fast *condition-number-independent* (local) convergence rate of classic Newton's method (Beck, 2014), that is beyond the reach of all first-order methods. Because of the quadratic dependence of Hessian information (d 2 floats per each Hessian matrix) from the dimensionality of the problem, the primary challenge of taming second-order methods was efficient communication between the participating devices. To alleviate prohibitively costly Hessian communication, many works such as DiSCO (Zhang & Xiao, 2015; Zhuang et al., 2015; Lin et al., 2014; Roosta et al., 2019), GIANT (Wang et al., 2018; Shamir et al., 2014; Reddi et al., 2016) and DINGO (Crane & Roosta, 2019; Ghosh et al., 2020b) impart second-order information by condensing it into Hessian-vector products. Inspired from compressed first-order methods, an orthogonal line of work, including DAN-LA (Zhang et al., 2020b), Quantized Newton (Alimisis et al., 2021), NewtonLearn (Islamov et al., 2021), FedNL (Safaryan et al., 2022), Basis Learn (Qian et al., 2022) and IOS (Fabbro et al., 2022), applies lossy compression strategies directly to Hessian matrices reducing the number of encoding bits. Other techniques that have been migrated from first-order optimization literature are local methods (Gupta et al., 2021), partial device participation (Safaryan et al., 2022; Qian et al., 2022), defenses against Byzantine attacks (Ghosh et al., 2020a;c). The theoretical comparison of second order methods is presented in Table 1. We defer more detailed review of a literature of second-order methods to the Appendix. Table 1: Theoretical comparison of several second order methods (including ours) in strongly convex setup with Lipschitz continuous Hessians. Advantages are written in green, while limitations are colored in red. | Method | LipC grad1 | Comm. Cost2 | Comp. Cost3 | Rate | Comments | |--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|----------------------------------------------|----------------------------------------------|---------------------------------------|-------------------------------------------| | (Wang et al., 2018) | No | O(d) | Full Hessian | Local κ-dependent linear. | | | GIANT4 | Global O(log κ/ϵ), quadratics | Big data regime (#data ≫ d) Also requires | | | | | DINGO5,6 | | | | | | | (Crane & Roosta, 2019) | No | O(d) | Hessian-vector products | Global linear, | Hessian pseudo-inverse | | | but no fast local | and vector products. | | | | | (Zhang et al., 2020b) | No | O(nd2 ) | Full Hessian | Global quadratic rate | | | DAN | after O(L/µ2) iterations. | - | ∗∥ | | | | | ∥xk+1−x | | | | | | | limk→∞ | ∥xk−x∗∥ | = 0 | | | | (Zhang et al., 2020b) | Yes | O(nd) | Full Hessian | Asymptotic and implicit | | | DAN-LA | Independent of κ ? | | | | | | | global superlinear rate. | Better non-asymptotic | | | | | | complexity over linear rate ? | | | | | | Local linear and superlinear | | | | | | | NL4 | independent of κ, | reveals local data to server | | | | | (Islamov et al., 2021) | No | O(d) | Full Hessian | but dependent on #data. global linear | | | Quantized Newton6 | 2 ) | Full Hessian | Local (fixed) linear without global | - | | | (Alimisis et al., 2021) | Yes | Oe(d | Local (fixed) linear and | | | | FedNL | superlinear, independent | | | | | | (Safaryan et al., 2022) | No | O(d) | Full Hessian | of κ and #data Global linear | Supports contractive Hessian compression, | | | Bidirectional compression. | | | | | | | Local (fixed) linear and | | | | | | BL | superlinear, independent | | | | | | (Qian et al., 2022) | No | O(d) | Full Hessian | of κ and #data Global linear | Supports contractive Hessian compression, | | | Bidirectional compression. Exploits lower intrinsic dimensionality of data. Only rank-type compression. | | | | | | Fib-IOS6 | | | | | | | (Fabbro et al., 2022) | Yes | O(d) | Periodic | | | | Full Hessian | implicit global linear | Backtracking line search. SVD in each round. | | | | | (Agafonov et al., 2022) | Yes | O(d) | Hessian-vector | | | | FLECS | products | Implicit global linear, but no fast local7 | Backtracking line search. SVD in each round. | | | | Periodic | | | | | | | Full Hessian | | | | | | | Newton-3PC (this work) | No | O(d) | and/or | | | | Hessian-vector products | Local (fixed) linear and superlinear, independent of κ, independent of #data. Global rate8 | Supports contractive Hessian compression, | | | | | | Bidirectional compression. | | | | | | 1 LipC grad = Lipschitz Continuous gradients. 2 Comm. Cost = Communication Cost per round. | 3 Comp. Cost = Computation Cost per round. | | | | | Supports contractive Hessian compression, Bidirectional compression. 1 LipC grad = Lipschitz Continuous **grad**ients. 2 Comm. Cost = **Comm**unication **Cost** per round. 3 Comp. Cost = **Comp**utation **Cost** per round. 4 Only for Generalized Linear Models, e.g. *loss*j (x; aj ) = ϕj (a ⊤ j x) + λ∥x∥ 2. 5 Uses Moral Smoothness: ∥∇2f(x)∇f(x) − ∇2f(y)∇f(y)∥ ≤ L∥x − y∥.6 Strongly convex local loss functions for all clients. 7 FLECS has a local rate under the condition that all iterates remain within some fixed neighborhood of the optimum. 8 See Section I in the Appendix for globalization strategies. ## 2 Motivation And Contributions Handling and taking advantage of the second-order information in distributed setup is rather challenging. As opposed to gradient-type methods, Hessian matrices are both harder to compute and much more expensive to communicate. To avoid directly accessing costly Hessian matrices, methods like DiSCO (Zhang & Xiao, 2015), GIANT (Wang et al., 2018) and DINGO (Crane & Roosta, 2019) exploit Hessian-vector products only, which are as cheap to compute as gradients (Pearlmutter, 1994). However, these methods typically suffer from data heterogeneity, need strong assumptions on problem structure (e.g., generalized linear models) and/or do not provide fast local convergence rates. On the other hand, recent works (Safaryan et al., 2022; Qian et al., 2022) have shown that, with the access of Hessian matrices, fast local rates can be guaranteed for solving general finite sums (1) under compressed communication and arbitrary heterogeneous data. In view of these advantages, in this work we adhere to this approach and study communication mechanisms that can further lighten communication and reduce computation costs. Below, we summarize our key contributions. ## 2.1 Flexible Communication Strategies For Newton-Type Methods We prove that the recently developed class of *three point compressors (3PC)* of Richtárik et al. (2022) for gradient communication can be generalized to Hessian communication as well. In particular, we propose a new method, which we call Newton-3PC (Algorithm 1), extending FedNL (Safaryan et al., 2022) algorithm for arbitrary 3PC mechanism. This result opens up a wide variety of communication strategies, such as contractive compression (Stich et al., 2018a; Alistarh et al., 2018a; Karimireddy et al., 2019) and *lazy* aggregation (Chen et al., 2018; Sun et al., 2019a; Ghadikolaei et al., 2021), available to our disposal to compress prohibitively costly curvature information. Besides, Newton-3PC (and its local convergence theory) recovers FedNL (Safaryan et al., 2022) (when *contractive compressors* are used as 3PC) and BL (Qian et al., 2022) (when *rotation compression* is used as 3PC) in special cases. ## 2.2 New Compression And Aggregation Schemes Moreover, we discovered several new 3PC mechanisms, which require reduced communication and occasional Hessian computations. In particular, to reduce communication costs, we design an *adaptive thresholding* (Example 3.3) that can be seamlessly combined with an already adaptive *lazy aggregation* (Example 3.7). In order to reduce computation costs, we propose *Bernoulli aggregation* (Example 3.9) mechanism which allows local workers to *skip* both computation and communication of local information (e.g., Hessian and gradient) with some predefined probability. Moreover, *sketch-and-project* operator (Example 3.5) reduces the computation costs relying on Hessian-vector products. ## 2.3 Extensions Furthermore, we provide several extensions to our approach to cater to the practical considerations of applications in federated learning. In the main part of the paper, we consider only bidirectional communication compression (Newton-3PC-BC) setup, where we additionally apply Bernoulli aggregation for gradients (worker to server direction) and another 3PC mechanism for the global model (server to worker direction). The extension for partial device participation (Newton-3PC-BC-PP) setup and the discussion for globalization are deferred to the Appendix. ## 2.4 Fast Local Linear/Superlinear Rates All our methods are analyzed under the assumption that the global objective is strongly convex and local Hessians are Lipschitz continuous. In this setting, we derive fast *condition-number-independent* local linear and/or superlinear convergence rates. ## 2.5 Extensive Experiments And Numerical Study Finally, with extensive numerical evaluations on convex optimization problems, we illustrate that our designed schemes achieve state-of-the-art communication complexity compared to several key baselines using second-order information. ## 3 Three Point Compressors For Matrices To properly incorporate second-order information in distributed training, we need to design an efficient strategy to synchronize locally evaluated d × d Hessian matrices. Simply transferring d 2entries of the matrix each time it gets computed would put significant burden on communication links of the system. Recently, Richtárik et al. (2022) proposed a new class of gradient communication mechanisms under the name three point compressors (3PC), which unifies contractive compression and lazy aggregation mechanisms into one class. Here we extend the definition of 3PC for matrices under the Frobenius norm *∥ · ∥*F and later apply to matrices involving Hessians. Definition 3.1 (3PC for Matrices). *We say that a (possibly randomized) map* (ccs). _We say that a (possibly rationalized) map_ $$\mathcal{C}_{\mathbf{H},\mathbf{Y}}(\mathbf{X}):\underbrace{\mathbb{R}^{d\times d}}_{\mathbf{H}\in}\times\underbrace{\mathbb{R}^{d\times d}}_{\mathbf{Y}\in}\times\underbrace{\mathbb{R}^{d\times d}}_{\mathbf{X}\in}\to\mathbb{R}^{d\times d}$$ $$\mathbf{\Phi}^{\dagger}$$ $\frac{1}{2}$ 4. $$\mathbf{\Phi}^{\dagger}$$ is a three point compressor (3PC) if there exist constants 0 < A ≤ 1 and B ≥ 0 *such that* $$\mathbb{E}\left[\left\|\mathcal{C}_{\mathbf{H},\mathbf{Y}}(\mathbf{X})-\mathbf{X}\right\|_{\mathrm{F}}^{2}\right]\leq\left(1-A\right)\left\|\mathbf{H}-\mathbf{Y}\right\|_{\mathrm{F}}^{2}+B\left\|\mathbf{X}-\mathbf{Y}\right\|_{\mathrm{F}}^{2}.$$ holds for all matrices H, Y, X ∈ R d×d. The matrices Y and H can be treated as parameters defining the compressor that would be chosen adaptively. Once they fixed, CH,Y : R d×d → R d×dis a map to compress a given matrix X. Let us discuss special cases with some examples. Example 3.2 (**Contractive compressors** (Karimireddy et al., 2019)). *The (possibly randomized) map* C : R d×d → R d×dis called contractive compressor with contraction parameter α ∈ (0, 1]*, if the following holds* for any matrix X ∈ R d×d $$\mathbb{E}\left[\|\mathcal{C}(\mathbf{X})-\mathbf{X}\|_{\mathrm{F}}^{2}\right]\leq(1-\alpha)\|\mathbf{X}\|_{\mathrm{F}}^{2}.\tag{1}$$ Notice that (4) is a special case of (2) when H = 0, Y = X and A = *α, B* = 0. Therefore, contractive compressors are already included in the 3PC class. Contractive compressors cover various well known compression schemes such as greedy sparsification, low-rank approximation and (with a suitable scaling factor) arbitrary unbiased compression operator (Beznosikov et al., 2020). There have been several recent works utilizing these compressors for compressing Hessian matrices (Zhang et al., 2020b; Alimisis et al., 2021; Islamov et al., 2021; Safaryan et al., 2022; Qian et al., 2022; Fabbro et al., 2022). Below, we introduce yet another contractive compressor based on thresholding idea which shows promising performance in our experiments. Example 3.3 (**Adaptive Thresholding [NEW]).** *Following Sahu et al. (2021), we design an* adaptive thresholding operator with parameter λ ∈ (0, 1] defined as follows; for all j, l ∈ [d] and X ∈ R d×d $$|\rangle$$ $$\left[\mathcal{C}(\mathbf{X})\right]_{jl}\,:=\,\begin{cases}\mathbf{X}_{jl}&\text{if}|\mathbf{X}_{jl}|\geq\lambda\|\mathbf{X}\|_{\infty},\\ 0&\text{otherwise},\end{cases}\tag{1}$$ $\left(5\right)^{\frac{1}{2}}$ In contrast to *hard thresholding* operator of Sahu et al. (2021), (5) uses adaptive threshold λ∥X∥∞ instead of fixed threshold λ. With this choice, we ensures that at least the Top-1 is transferred. In terms of computation, thresholding approach is more efficient than Top-K (Stich et al., 2018b) as only single pass over the values is already enough instead of partial sorting. Lemma 3.4. *The adaptive thresholding operator* (5) *is contractive with* α = max(1 − (dλ) 2, 1/d 2). A popular technique to decrease computation cost of Newton-type methods is to rely on Hessian-vector products. We show that so called *sketch-and-project* mechanism (Gower & Richtárik, 2017) is a special case of contractive compressor. Example 3.5 (**Sketch-and-Project** (Gower & Richtárik, 2017)). Let S *be a sketching matrix sampled* from a fixed distribution D *over matrices in* R d×τ(τ ≥ 1 *can but does not need to be fixed). We define* sketch-and-project operator as follows $${\mathcal{C}}(\mathbf{X})=\mathbf{S}(\mathbf{S}^{\top}\mathbf{S})^{\dagger}\mathbf{S}^{\top}\mathbf{X}.$$ ⊤X. (6) For more details on sketch-and-project operator we refer a reader to the Appendix. Lemma 3.6. *The sketch-and-project operator* (6) *is a contractive compressor with* α = λ + min(E-S(S ⊤S) †S ⊤) where the expectation is taken w.r.t. randomness of the sketching S*, and* λ + min(M) indicates the smallest positive eigenvalue of a symmetric matrix M. The next two examples are 3PC schemes which in addition to contractive compressors utilize aggregation mechanisms, which is an orthogonal approach to contractive compressors. $$({\mathfrak{f}}{\mathfrak{o}})$$ Example 3.7 (**Compressed Lazy AGgregation (CLAG)** (Richtárik et al., 2022)). Let C : R d×d → R d×d be a contractive compressor with contraction parameter α ∈ (0, 1] and ζ ≥ 0 *be a trigger for the aggregation.* Then CLAG mechanism is defined as $$\mathcal{C}_{\mathbf{H},\mathbf{Y}}(\mathbf{X})=\begin{cases}\mathbf{H}+\mathcal{C}(\mathbf{X}-\mathbf{H})&\text{if}\|\mathbf{X}-\mathbf{H}\|_{\mathrm{F}}^{2}>\zeta\|\mathbf{X}-\mathbf{Y}\|_{\mathrm{F}}^{2}\\ \mathbf{H}&\text{otherwise}\end{cases}\tag{7}$$ In the special case of identity compressor C = Id (i.e., α = 1), CLAG reduces to lazy aggregation (Chen et al., 2018). On the other extreme, if the trigger ζ = 0 is trivial, CLAG recovers recent variant of error feedback for contractive compressors, i.e., EF21 mechanism (Richtárik et al., 2021). Lemma 3.8 (see Lemma 4.3 in (Richtárik et al., 2022)). *CLAG mechanism* (7) *is a 3PC compressor with* A = 1 − (1 − α)(1 + s) and B = max{(1 − α)(1 + 1/s), ζ}*, for any* s ∈ (0, α/(1−α)). From the first glance, the structure of CLAG in (7) may not seem communication efficient as the the matrix H (appearing in both cases) can potentially by dense. However, as we will see in the next section, CH,Y is used to compress X when there is no need to communicate H. Thus, with CLAG we either send compressed matrix C(X − H) if the condition with trigger ζ activates or nothing. Example 3.9 (**Compressed Bernoulli AGgregation (CBAG) [NEW]).** Let C : R d×d → R d×dbe a contractive compressor with contraction parameter α ∈ (0, 1] and p ∈ (0, 1] be the probability for the aggregation. We then define CBAG mechanism is defined as $$\mathcal{C}_{\mathbf{H},\mathbf{Y}}(\mathbf{X})=\begin{cases}\mathbf{H}+\mathcal{C}(\mathbf{X}-\mathbf{H})&\text{with prob.}p,\\ \mathbf{H}&\text{with prob.}1-p.\end{cases}\tag{8}$$ The advantage of CBAG (8) over CLAG is that there is no condition to evaluate and check. This choice of probabilistic switching reduces computation costs as with probability 1 − p it is useless to compute X. Note that CBAG has two independent sources of randomness: Bernoulli aggregation and possibly random operator C. Lemma 3.10. *CBAG mechanism* (8) *is a 3PC compressor with* A = (1−pα)(1+s) and B = (1−pα)(1+1/s), for any s ∈ (0, pα/(1−pα)). Lazy aggregation communication mechanisms empirically outperform vanilla GD (Chen et al., 2018). The main idea is to communicate local gradients/Hessians only in the case when a certain conidition holds. For example, in the case of CLAG we update local Hessian estimators only if they are sufficiently far from true local Hessians. Parameter ζ controls how often we want to skip communication. If it is large, then we reuse previous Hessian estimators more often. CLAG can be seen as an adaptive mechanism that dynaimcally updates estimators based on the conditions that change throughout the optimization process. Thus, it is difficult to estimate/approximate how frequently we skip communications. In fact, lazy aggregation remains poorly studied field in the literature. It has been analyzed for gradient-type methods only. However, the theoretical analysis show either explicit convergence guarantees (Sun et al., 2019b; Chen et al., 2018), or sublinear rates in the strongly convex regime (Shokri Ghadikolaei et al., 2021). Recently, (Richtárik et al., 2022) have shown that LAG can be properly studied from compression point of view. They derive optimal convergence guarantees suported by emprirical evaluations. The follow-up work (Doikov et al., 2023) uses similar idea in one node regime. They compute Hessian deterministically once in 1/d iterations. Their theoretical analysis also show benefits of exploiting rare updates. Nevertheless, the lazy aggregation in the case of second-order methods remains poorly studied. In our work we make a step towards better understanding of lazy aggregation for Newton-type algorithms. For more examples of 3PC compressors see section 3 of Richtárik et al. (2022) and the Appendix. ## 4 Newton-3Pc**: Newton'S Method With 3Pc** In this section we present our first Newton-type method, called Newton-3PC, employing communication compression through 3PC compressors discussed in the previous section. The proposed method is an extension of FedNL (Safaryan et al., 2022) from contractive compressors to arbitrary 3PC compressors. From this perspective, our Newton-3PC (see Algorithm 1) is much more flexible, offering a wide variety of communication strategies beyond contractive compressors. ## 4.1 General Technique For Learning The Hessian The central notion in FedNL is the technique for learning *a priori unknown* Hessian ∇2f(x ∗) at the (unique) solution x ∗in a communication efficient manner. This is achieved by maintaining and iteratively updating local Hessian estimates Hk i of ∇2fi(x ∗) for all devices i ∈ [n] and the global Hessian estimate Hk = 1 n Pn i=1 Hk i of ∇2f(x ∗) for the central server. We adopt the same idea of Hessian learning and aim to update local estimates in such a way that Hk i → ∇2fi(x ∗) for all i ∈ [n], and as a consequence, Hk → ∇2f(x ∗), throughout the training process. However, in contrast to FedNL, we update local Hessian estimates via generic 3PC mechanism, namely Hk+1 i = CHk i ,∇2fi(xk) ∇2fi(x k+1), which is a particular instantiation of 3PC compressor CH,Y(X) using previous local Hessian Y = ∇2fi(x k) and previous estimate H = Hk i to compress current local Hessian X = ∇2fi(x k+1). Algorithm 1 Newton-3PC (Newton's method with 3PC) 1: **Input:** x 0 ∈ R d, H01 , . . . , H0n ∈ R d×d, H0:= 1n Pn i=1 H0 i , l0 = 1 n Pn i=1 ∥H0 i − ∇2fi(x 0)∥. 2: on server 3: *Option 1:* x k+1 = x k − [Hk] −1 µ ∇f(x k) 4: *Option 2:* x k+1 = x k − [Hk + l kI] −1∇f(x k) 5: Broadcast x k+1 to all nodes 6: for each device i = 1*, . . . , n* in parallel do 7: Get x k+1 and compute local gradient ∇fi(x k+1) and local Hessian ∇2fi(x k+1) 8: Apply 3PC and update local Hessian estimator to Hk+1 i = CHk i ,∇2fi(xk) ∇2fi(x k+1) 9: Send ∇fi(x k+1), Hk+1 ito the server ▷ the latter is sent only if Hk+1 ihas been updated 10: Send l k+1 i:= ∥Hk+1 i − ∇2fi(x k+1)∥F ▷ if *Option 2* is used 11: **end for** 12: on server 13: Hk+1 = 1 n Pn i=1 Hk+1 i, lk+1 = 1 n Pn i=1 l k+1 i In the special case, when EF21 scheme CHk i ,∇2fi(xk) ∇2fi(x k+1)= Hk i + C(∇2fi(x k+1) − Hk i ) is employed as a 3PC mechanism, we recover the Hessian learning technique of FedNL. Our Newton-3PC method also recovers recently proposed *Basis Learn* (BL) (Qian et al., 2022) algorithm if we specialize the 3PC mechanism to *rotation compression* (see Appendix). ## 4.2 Flexible Hessian Communication And Computation Schemes. The key novelty Newton-3PC brings is the flexibility of options to handle costly local Hessian matrices both in terms of computation and communication. Due to the adaptive nature of CLAG mechanism (7), Newton-CLAG method *does not send any information* about the local Hessian ∇2fi(x k+1) if it is sufficiently close to previous Hessian estimate Hk i , namely ∥∇2fi(x k+1) − Hk i ∥ 2 F ≤ ζ∥∇2fi(x k+1) − ∇2fi(x k)∥ 2 F with some positive trigger ζ > 0. In other words, the server *reuses* local Hessian estimate Hk i while there is no essential discrepancy between locally computed Hessian ∇2fi(x k+1). Once a sufficient change is detected by the device, only the compressed difference C(∇2fi(x k+1) − Hk i ) is communicated since the server knows Hk i . By adjusting the trigger ζ, we can control the frequency of Hessian communication in an adaptive manner. Together with adaptive thresholding operator (5) as a contractive compressor, CLAG is a doubly adaptive communication strategy that makes Newton-CLAG highly efficient in terms of communication complexity. Interestingly enough, we can design such 3PC compressors that can reduce computational costs too. To achieve this, we consider CBAG mechanism (8) which replaces the adaptive switching condition of CLAG by probabilistic switching according to Bernoulli random variable. Due to the probabilistic nature of CBAG mechanism, Newton-CBAG method requires devices to compute local Hessian ∇2fi(x k+1) and communicate compressed difference C(∇2fi(x k+1) − Hk i ) *only* with probability p ∈ (0, 1]. Otherwise, the whole Hessian computation and communication is *skipped*. ## 4.3 Options For Updating The Global Model We adopt the same two update rules for the global model as was design in FedNL. If the server knows the strong convexity parameter µ > 0 (see Assumption 4.1), then the global Hessian estimate Hkis projected onto the set M ∈ R d×d: M⊤ = M, µI ⪯ M to get the projected estimate [Hk]µ. Alternatively, all devices additionally compute and send compression errors l k i := ∥Hk i − ∇2fi(x k)∥F (extra float from each device in terms of communication complexity) to the server, which then formulates the regularized estimate Hk + l kI by adding the average error l k = 1 n Pn i=1 l k i to the global Hessian estimate Hk. ## 4.4 Local Convergence Theory To derive local1theoretical guarantees, we consider the standard assumption that the global objective is strongly convex and local Hessians are Lipschitz continuous. Assumption 4.1. The average loss f is µ-strongly convex, and all local losses fi(x) *have Lipschitz continuous* Hessians with respect to three different matrix norms: spectral, Frobenius and infinity norms, respectively. Formally, we require ∥∇2fi(x)−∇2fi(y)∥ ≤ L∗∥x−y∥, ∥∇2fi(x)−∇2fi(y)∥F ≤ LF∥x−y∥, maxj,l |(∇2fi(x)− ∇2fi(y))jl| ≤ L∞∥x − y∥ to hold for all i ∈ [n] and *x, y* ∈ R d. Define constants C and D depending on which option is used for global model update, namely C = 2, D = L 2∗ if *Option 1* is used, and C = 8, D = (L∗+2LF) 2if *Option 2* is used. We prove three local rates for Newton-3PC: for the squared distance to the solution ∥x k − x ∗∥ 2, and for the Lyapunov function $$\Phi^{k}:={\mathcal{H}}^{k}+6(1/A+3A B)L_{\mathrm{F}}^{2}\|x^{k}-x^{*}\|^{2}.$$ where Hk:= 1n Pn i=1 ∥Hk i − ∇2fi(x ∗)∥ 2 F . We present our theoretical results for local convergence with two stages. For the first stage, we derive convergence rates using specific *locality conditions* for model/Hessian estimation error. In the second stage, we prove that these locality conditions are satisfied for different situations. Theorem 4.2. *Let Assumption 4.1 hold. Assume* ∥x 0 − x ∗∥ ≤ √ µ 2D and Hk ≤ µ 2 4C for all k ≥ 0*. Then,* Newton-3PC *(Algorithm 1) with any 3PC mechanism converges with the following rates:* $$\|x^{k}-x^{*}\|^{2}\leq{\frac{1}{2^{k}}}\|x^{0}-x^{*}\|^{2},$$ $$(9)$$ 2, (9) $$\mathbb{E}\left[\Phi^{k}\right]\leq\left(1-\rho\right)^{k}\Phi^{0},\;\rho=\operatorname*{min}\left\{{\frac{A}{2}},{\frac{1}{3}}\right\},$$ , (10) $$\mathbb{E}\left[\frac{\|x^{k+1}-x^{*}\|^{2}}{\|x^{k}-x^{*}\|^{2}}\right]\leq(1-\rho)^{k}\left(C+\frac{A D}{12(1+3A B)L_{\mathrm{F}}^{2}}\right)\frac{\Phi^{0}}{\mu^{2}}.$$ Clearly, these rates are independent of the condition number of the problem, and the choice of 3PC can control the parameter A. Notice that locality conditions here are upper bounds on the initial model error ∥x 0 − x ∗∥ and the errors Hkfor all k ≥ 0. It turns out that the latter condition may not be guaranteed in general since it depends on the structure of the 3PC mechanism. Below, we show these locality conditions under some assumptions on 3PC, covering practically all compelling cases. We highlight that the design 1For discussion on global convergence guarantees we refer to the Appendix I. $$\left(10\right)$$ $$(11)$$ of Algorithm 1 allows to keep iterates x k and Hessian approximations Hk i in a neighbourhood of x ∗ and ∇2fi(x ∗) that is crucally important do derive local convergence guarantees. Moreover, Newton-3PC provably works with biased compression operators that are typically harder to analyze. Lemma 4.3 (Deterministic 3PC). *Let the 3PC compressor in* Newton-3PC be deterministic. Assume the following initial conditions hold: ∥x 0 − x ∗∥ ≤ e1 := min{√Aµ 8(1+3AB)LF , √ µ 2D } and ∥H0 i − ∇2fi(x ∗)∥F ≤µ 2 √C . Then ∥x k − x ∗∥ ≤ e1 and ∥Hk i − ∇2fi(x ∗)∥F ≤µ 2 √C for all k ≥ 0. Lemma 4.4 (CBAG). *Consider CBAG mechanism with only source of randomness from Bernoulli aggregation.* Assume ∥x 0 − x ∗∥ ≤ e2 := min{ (1− √1−α)µ 4 √CLF, √ µ 2D } and ∥H0 i − ∇2fi(x ∗)∥F ≤µ 2 √C . Then ∥x k − x ∗∥ ≤ e2 and ∥Hk i − ∇2fi(x ∗)∥F ≤µ 2 √C for all k ≥ 0. ## 5 Extension To Bidirectional Compression (Newton-3Pc-Bc) In this section, we consider the setup where both directions of communication between devices and the central server are bottleneck. For this setup, we propose Newton-3PC-BC (Algorithm 2) which additionally applies Bernoulli aggregation for gradients (worker to server direction) and another 3PC mechanism for the global model (server to worker direction) employed the master. Overall, the method integrates three independent communication schemes: workers' 3PC (denoted by CW ) for local Hessian matrices ∇2fi(z k+1), master's 3PC (denoted by CM) for the global model x k+1 and Bernoulli aggregation with probability p ∈ (0, 1] for local gradients ∇fi(z k+1). Because of these three mechanisms, the method maintains three sequences of model parameters {x k, wk, zk}k≥0. Parameters x k and w k are server's and clients' models respectively while w kis a copy of z k when local gradients were last computed. Notice that, Bernoulli aggregation for local gradients is a special case of CBAG (Example 3.9), which allows to skip the computation of local gradients with probability (1 − p). However, this reduction in gradient computation necessitates algorithmic modification in order to guarantee convergence. Specifically, we design gradient estimator g k+1 to be the full gradient ∇f(z k+1) if devices compute local gradients (i.e., ξ = 1). Otherwise, when gradient computation is skipped (i.e., ξ = 0), we estimate the missing gradient using Hessian estimate Hk+1 and stale gradient ∇f(w k+1), namely we set g k+1 = [Hk+1]µ(z k+1 − w k+1) + ∇f(w k+1). Similar to the previous result, we present convergence rates and guarantees for locality separately. Let AM(AW ), BM(BW ) be parameters of the master's (workers') 3PC mechanisms. Define constants CM := 4 AM + 1+ 5BM 2, CW := 4 AW +1+ 5BW 2and Lyapunov function Φ k 1 := ∥z k−x ∗∥ 2+CM∥x k−x ∗∥ 2+ AM(1−p) 4p∥w k−x ∗∥ 2. Theorem 5.1. *Let Assumption 4.1 holds. Assume* ∥z k − x ∗∥ 2 ≤AMµ 2 24CML2∗ and Hk ≤ AMµ 2 96CM*for all* k ≥ 0. Then, Newton-3PC-BC *(Algorithm 2) converges with the following linear rate:* $$\mathbb{E}[\Phi_{1}^{k}]\leq\left(1-\operatorname*{min}\{{\frac{A_{M}}{4}},{\frac{3p}{8}}\}\right)^{k}\Phi_{1}^{0}.$$ $$(12)$$ . (12) Note that the above linear rate for Φ k 1 does not depend on the conditioning of the problem and implies linear rates for all three sequences {x k, wk, zk}. Next we prove locality conditions used in the theorem for two cases: for non-random 3PC schemes and for schemes that preserve certain convex combination condition. It can be seen easily that random sparsification fits into the second case. Lemma 5.2 (Deterministic 3PC). Let Assumption 4.1 holds. Let CM and CW *be deterministic. Assume* ∥x 0 − x ∗∥ 2 ≤ 11AM 24CM e 2 3 := 11AM 24CM min{ AMµ 2 24CML2∗ ,AW AMµ 2 384CW CML2F } and H0 ≤ AMµ 2 96CM . Then ∥x k − x ∗∥ 2 ≤ 11AM 24CM e 2 3 , ∥z k − x ∗∥ 2 ≤ e 2 3 and Hk ≤ AMµ 2 96CM for all k ≥ 0 Lemma 5.3 (Random sparsification). *Let Assumption 4.1 holds. Assume* (z k)j *is a convex combination of* {(x t)j} k t=0*, and* (Hk i )jl *is a convex combination of* {(∇2fi(z k))jl} k t=0 for all i ∈ [n], j, l ∈ [d], and k ≥ 0*. If* ∥x 0 −x ∗∥ 2 ≤ e 2 4 := min{ µ 2 d2L2∗ ,AMµ 2 24dCML2∗ ,AMµ 2 96d3CML2∞ ,µ 2 4d4L2∞ }*, then* ∥z k −x ∗∥ 2 ≤ de24 and Hk ≤ min{ AMµ 2 96CM , µ 2 4d } for all k ≥ 0. Algorithm 2 Newton-3PC-BC (Newton's method with 3PC and Bidirectional Compression) 1: **Parameters:** Workers-side 3PC (CW ), Master-side 3PC (CM), gradient probability p ∈ (0, 1] 2: **Input:** x 0 = w 0 = z 0 ∈ R d; H0 i ∈ R d×d, and H0:= 1n Pn i=1 H0 i ; ξ 0 = 1; g 0 = ∇f(z 0) 3: on server 4: Update the global model to x k+1 = z k − [Hk] −1 µ g k 5: Apply Master-side 3PC and send model estimate z k+1 = CM z k,xk (x k+1) to all devices i ∈ [n] 6: Sample ξ k+1 ∼ Bernoulli(p) and send to all i ∈ [n] 7: for each device i = 1*, . . . , n* in parallel do 8: Get z k+1 = CM z k,xk (x k+1) and ξ k+1 from the server 9: if ξ k+1 = 1 10: w k+1 = z k+1, compute local gradient ∇fi(z k+1) and send to the server 11: if ξ k+1 = 0 12: w k+1 = w k 13: Apply Worker's 3PC and update local Hessian estimator to Hk+1 i = CW Hk i ,∇2fi(z k) (∇2fi(z k+1)) 14: **end for** 15: on server 16: ∇f(z k+1) = 1n Pn i=1 ∇fi(z k+1), Hk+1 = 1 n Pn i=1 Hk i 17: if ξ k+1 = 1 18: w k+1 = z k+1, gk+1 = ∇f(z k+1) 19: if ξ k+1 = 0 20: w k+1 = w k, 21: g k+1 = [Hk+1]µ(z k+1 − w k+1) + ∇f(w k+1) ![9_image_0.png](9_image_0.png) 2000 3700 5400 Figure 1: Comparison of Newton-CBAG with Top-d compressor and probability p = 0.75, Newton-EF21 with Rank-1 compressor, NL1 with Rand-1 compressor, and DINGO (**first row**). The performance of Newton-CBAG with Top-d in terms of communication complexity (**second row**, in Mbytes) and the number of local Hessian computations (**third row**). ![10_image_0.png](10_image_0.png) $$(13)^{\frac{1}{2}}$$ Figure 2: Comparison of Newton-CBAG with thresholding and Top-d compressors and Newton-EF21 with thresholding compressor in terms of communication complexity (**first row**). Comparison of Newton-3PC-BC against FedNL-BC in terms of communication complexity (**second row**). The performance of Newton-CBAG combined with Top-d compressor and probability p = 0.75, Newton-EF21 with Rank-1 compressor, DINGO, and Fib-ISO in terms of communication complexity on Softmax problem (**third row**). ## 6 Experiments In this part, we study the empirical performance of Newton-3PC comparing its performance against other second-order methods on logistic regression problems of the form $$\operatorname*{min}_{x\in\mathbb{R}^{d}}\left\{f(x):={\frac{1}{n}}\sum\limits_{i=1}^{n}f_{i}(x)+{\frac{\lambda}{2}}\|x\|^{2}\right\},$$ where fi(x) = 1m Pm j=1 log 1 + exp(−bija ⊤ ijx)and {aij , bij}j∈[m] are data points belonging to i-th client. We use datasets from LibSVM library (Chang & Lin, 2011). Each dataset was shuffled and split into n equal parts. Detailed description of datasets and hyperparameters choice is given in the Appendix. ## 6.1 Comparison Between Newton-3Pc **And Other Second-Order Methods** According to Safaryan et al. (2022), FedNL with Rank-1 compressor outperforms other second-order methods in all cases in terms of communication complexity. Thus, we compare in Figure 1 (first row) Newton-CBAG (based on Top-d compressor and probability p = 0.75), Newton-EF21 with Rank-1, NL1 with Rand-1, DINGO, and Fib-IOS indicating how many bits are transmitted by each client in both uplink and downlink directions. We clearly see that Newton-CBAG is much more communication efficient than NL1, Fib-IOS and DINGO. Besides, it outperforms FedNL in all cases. On top of that, we achieve improvement not only in communication complexity, but also in computational cost with Newton-CBAG. Indeed, when clients do not send compressed Hessian differences to the server there is no need to compute local Hessians. Consequently, computational costs goes down. We decided not to compare Newton-3PC with first-order methods since FedNL already outperforms them in terms of communication complexity in a variety of experiments in (Safaryan et al., 2022). ## 6.2 Does Bernoulli Aggregation Bring Any Advantage? Next, we investigate the performance of Newton-CBAG based on Top-K. We report the results in heatmaps (see Figure 1, second row) where we vary probability p along rows and compression level K along columns. Notice that Newton-CBAG reduces to FedNL when p = 1 (left column). We observe that Bernoulli aggregation (BAG) is indeed beneficial since the communication complexity reduces when p becomes smaller than 1 (in case of a1a data set the improvement is significant). We can conclude that BAG leads to better communication complexity of Newton-3PC over FedNL. On top of that, we claim that Newton-CBAG is also computationally more efficient than FedNL; see Figure 1 (third row) that indicates the number of Hessian computations. We observe that even if communication complexity in two regimes are close to each other, but computationally better the one with smaller p. Indeed, in the case when p < 1 we do not have to compute local Hessians with probability 1 − p that leads to acceleration in terms of computation complexity. ## 6.3 3Pc Based On Adaptive Thresholding Next we test the performance of Newton-3PC using adaptive thresholding operator (5). We compare Newton-EF21 (equivalent to FedNL), Newton-CBAG, and Newton-CLAG with adaptive thresholding against Newton-CBAG with Top-d compressor. We fix the probability p = 0.5 for CBAG, the trigger ζ = 2 for CLAG, and thresholding parameter λ = 0.5. According to the results presented in Figure 2 (first row), adaptive thresholding can be beneficial since it improves the performance of Newton-3PC in some cases. Moreover, it is computationally cheaper than Top-K as we do not sort entries of a matrix as it is for Top-K. ## 6.4 Newton-3Pc-Bc **Against** Fednl-Bc In our next experiment we study bidirectional compression. We compare Newton-3PC-BC against FedNL-BC. For Newton-3PC-BC we fix CBAG with p = 0.75 combined with Top-d compressor applied on Hessians, BAG with p = 0.75 applied on gradients, and 3PCv4 (Richtárik et al., 2022) combined with (Top-K1, Top-K2) compressors on iterates. For FedNL-BC we use Top-d compressor on Hessians and BAG with p = 0.75 on gradients, and Top-K compressor on iterates. We choose different values for K1 and K2 such that it K1 + K2 = K always hold. Such choice of parameters allows to make the iteration cost of both methods to be equal. Based on the results, we argue that the superposition of CBAG and 3PCv4 applied on Hessians and iterates respectively is more communication efficient than the combination of EF21 and EF21. ## 6.5 Performance Of Newton-3Pc **On Softmax Problem** Finally, we also consider L2 regularized Softmax problem where all fi's of the form $$f_{i}(x)=\sigma\log\left(\sum_{j=1}^{m}\exp\left({\frac{a_{i j}^{\top}x-b_{i j}}{\sigma}}\right)\right)$$ Here σ > 0 is a smoothing parameter. One can show that this function has both Lipschitz continuous gradient and Lipschitz continuous Hessian. We perform the same data shift as it was done in (Hanzely et al., 2020) (section 8.2). Note that in this case we do not compare Newton-3PC against NL1 as this problem does not belong to the class of *generalized linear models.* We compare Newton-CBAG combined with Top-d compressor and probability p = 0.75, Newton-EF21 with Rank-1 compressor, DINGO (Crane & Roosta, 2019), and Fib-IOS (Fabbro et al., 2022). As we can see in Figure 2 (third row), Newton-CBAG and Newton-EF21 demonstrate almost equivalent performance: in some cases slightly better the first one (a1a dataset), in some cases - the second (phishing dataset). Furthermore, DINGO and Fib-IOS are significantly slower than Newton-3PC methods in terms of communication complexity. ## References Artem Agafonov, Dmitry Kamzolov, Rachael Tappenden, Alexander Gasnikov, and Martin Takáč. Flecs: A federated learning second-order framework via compression and sketching. *arXiv preprint: arXiv* 2206.02009, 2022. Foivos Alimisis, Peter Davies, and Dan Alistarh. Communication-efficient distributed optimization with quantized preconditioners. In *International Conference on Machine Learning (ICML)*, 2021. Dan Alistarh, Demjan Grubic, Jerry Li, Ryota Tomioka, and Milan Vojnovic. QSGD: Communication-efficient SGD via gradient quantization and encoding. In *Advances in Neural Information Processing Systems*, pp. 1709–1720, 2017. Dan Alistarh, Torsten Hoefler, Mikael Johansson, Sarit Khirirat, Nikola Konstantinov, and Cédric Renggli. The convergence of sparsified gradient methods. In *32nd Conference on Neural Information Processing* Systems, 2018a. Dan Alistarh, Torsten Hoefler, Mikael Johansson, Nikola Konstantinov, Sarit Khirirat, and Cédric Renggli. The convergence of sparsified gradient methods. In *Advances in Neural Information Processing Systems*, pp. 5977–5987, 2018b. Zeyuan Allen-Zhu. Katyusha: The first direct acceleration of stochastic gradient methods. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, pp. 1200–1205. ACM, 2017. Amir Beck. *Introduction to Nonlinear Optimization: Theory, Algorithms, and Applications with MATLAB*. Society for Industrial and Applied Mathematics, USA, 2014. ISBN 1611973643. Ron Bekkerman, Mikhail Bilenko, and John Langford. *Scaling up machine learning: Parallel and distributed* approaches. Cambridge University Press, 2011. Aleksandr Beznosikov, Samuel Horváth, Peter Richtárik, and Mher Safaryan. On biased compression for distributed learning. *arXiv preprint arXiv:2002.12410*, 2020. Shicong Cen, Huishuai Zhang, Yuejie Chi, Wei Chen, and Tie-Yan Liu. Convergence of distributed stochastic variance reduced methods without sampling extra data. *IEEE TRANSACTIONS ON SIGNAL PROCESSING, volume 68*, 2020. Chih-Chung Chang and Chih-Jen Lin. LibSVM: a library for support vector machines. ACM Transactions on Intelligent Systems and Technology (TIST), 2(3):1–27, 2011. T. Chen, G. Giannakis, T. Sun, and W. Yin. LAG: Lazily aggregated gradient for communication-efficient distributed learning. *Advances in Neural Information Processing Systems*, 2018. Rixon Crane and Fred Roosta. Dingo: Distributed newton-type method for gradient-norm optimization. In Advances in Neural Information Processing Systems, volume 32, pp. 9498–9508, 2019. Nikita Doikov, El Mahdi Chayti, and Martin Jaggi. Second-order optimization with lazy hessians. In Proceedings of the 40th International Conference on Machine Learning, 2023. Nicolò Dal Fabbro, Subhrakanti Dey, Michele Rossi, and Luca Schenato. A newton-type algorithm for federated learning based on incremental hessian eigenvector sharing. *arXiv preprint arXiv: 2202.05800*, 2022. Hamid Reza Feyzmahdavian and Mikael Johansson. Asynchronous iterations in optimization: New sequence results and sharper algorithmic guarantees. *arXiv preprint arXiv:2109.04522*, 2021. H. S. Ghadikolaei, S. Stich, and M. Jaggi. LENA: Communication-efficient distributed learning with selftriggered gradient uploads. International Conference on Artificial Intelligence and Statistics, pp. 3943–3951. PMLR, 2021. Avishek Ghosh, Raj Kumar Maity, and Arya Mazumdar. Distributed Newton Can Communicate Less and Resist Byzantine Workers. *Advances in Neural Information Processing Systems*, 2020a. Avishek Ghosh, Raj Kumar Maity, Arya Mazumdar, and Kannan Ramchandran. Communication efficient distributed approximate newton method. In *2020 IEEE International Symposium on Information Theory* (ISIT), pp. 2539–2544, 2020b. doi: 10.1109/ISIT44484.2020.9174216. Avishek Ghosh, Raj Kumar Maity, Arya Mazumdar, and Kannan Ramchandran. Escaping Saddle Points in Distributed Newton's Method with Communication Efficiency and Byzantine Resilience. arXiv preprint arXiv:2103.09424, 2020c. Eduard Gorbunov, Konstantin Burlachenko, Zhize Li, and Peter Richtárik. MARINA: Faster non-convex distributed learning with compression. *arXiv preprint arXiv:2102.07845*, 2021a. Eduard Gorbunov, Filip Hanzely, and Peter Richtárik. Local SGD: Unified theory and new efficient methods. In *International Conference on Artificial Intelligence and Statistics (AISTATS)*, 2021b. Robert Gower and Peter Richtárik. Stochastic dual ascent for solving linear systems. *arXiv preprint:* arXiv:1512.06890, 2015. Robert M. Gower and Peter Richtárik. Randomized quasi-newton updates are linearly convergent matrix inversion algorithms. *SIAM Journal on Matrix Analysis and Applications*, 38(4):1380–1409, 2017. Vipul Gupta, Avishek Ghosh, Michal Derezinski, Rajiv Khanna, Kannan Ramchandran, and Michael Mahoney. LocalNewton: Reducing Communication Bottleneck for Distributed Learning. In 37th Conference on Uncertainty in Artificial Intelligence (UAI 2021), 2021. Filip Hanzely, Konstantin Mishchenko, and Peter Richtarik. Sega: Variance reduction via gradient sketching. In *Advances in Neural Information Processing Systems*, 2018. Filip Hanzely, Nikita Doikov, Peter Richtárik, and Yurii Nesterov. Stochastic subspace cubic newton method. arXiv preprint: arXiv 2002.09526, 2020. Samuel Horváth, Dmitry Kovalev, Konstantin Mishchenko, Sebastian Stich, and Peter Richtárik. Stochastic distributed learning with gradient quantization and variance reduction. *arXiv preprint arXiv:1904.05115*, 2019. Rustem Islamov, Xun Qian, and Peter Richtárik. Distributed second order methods with fast rates and compressed communication. *International Conference on Machine Learning (ICML)*, 2021. Peter Kairouz et al. Advances and open problems in federated learning. *arXiv preprint arXiv:1912.04977*, 2019. S. P. Karimireddy, Q. Rebjock, S. Stich, and M. Jaggi. Error feedback fixes SignSGD and other gradient compression schemes. *36th International Conference on Machine Learning (ICML)*, 2019. Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank J. Reddi, Sebastian U. Stich, and Ananda Theertha Suresh. SCAFFOLD: Stochastic controlled averaging for on-device federated learning. In *International Conference on Machine Learning (ICML)*, 2020. Sai Praneeth Karimireddy, Lie He, and Martin Jaggi. Learning from History for Byzantine Robust Optimization. *International Conference on Machine Learning (ICML)*, 2021. Sai Praneeth Karimireddy, Lie He, and Martin Jaggi. Byzantine-Robust Learning on Heterogeneous Datasets via Bucketing. *International Conference on Learning Representations (ICLR)*, 2022. Anastasia Koloskova, Sebastian Stich, and Martin Jaggi. Decentralized stochastic optimization and gossip algorithms with compressed communication. Proceedings of the 36th International Conference on Machine Learning, volume 97, pp. 3478–3487. PMLR, 2019. Anastasia Koloskova, Tao Lin, Sebastian U Stich, and Martin Jaggi. Decentralized deep learning with arbitrary communication compression. *International Conference on Learning Representations*, 2020. Jakub Konečný, H. Brendan McMahan, Daniel Ramage, and Peter Richtárik. Federated optimization: Distributed machine learning for on-device intelligence. *arXiv preprint arXiv:1610.02527*, 2016a. Jakub Konečný, H. Brendan McMahan, Felix Yu, Peter Richtárik, Ananda Theertha Suresh, and Dave Bacon. Federated learning: strategies for improving communication efficiency. In NIPS Private Multi-Party Machine Learning Workshop, 2016b. Dmitry Kovalev, Konstanting Mishchenko, and Peter Richtárik. Stochastic Newton and cubic Newton methods with simple local linear-quadratic rates. In *NeurIPS Beyond First Order Methods Workshop*, 2019. Dmitry Kovalev, Anastasia Koloskova, Martin Jaggi, Peter Richtárik, and Sebastian U. Stich. A linearly convergent algorithm for decentralized optimization: sending less bits for free! *The 24th International* Conference on Artificial Intelligence and Statistics (AISTATS), 2021. Jason D. Lee, Qihang Lin, Tengyu Ma, and Tianbao Yang. Distributed Stochastic Variance Reduced Gradient Methods by Sampling Extra Data with Replacement. Journal of Machine Learning Research, vilume 18, pages 1-43, 2017. Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: challenges, methods, and future directions. *IEEE Signal Processing Magazine*, 37(3):50–60, 2020a. doi: 10.1109/MSP.2020. 2975749. Zhize Li, Dmitry Kovalev, Xun Qian, and Peter Richtárik. Acceleration for compressed gradient descent in distributed and federated optimization. In *International Conference on Machine Learning*, 2020b. Chieh-Yen Lin, Cheng-Hao Tsai, Ching pei Lee, and Chih-Jen Lin. Large-scale logistic regression and linear support vector machines using spark. *2014 IEEE International Conference on Big Data (Big Data)*, pp. 519–528, 2014. H Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Agüera y Arcas. Communication-efficient learning of deep networks from decentralized data. In *Proceedings of the 20th* International Conference on Artificial Intelligence and Statistics (AISTATS), 2017. Konstantin Mishchenko, Eduard Gorbunov, Martin Takáč, and Peter Richtárik. Distributed learning with compressed gradient differences. *arXiv preprint arXiv:1901.09269*, 2019. Konstantin Mishchenko, Grigory Malinovsky, Sebastian Stich, and Peter Richtárik. ProxSkip: Yes! Local gradient steps provably lead to communication acceleration! Finally! 39th International Conference on Machine Learning (ICML), 2022. Giorgi Nadiradze, Amirmojtaba Sabour, Peter Davies, Shigang Li, and Dan Alistarh. Asynchronous decentralized SGD with quantized and local updates. *35th Conference on Neural Information Processing* Systems, 2021a. Giorgi Nadiradze, Amirmojtaba Sabour, Peter Davies, Shigang Li, and Dan Alistarh. Asynchronous decentralized SGD with quantized and local updates. *Advances in Neural Information Processing Systems*, 2021b. Barak A. Pearlmutter. Fast exact multiplication by the hessian. *Neural Computation*, 1994. Xun Qian, Peter Richtárik, and Tong Zhang. Error compensated distributed SGD can be accelerated. *35th* Conference on Neural Information Processing Systems, 2021. Xun Qian, Rustem Islamov, Mher Safaryan, and Peter Richtárik. Basis matters: Better communicationefficient second order methods for federated learning. In Proceedings of the 24th International Conference on Artificial Intelligence and Statistics (AISTATS), 2022. Sashank J. Reddi, Jakub Konečný, Peter Richtárik, Barnabás Póczos, and Alexander J. Smola. AIDE: Fast and communication efficient distributed optimization. *CoRR*, abs/1608.06879, 2016. Peter Richtárik and Martin Takac. Stochastic reformulations of linear systems: algorithms and convergence theory. *arXiv preprint: arXiv:1706.01108*, 2017. Peter Richtárik, Igor Sokolov, and Ilyas Fatkhullin. Ef21: A new, simpler, theoretically better, and practically faster error feedback. *35th Conference on Neural Information Processing Systems*, 2021. Peter Richtárik, Igor Sokolov, Ilyas Fatkhullin, Elnur Gasanov, Zhize Li, and Eduard Gorbunov. 3pc: Three point compressors for communication-efficient distributed training and a better theory for lazy aggregation. 39th International Conference on Machine Learning (ICML), 2022. Fred Roosta, Yang Liu, Peng Xu, and Michael W. Mahoney. Newton-MR: Newton's Method Without Smoothness or Convexity. *arXiv preprint arXiv:1810.00303*, 2019. Mher Safaryan, Rustem Islamov, Xun Qian, and Peter Richtárik. FedNL: Making Newton-Type Methods Applicable to Federated Learning. *39th International Conference on Machine Learning (ICML)*, 2022. Atal Narayan Sahu, Aritra Dutta, Ahmed M. Abdelmoniem, Trambak Banerjee, Marco Canini, and Panos Kalnis. Rethinking gradient sparsification as total error minimization. 35th Conference on Neural Information Processing Systems, 2021. Ohad Shamir, Nati Srebro, and Tong Zhang. Communication-effcient distributed optimization using an approximate newton-type method. In Proceedings of the 31th International Conference on Machine Learning, volume 32, pp. 1000–1008, 2014. Hossein Shokri Ghadikolaei, Sebastian Stich, and Martin Jaggi. Lena: Communication-efficient distributed learning with self-triggered gradient uploads. In Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, 2021. S. U. Stich, J.-B. Cordonnier, and M. Jaggi. Sparsified SGD with memory. In *Advances in Neural Information* Processing Systems (NeurIPS), 2018a. Sebastian U. Stich. Local SGD converges fast and communicates little. In *International Conference on* Learning Representations (ICLR), 2020. Sebastian U Stich, Jean-Baptiste Cordonnier, and Martin Jaggi. Sparsified SGD with memory. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 4452–4463. Curran Associates, Inc., 2018b. J. Sun, T. Chen, G. Giannakis, and Z. Yang. Communication-efficient distributed learning via lazily aggregated quantized gradients. *Advances in Neural Information Processing Systems, 32:3370–3380*, 2019a. Jun Sun, Tianyi Chen, Georgios Giannakis, and Zaiyue Yang. Communication-efficient distributed learning via lazily aggregated quantized gradients. In *Advances in Neural Information Processing Systems*, 2019b. Alexander Tyurin and Peter Richtárik. Distributed nonconvex optimization with communication compression, optimal oracle complexity, and no client synchronization. *arXiv preprint arXiv:2202.01268*, 2022. Shusen Wang, Fred Roosta abd Peng Xu, and Michael W Mahoney. GIANT: Globally improved approximate Newton method for distributed optimization. In Advances in Neural Information Processing Systems (NeurIPS), 2018. Jianqiao Wangni, Jialei Wang, Ji Liu, and Tong Zhang. Gradient sparsification for communication-efficient distributed optimization. In *Advances in Neural Information Processing Systems*, pp. 1306–1316, 2018. Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In *Advances in Neural Information* Processing Systems, pp. 1509–1519, 2017. Haibo Yang, Minghong Fang, and Jia Liu. Achieving Linear Speedup with Partial Worker Participation in Non-IID Federated Learning. *International Conference on Learning Representations (ICLR)*, 2021. Jiaqi Zhang, Keyou You, and Tamer Basar. Distributed adaptive Newton methods with globally superlinear convergence. *arXiv preprint arXiv:2002.07378*, 2020a. Jiaqi Zhang, Keyou You, and Tamer Başar. Achieving globally superlinear convergence for distributed optimization with adaptive newton method. In *2020 59th IEEE Conference on Decision and Control* (CDC), pp. 2329–2334, 2020b. doi: 10.1109/CDC42340.2020.9304321. Yuchen Zhang and Lin Xiao. DiSCO: Distributed optimization for self-concordant empirical loss. In In Proceedings of the 32nd International Conference on Machine Learning, PMLR, volume 37, pages 362–370, 2015. Yong Zhuang, Wei-Sheng Chin, Yu-Chin Juan, and Chih-Jen Lin. Distributed newton methods for regularized logistic regression. In Tru Cao, Ee-Peng Lim, Zhi-Hua Zhou, Tu-Bao Ho, David Cheung, and Hiroshi Motoda (eds.), *Advances in Knowledge Discovery and Data Mining*, pp. 690–703, Cham, 2015. Springer International Publishing. ISBN 978-3-319-18032-8. ## A Appendix B Limitations Here we discuss key limitations of our work and areas that are not explored in this paper. - Developed theoretical claims are for strongly convex loss functions. The globalization mechanism with cubic regularization can be anaylized for convex functions as well, but we do not consider non-convex objectives in this work. - Our methods are analyzed in the regime when the exact local gradients and exact local Hessians of local loss functions are computed for all participating devices. We do not consider stochastic gradient or stochastic Hessian oracles of local loss functions in our analyses. However, when we use sketch-and-project operator we rely on Hessian-vector products which does not require full Hessian computations. ## C Detailed Literature Review Of Second-Order Methods In this section we provide more detailed literature review of second-order methods. The comparison is made based on the most relevant prior works in the literature highlighting main differences over our work. The comparison is performed based on criterias including generality of the considered problem structure, assumptions made on the (local) loss functions, communication complexity per iteration, theoretical convergence guarantees and other aspects of the method. - GIANT (Wang et al., 2018) and NL (Islamov et al., 2021) are not designed to handle a general finite sum problem. In contrast to our work, they only work with Generalized Linear models. - Communication costs per iteration of DAN (Zhang et al., 2020a) and Quantized Newton (Alimisis et al., 2021) are significantly high which make them impractical. - NL (Islamov et al., 2021) directly reveals local data in each iteration which breaks privacy preserving guarantees. - The drawback of GIANT, DINGO is in their convergence rates which depend on the condition number of the problem. In some cases theoretical convergence guarantees are even worse than those of first-order methods. DANE (Shamir et al., 2014) and AIDE (Reddi et al., 2016) suffer from the same problem because those methods are first-order methods. - The first drawback of FLECS (Agafonov et al., 2022) is that SVD decomposition is needed in each step to perform a truncation which means that the computation cost of those methods can not be reduced. Besides, there is no good local theory for that method; the only convergence guarantee is derived under the assumption that the iterates remain close to the optimum. Next, convergence of FLECS and FLECS-SGD depend on the product of the condition number and truncation parameters. For example, using the same truncation parameters as in their experiments, the convergence guarantees are of the order 1022κ, where κ is the condition number. Finally, they need backtracking line search or other learning techniques with additional parameters to perform one step of the methods. - Fib-IOS (Fabbro et al., 2022) introduces Newton-type method based on SVD decomposition which means that similarly to FLECS the computation cost can not be reduced. Besides, this approach is also restricted to rank-type compression only, and consequently does not support popular compression techniques such as Top-K or Rand-K. On top of that, Fib-IOS always requires backtracking line search technique to find appropriate stepsize. - GIANT and DANE work well only in homogeneous setting while in practice the problem could be significantly heterogeneous. In our work we do not make any assumptions on heterogeneity of the problem. - While convergence guarantees of FedNL (Safaryan et al., 2022) and Newton-3PC are the same (fast local linear/superlinear rates independent of the condition number) there are several points that make our work superior: (i) FedNL can be seen as a special case of Newton-3PC; (ii) we provide much wider compression mechanisms going beyond those proposed in (Safaryan et al., 2022); (iii) we propose two ways how to reduce computation costs (lazy aggregation and sketching) of Newton-3PC. ## D More On Sketch-And-Project Mechanism Sketch-and-project operator has been widely studied as a technique to solve linear systems (Richtárik & Takac, 2017; Gower & Richtárik, 2015), an application to first-order methods (Hanzely et al., 2018). Besides, Gower & Richtárik (2017) showed that various Quasi-Newton updates can be seen as a special case of sketch-and-project mechanism. Let us now describe it in more details. For this reason, we introduce an arbitrary twice differentiable function φ : R d → R. Our desire is to compute an approximation of its Hessian ∇2φ at point x. Let X0 be the first approximation of ∇2φ(x). Then we define a sequence {Xk} that approximates ∇2φ(x) better and better as k goes to infinity solving the following optimization problem $$\mathbf{X}_{k+1}:=\operatorname{argmin}_{\mathbf{X}\in\mathbb{R}^{d\times d}}{\frac{1}{2}}\|\mathbf{X}-\mathbf{X}_{k}\|_{\mathrm{F}}^{2}\quad{\mathrm{s.t.}}\quad\mathbf{S}^{\top}\nabla^{2}\varphi(x)=\mathbf{S}^{\top}\mathbf{X},$$ where S ∈ R d×τis a random matrix drawn in i.i.d. fashion from a fixed distribution D. To solve this problem we define a function vec(A) = (A11, . . . , Ad1, A12, . . . , Ad2, . . . , A1d*, . . . ,* Add) ⊤. Moreover, we need to define an extended sketch matrix S˜ of the form $$\left(14\right)$$ $${\tilde{\mathbf{S}}}:={\begin{pmatrix}\mathbf{S}&\mathbf{0}&\dots&\mathbf{0}\\ \mathbf{0}&\mathbf{S}&\dots&\mathbf{0}\\ \vdots&\vdots&\ddots&\vdots\\ \mathbf{0}&\mathbf{0}&\dots&\mathbf{S}\end{pmatrix}}\in\mathbb{R}^{d^{2}\times d\tau}.$$ $$(15)$$ Using (15), we can reformulate (14) as follows $$\operatorname{vec}(\mathbf{X}_{k+1})=\arg$$ vec(Xk+1) = argminX∥vec(X) − vec(Xk)∥ $${\tilde{\mathbf{S}}}^{\top}\operatorname{vec}(\mathbf{X})={\tilde{\mathbf{S}}}^{\top}\operatorname{vec}(\nabla^{2}\varphi(x)).$$ The latter has an explicit solution (Hanzely et al., 2018) of the following form $$\operatorname{c}(\mathbf{X})-\operatorname{vec}(\mathbf{X}$$ $$\operatorname{vec}(\mathbf{X}_{k+1})=\operatorname{vec}(\mathbf{X}_{k})+{\tilde{\mathbf{Z}}}(\operatorname{vec}(\nabla^{2}\varphi(x))-\operatorname{vec}(\mathbf{X}_{k})),$$ vec(Xk+1) = vec(Xk) + Z˜(vec(∇2φ(x)) − vec(Xk)), (17) where Z˜ := S˜(S˜⊤S˜) †S˜⊤. It is easy to show that Z˜ can be rewritten as follows $$(16)^{3}$$ $$\left(17\right)$$ $${\tilde{\mathbf{Z}}}={\begin{pmatrix}\mathbf{Z}&\mathbf{0}&\dots&\mathbf{0}\\ \mathbf{0}&\mathbf{Z}&\dots&\mathbf{0}\\ \vdots&\vdots&\ddots&\vdots\\ \mathbf{0}&\mathbf{0}&\dots&\mathbf{Z}\end{pmatrix}}\,,$$ $$(18)$$ , (18) where Z := S(S ⊤S) †S ⊤ is a projection matrix onto the range of a sketch S. Since it is not clear how to compute the process (17), we rewrite it explicitly as $$\mathbf{X}_{k+1}=\mathbf{X}_{k}+\mathbf{S}(\mathbf{S}^{\mathsf{T}}\mathbf{S})^{\dagger}(\nabla^{2}\varphi(x)-\mathbf{X}_{k}).$$ The way in which the above formula is written resembles the update from (Safaryan et al., 2022). ## E Deferred Proofs From Section 3 And New 3Pc Compressors E.1 Proof Of Lemma 3.4: Adaptive Thresholding Basically, we show two upper bounds for the error and combine them to get the expression for α. From the definition (5), we get $$\|{\mathcal{C}}({\bf X})-{\bf X}\|_{\mathrm{F}}^{2}=\sum_{j,l:\|{\bf X}_{j l}\|<\lambda\|{\bf X}\|_{\infty}}{\bf X}_{j l}^{2}\leq d^{2}\lambda^{2}\|{\bf X}\|_{\infty}^{2}\leq d^{2}\lambda^{2}\|{\bf X}\|_{\mathrm{F}}^{2}.$$ The second inequality is derived from the observation that at least on entry, the top one in magnitude, is selected always. Since the top entry is missing in the sum below, we imply that the average without the top one is smaller than the overall average. $$\|{\mathcal{C}}({\bf X})-{\bf X}\|_{\mathrm{F}}^{2}=\sum_{j,l:\|{\bf X}_{j l}\|<\lambda\|{\bf X}\|_{\infty}}{\bf X}_{j l}^{2}\leq\frac{d^{2}-1}{d^{2}}\sum_{j,l=1}^{d}{\bf X}_{j l}^{2}\leq\left(1-\frac{1}{d^{2}}\right)\|{\bf X}\|_{\mathrm{F}}^{2}.$$ ## E.2 Proof Of Lemma 3.6: Sketch-And-Project Note that since Z is a projection matrix, then it is symmetric and satisfies $$\begin{array}{r c l}{{\mathbf{Z}\mathbf{Z}}}&{{=}}&{{\mathbf{S}(\mathbf{S}^{\top}\mathbf{S})^{\dagger}\mathbf{S}^{\top}\mathbf{S}(\mathbf{S}^{\top}\mathbf{S})^{\dagger}\mathbf{S}^{\top}}}\\ {{}}&{{}}&{{=}}&{{\mathbf{S}(\mathbf{S}^{\top}\mathbf{S})^{\dagger}\mathbf{S}^{\top}=\mathbf{Z},}}\end{array}$$ As a consequence, its eigenvalues are between 0 and 1. Assuming that X is symmetric we derive E -∥ZX − X∥ 2 F = E-∥ZX∥ 2 F − 2 ⟨ZX, X⟩+ ∥X∥ 2 F = E-Tr(X⊤Z ⊤ZX)− 2 ⟨E [Z] X, X⟩ + ∥X∥ 2 F = E [⟨X, ZX⟩] − 2 ⟨E [Z] X, X⟩ + ∥X∥ 2 F = ∥X∥ 2 F − Tr(X⊤E [Z] X) ≤ (1 − λ + min(Z))∥X∥ 2 F. Note that we can force X to be symmetric in the same way as it was done in (Qian et al., 2022) by using symmetrization operator [X]s = 1 2 (X + X⊤) which does not change the theory. ## E.3 Proof Of Lemma 3.10: Compressed Bernoulli Aggregation (Cbag) As it was mentioned CBAG has two independent sources of randomness: Bernoulli aggregation and possible random contractive compression. To show that CBAG is a 3PC mechanism, we consider these randomness one by one and upper bound the error as follows: $$\mathbb{E}\left[\left\|{\mathcal{C}}_{\mathbf{H},\mathbf{Y}}(\mathbf{X})-\mathbf{X}\right\|^{2}\right]$$ $$=(1-p)\|{\bf H}-{\bf X}\|^{2}+p{\mathbb{E}}\left[\|{\cal C}({\bf X}-{\bf H})-({\bf X}-{\bf H})\|^{2}\right]$$ $$\leq(1-p)\|{\bf X}-{\bf H}\|^{2}+p(1-\alpha)\|{\bf X}-{\bf H}\|^{2}$$ $$=(1-p\alpha)\|{\bf X}-{\bf H}\|^{2}$$ $$\leq(1-p\alpha)(1+s)\|{\bf H}-{\bf Y}\|^{2}+(1-p\alpha)(1+1/s)\|{\bf X}-{\bf Y}\|^{2}.$$ ## E.4 New 3Pc: Adaptive Top-K Assume that in our framework we are restricted by the number of floats we can send from clients to the server. For example, each client is able to broadcast d0 ≤ d 2 floats to the server. Besides, we want to use Top-K compression operator with adaptive K, but due to the aforementioned restrictions we should control how K evolves. Let KH,Y be such that $$K_{\mathbf{H},\mathbf{Y}}=\operatorname*{min}\left\{\left[{\frac{\|\mathbf{Y}-\mathbf{H}\|_{\mathrm{F}}^{2}}{\|\mathbf{X}-\mathbf{H}\|_{\mathrm{F}}^{2}}}d^{2}\right],d_{0}\right\}.$$ We introduce the following compression operator $${\mathcal{C}}_{\mathbf{H},\mathbf{Y}}(\mathbf{X}):=\mathbf{H}+\mathrm{{Top-}}K_{\mathbf{H},\mathbf{Y}}\left(\mathbf{X}-\mathbf{H}\right).$$ CH,Y(X) := H + Top-KH,Y (X − H). (19) The next lemma shows that the described compressor satisfy (3). Lemma E.1. *The compressor* CY,H (19) *satisfy* (3) *with* $$A=\frac{d_{0}}{2d^{2}},\quad B=\operatorname*{max}\left\{\left(1-\frac{d_{0}}{d^{2}}\right)\left(\frac{2d^{2}}{d_{0}}-1\right),3\right\}.$$ $$(19)^{\frac{1}{2}}$$ Proof. Recall that if C is a Top-K compressor, then for all X ∈ R d×d $$\|{\mathcal{C}}(\mathbf{X})-\mathbf{X}\|_{\mathrm{{F}}}^{2}\leq\left(1-{\frac{K}{d^{2}}}\right)\|\mathbf{X}\|_{\mathrm{{F}}}^{2}\,,$$ Using this property we get in the case when KY,H = d0 ∥CH,Y(X) − X∥ 2 F = ∥H + Top-KH,Y(X − H) − X∥ 2 F ≤ 1 − d0 d 2 ∥H − X∥ 2 F ≤ 1 − d0 2d 2 ∥H − Y∥ 2 F + 1 − d0 d 2 2d 2 − d0 d0∥Y − X∥ 2 F . If KH,Y = l∥Y−H∥ 2 F ∥X−H∥ 2 F d 2m, then −KH,Y ≤ −∥Y−H∥ 2 F ∥X−H∥ 2 F d 2, and we have ∥CH,Y(X) − X∥ 2 F = ∥H + Top-KH,Y(X − H) − X∥ 2 F ≤ 1 − KH,Y d 2 ∥H − X∥ 2 F ≤ 1 − ∥Y − H∥ 2 F ∥X − H∥ 2 F ! ∥H − X∥ 2 F = ∥H − X∥ 2 F − ∥Y − H∥ 2 F ≤ 3 2 ∥H − Y∥ 2 F + 3 ∥Y − X∥ 2 F − ∥Y − H∥ 2 F = 1 2 ∥Y − H∥ 2 F + 3 ∥Y − X∥ 2 F , where in the last inequality we use Young's inequality. Since we always have d0 2d2 (because d0 ≤ d 2), then A = d0 2d2 . ## E.5 New 3Pc: Rotation Compression Qian et al. (2022) proposed a novel idea to change the basis in the space of matrices that allows to apply more aggresive compression mechanism. Following Section 2.3 from (Qian et al., 2022) one can show that for Generalized Linear Models local Hessians can be represented as ∇2fi(x) = QiΛi(x)Q⊤ i , where Qiis properly designed basis matrix. This means that Qiis orthogonal matrix. Their idea is based on the fact that Λi(x) is potentially sparser matrix than ∇2fi(x), and applying compression on Λi(x) could require smaller compression level to obtain the same results than applying compression on dense standard representation ∇2fi(x). We introduce the following compression based on this idea. Let C be an arbitrary contractive compressor with parameter α, and Q be an orthogonal matrix, then our new compressor is defined as follows $${\mathcal{C}}_{\mathbf{H},\mathbf{Y}}(\mathbf{X}):=\mathbf{H}+\mathbf{Q}{\mathcal{C}}\left(\mathbf{Q}^{\top}(\mathbf{X}-\mathbf{H})\mathbf{Q}\right)\mathbf{Q}^{\top}.\tag{1}$$ Now we prove that this compressor satisfy (3). Lemma E.2. *The compressor* CH,Q (20) based on a contractive compressor C *with parameter* α ∈ (0, 1] satisfy (3) with A = α/2 and B = (1 − α) ((2−α)/α). Proof. From the definition of contractive compressor $$\mathbb{E}\left[\|{\mathcal{C}}(\mathbf{X})-\mathbf{X}\|_{\mathrm{F}}^{2}\right]\leq(1-\alpha)\,\|\mathbf{X}\|_{\mathrm{F}}^{2}\,.$$ $$(20)$$ Thus, we get E h∥CH,Y(X) − X∥ 2 F i= E hQCQ⊤(X − H)QQ⊤ − (X − H) 2 F i = E hQCQ⊤(X − H)QQ⊤ − QQ⊤(X − H)QQ⊤ 2 F i = E hCQ⊤(X − H)Q− Q⊤(X − H)Q 2 F i ≤ (1 − α)Q⊤(X − H)Q 2 F = (1 − α) ∥X − H∥ 2 F ≤ (1 − α)(1 + β) ∥Y − H∥ 2 F + (1 − α)(1 + β −1) ∥Y − X∥ 2 F , where we use the fact that an orthogonal matrix doesn't change a norm. Let β =α 2(1−α) , then $$\mathbb{E}\left[\left\|\mathcal{C}_{\mathbf{H},\mathbf{Y}}(\mathbf{X})-\mathbf{X}\right\|_{\mathrm{F}}^{2}\right]\leq\left(1-\frac{\alpha}{2}\right)\left\|\mathbf{Y}-\mathbf{H}\right\|_{\mathrm{F}}^{2}+\left(1-\alpha\right)\left(\frac{2-\alpha}{\alpha}\right)\left\|\mathbf{Y}-\mathbf{X}\right\|_{\mathrm{F}}^{2}.\tag{21}$$ ## F Deferred Proofs From Section 4 (Newton-3Pc) F.1 Auxiliary Lemma Denote by Ek+1[·] the conditional expectation given (k + 1)th iterate x k+1. We first develop a lemma to handle the mismatch Ek∥Hk+1 i − ∇2fi(x ∗)∥ 2 F of the estimate Hk+1 idefined via 3PC compressor. Lemma F.1. *Assume that*x k+1 − x ∗ 2≤ 1 2 x k − x ∗ 2for all k ≥ 0*. Then* $$\mathbb{E}_{k+1}\left[\|\mathbf{H}_{i}^{k+1}-\nabla^{2}f_{i}(x^{\star})\|_{\mathrm{F}}^{2}\right]\leq\left(1-\frac{A}{2}\right)\|\mathbf{H}_{i}^{k}-\nabla^{2}f_{i}(x^{\star})\|_{\mathrm{F}}^{2}+\left(\frac{1}{A}+3B\right)L_{\mathrm{F}}^{2}\|x^{k}-x^{\star}\|_{\mathrm{F}}^{2}.$$ Proof. Using the defining inequality of 3PC compressor and the assumption of the error in terms of iterates, we expand the approximation error of the estimate Hk+1 ias follows: Ek+1 -∥Hk+1 i − ∇2fi(x ∗)∥ 2 F = Ek+1 h∥CHk i ,∇2fi(xk) ∇2fi(x k+1)− ∇2fi(x ∗)∥ 2 F i ≤ (1 + β)Ek+1 h∥CHk i ,∇2fi(xk) ∇2fi(x k+1)− ∇2fi(x k+1)∥ 2 F i+ (1 + 1/β)∥∇2fi(x k+1) − ∇2fi(x ∗)∥ 2 F ≤ (1 + β)(1 − A)∥Hk i − ∇2fi(x k)∥ 2 F + B∥∇2fi(x k+1) − ∇2fi(x ∗)∥ 2 F + (1 + 1/β)∥∇2fi(x k+1) − ∇2fi(x ∗)∥ 2 F ≤ (1 + β)(1 − A)∥Hk i − ∇2fi(x k)∥ 2 F +2B∥∇2fi(x k) − ∇2fi(x ∗)∥ 2 F + (1 + 1/β + 2B)∥∇2fi(x k+1) − ∇2fi(x ∗)∥ 2 F ≤ (1 + β)(1 − A)∥Hk i − ∇2fi(x k)∥ 2 F +2BL2F∥x k − x ∗∥ 2 F + (1 + 1/β + 2B)L 2 F∥x k+1 − x ∗∥ 2 F ≤ (1 + β)(1 − A)∥Hk i − ∇2fi(x k)∥ 2 F + β + 1 2β+ 3B L 2 F∥x k − x ∗∥ 2 F. where we use Young's inequality for some β > 0. By choosing β =A 2(1−A) when 0 *< A <* 1, we get $$\mathbb{E}_{k+1}\left[\|\mathbf{H}_{i}^{k+1}-\nabla^{2}f_{i}(x^{*})\|_{\mathbb{F}}^{2}\right]\leq\left(1-\frac{A}{2}\right)\|\mathbf{H}_{i}^{k}-\nabla^{2}f_{i}(x^{*})\|_{\mathbb{F}}^{2}+\left(\frac{1}{A}+3B-\frac{1}{2}\right)L_{\mathbb{F}}^{2}\|x^{k}-x^{*}\|_{\mathbb{F}}^{2}$$ $\mathbf{m}$$A=1$$m$\(\mathbf{m}\ When A = 1, we can choose β = 1 and have $$\mathbb{E}_{k+1}\left[\|\mathbf{H}_{i}^{k+1}-\nabla^{2}f_{i}(x^{*})\|_{\mathrm{F}}^{2}\right]\leq\left(3B+1\right)L_{\mathrm{F}}^{2}\|x^{k}-x^{*}\|_{\mathrm{F}}^{2}.$$ Thus, for all 0 < A ≤ 1 we get the desired bound. ## F.2 Proof Of Theorem 4.2 The proof follows the same steps as for FedNL until the appearance of 3PC compressor. We derive recurrence relation for ∥x k − x ∗∥ 2covering both options of updating the global model. If *Option 1.* is used in FedNL, then ∥x k+1 − x ∗∥ 2 =x k − x ∗ −-Hkµ −1∇f(x k) 2 ≤-Hkµ −1 2Hkµ (x k − x ∗) − ∇f(x k)) 2 ≤2 µ2 Hkµ − ∇2f(x ∗)(x k − x ∗) 2+∇2f(x ∗)(x k − x ∗) − ∇f(x k) + ∇f(x ∗) 2 =2 µ2 Hkµ − ∇2f(x ∗)(x k − x ∗) 2+∇f(x k) − ∇f(x ∗) − ∇2f(x ∗)(x k − x ∗) 2 ≤2 µ2 Hkµ − ∇2f(x ∗) 2∥x k − x ∗∥ 2 + L 2∗ 4 ∥x k − x ∗∥ 4 =2 µ2 ∥x k − x ∗∥ 2 Hkµ − ∇2f(x ∗) 2+ L 2∗ 4 ∥x k − x ∗∥ 2 ≤2 µ2 ∥x k − x ∗∥ 2 Hk − ∇2f(x ∗) 2+ L 2∗ 4 ∥x k − x ∗∥ 2 ≤2 µ2 ∥x k − x ∗∥ 2 Hk − ∇2f(x ∗) 2 F + L 2∗ 4 ∥x k − x ∗∥ 2 , where we use Hkµ ⪰ µI in the second inequality, and ∇2f(x ∗) ⪰ µI in the fourth inequality. From the convexity of *∥ · ∥*2F , we have $$\|\mathbf{H}^{k}-\nabla^{2}f(x^{*})\|_{\mathrm{F}}^{2}=\left\|{\frac{1}{n}}\sum_{i=1}^{n}\left(\mathbf{H}_{i}^{k}-\nabla^{2}f_{i}(x^{*})\right)\right\|_{\mathrm{F}}^{2}\leq{\frac{1}{n}}\sum_{i=1}^{n}\|\mathbf{H}_{i}^{k}-\nabla^{2}f_{i}(x^{*})\|_{\mathrm{F}}^{2}=\mathcal{H}^{k}.$$ Thus, $$\|x^{k+1}-x^{*}\|^{2}\leq\frac{2}{\mu^{2}}\|x^{k}-x^{*}\|^{2}\mathcal{H}^{k}+\frac{L_{*}^{2}}{2\mu^{2}}\|x^{k}-x^{*}\|^{4}.$$ $$\left(\begin{array}{c}22\\ \end{array}\right)$$... If *Option 2.* is used in FedNL, then as Hk + l kI ⪰ ∇2f(x k) ⪰ µI and ∇f(x ∗) = 0, we have $$\|x^{k+1}-x$$ ∗∥ = ∥x k − x ∗ − [Hk + l kI] −1∇f(x k)∥ ≤ ∥[Hk + l kI] −1∥ · ∥(Hk + l kI)(x k − x ∗) − ∇f(x k) + ∇f(x ∗)∥ ≤ 1 µ ∥(Hk + l kI − ∇2f(x ∗))(x k − x ∗)∥ + 1 µ ∥∇f(x k) − ∇f(x ∗) − ∇2f(x ∗)(x k − x ∗)∥ ≤ 1 µ ∥Hk + l kI − ∇2f(x ∗)∥∥x k − x ∗∥ + L∗ 2µ ∥x k − x ∗∥ 2 ≤1 nµ Xn i=1 ∥Hk i + l k i I − ∇2fi(x ∗)∥∥x k − x ∗∥ + L∗ 2µ ∥x k − x ∗∥ 2 ≤1 nµ Xn i=1 (∥Hk i − ∇2fi(x ∗)∥ + l k i )∥x k − x ∗∥ + L∗ 2µ ∥x k − x ∗∥ 2. From the definition of l k i , we have $l_{i}^{k}=\|{\bf H}_{i}^{k}-\nabla^{2}f_{i}(x^{k})\|_{\rm F}\leq\|{\bf H}_{i}^{k}-\nabla^{2}f_{i}(x^{*})\|_{\rm F}+L_{\rm F}\|x^{k}-x^{*}\|$. Thus, $$\|x^{k+1}-x^{*}\|\leq\frac{2}{n\mu}\sum_{i=1}^{n}\|\mathbf{H}_{i}^{k}-\nabla^{2}f_{i}(x^{*})\|_{\mathrm{F}}\|x^{k}-x^{*}\|+\frac{L_{*}+2L_{\mathrm{F}}}{2\mu}\|x^{k}-x^{*}\|^{2}.$$ In addition, we further discuss. From Young's inequality, we further have ing a inequality, we find that have $$\begin{split}\|x^{k+1}-x^*\|^2&\leq\frac{8}{\mu^2}\left(\frac{1}{n}\sum_{i=1}^n\|\mathbf{H}_i^k-\nabla^2f_i(x^*)\|x\|x^k-x^*\|\right)^2+\frac{(L_*+2L_F)^2}{2\mu^2}\|x^k-x^*\|^4\\ &\leq\frac{8}{\mu^2}\|x^k-x^*\|^2\left(\frac{1}{n}\sum_{i=1}^n\|\mathbf{H}_i^k-\nabla^2f_i(x^*)\|_F^2\right)+\frac{(L_*+2L_F)^2}{2\mu^2}\|x^k-x^*\|^4\\ &=\frac{8}{\mu^2}\|x^k-x^*\|^2\mu^k+\frac{(L_*+2L_F)^2}{2\mu^2}\|x^k-x^*\|^4,\end{split}\tag{23}$$ we the convexity of $\|x\|^2$ in the second inequality. where we use the convexity of *∥ · ∥*2F in the second inequality. Thus, from (22) and (23), we have the following unified bound for both *Option 1* and *Option 2*: $$\|x^{k+1}-x^{*}\|^{2}\leq\frac{C}{\mu^{2}}\|x^{k}-x^{*}\|^{2}{\mathcal{H}}^{k}+\frac{D}{2\mu^{2}}\|x^{k}-x^{*}\|^{4}.$$ Assume ∥x 0 − x ∗∥ 2 ≤ µ 2 2D and Hk ≤ µ 2 4C for all k ≥ 0. Then we show that ∥x k − x ∗∥ 2 ≤ µ 2 2D for all k ≥ 0 by induction. Assume ∥x k − x ∗∥ 2 ≤ µ 2 2D for all k ≤ K. Then from (24), we have $$\|x^{K+1}-x^{*}\|^{2}\leq\frac{1}{4}\|x^{K}-x^{*}\|^{2}+\frac{1}{4}\|x^{K}-x^{*}\|^{2}\leq\frac{\mu^{2}}{2D}.$$ Thus we have $\|x^{k}-x^{*}\|^{2}\leq\frac{\mu^{2}}{2D}$ and $\mathcal{H}^{k}\leq\frac{\mu^{2}}{4\sigma}$ for $k\geq0$. Using (24) again, we obtain $$\|x^{k+1}-x^{*}\|^{2}\leq\frac{1}{2}\|x^{k}-x^{*}\|^{2}.\tag{25}$$ $$(24)$$ Assume ∥x 0 − x ∗∥ 2 ≤ µ 2 2D and Hk ≤ µ 2 4C for all k ≥ 0. Then we show that ∥x k − x ∗∥ 2 ≤ µ 2 2D for all k ≥ 0 by induction. Assume ∥x k − x ∗∥ 2 ≤ µ 2 2D for all k ≤ K. Then from (24), we have $$\|x^{K+1}-x^{*}\|^{2}\leq\frac{1}{4}\|x^{K}-x^{*}\|^{2}+\frac{1}{4}\|x^{K}-x^{*}\|^{2}\leq\frac{\mu^{2}}{2D}.$$ $x^{k}-x^{*}\|^{2}\leq\frac{\mu^{2}}{2D}$ and $\mathcal{H}^{k}\leq\frac{\mu^{2}}{4C}$ for $k\geq0$. Using (24) again, we obtain $$\|x^{k+1}-x^{*}\|^{2}\leq\frac{1}{2}\|x^{k}-x^{*}\|^{2}.\tag{26}$$ Thus we have ∥x Thus, we derived the first rate of the theorem. Next, we invoke Lemma F.1 to have an upper bound for Hk+1: $$\mathbb{E}_{k}[\mathcal{H}^{k+1}]\leq\left(1-\frac{A}{2}\right)\mathcal{H}^{k}+\left(\frac{1}{A}+3B\right)L_{\mathrm{F}}^{2}\|x^{k}-x^{*}\|^{2}.$$ Using the above inequality and (26), for Lyapunov function Φ k we deduce above inequality and (20), for Lyapunov function $\Psi^{-}$ we deduce $$\mathbb{E}_{k}[\Phi^{k+1}]\leq\left(1-\frac{A}{2}\right)\mathcal{H}^{k}+\left(\frac{1}{A}+3B\right)L_{F}^{2}\|x^{k}-x^{*}\|^{2}+3\left(\frac{1}{A}+3B\right)L_{F}^{2}\|x^{k}-x^{*}\|^{2}$$ $$=\left(1-\frac{A}{2}\right)\mathcal{H}^{k}+\left(1-\frac{1}{3}\right)6\left(\frac{1}{A}+3B\right)L_{F}^{2}\|x^{k}-x^{*}\|^{2}$$ $$\leq\left(1-\min\left\{\frac{A}{2},\frac{1}{3}\right\}\right)\Phi^{k}.$$ Hence Ek[Φk] ≤1 − min A 2 , 1 3 kΦ 0. Clearly, we further have E[Hk] ≤1 − min A 2 , 1 3 kΦ 0 and E[∥x k − x ∗∥ 2] ≤A 6(1+3AB)L2F 1 − min A 2 , 1 3 kΦ 0for k ≥ 0. Assume x k ̸= x ∗for all k. Then from (24), we have $$\frac{\|x^{k+1}-x^{*}\|^{2}}{\|x^{k}-x^{*}\|^{2}}\leq\frac{C}{\mu^{2}}\mathcal{H}^{k}+\frac{D}{2\mu^{2}}\|x^{k}-x^{*}\|^{2},$$ and by taking expectation, we have $$\mathbb{E}\left[\frac{\|x^{k+1}-x^{*}\|^{2}}{\|x^{k}-x^{*}\|^{2}}\right]\leq\frac{C}{\mu^{2}}\mathbb{E}[\mathcal{H}^{k}]+\frac{D}{2\mu^{2}}\mathbb{E}[\|x^{k}-x^{*}\|^{2}]$$ $$\leq\left(1-\min\left\{\frac{A}{2},\frac{1}{3}\right\}\right)^{k}\left(C+\frac{AD}{12(1+3AB)L_{\mathrm{F}}^{2}}\right)\frac{\Phi^{0}}{\mu^{2}},$$ which concludes the proof. ## F.3 Proof Of Lemma 4.3 We prove this by induction. Assume ∥Hk i − ∇2fi(x ∗)∥ 2 F ≤ µ 2 4C and ∥x k − x ∗∥ 2 ≤ e 2 1 for k ≤ K. Then we also have Hk ≤ µ 2 4C for k ≤ K. From (24), we can get $$\|x^{K+1}-x^{*}\|^{2}\leq\frac{C}{\mu^{2}}\|x^{K}-x^{*}\|^{2}\mathcal{H}^{K}+\frac{D}{2\mu^{2}}\|x^{K}-x^{*}\|^{4}$$ $$\leq\frac{1}{4}\|x^{K}-x^{*}\|^{2}+\frac{1}{4}\|x^{K}-x^{*}\|^{2}$$ $$\leq\|x^{K}-x^{*}\|^{2}\leq e_{1}^{2}.$$ Using Lemma F.1 and the assumptions that we use non-random 3PC compressor, we have $$\|\mathbf{H}_{i}^{K+1}-\nabla^{2}f_{i}(x^{*})\|_{\mathrm{F}}^{2}\leq\left(1-\frac{A}{2}\right)\|\mathbf{H}_{i}^{K}-\nabla^{2}f_{i}(x^{*})\|_{\mathrm{F}}^{2}+\frac{1+3AB}{A}L_{\mathrm{F}}^{2}\|x^{K}-x^{*}\|^{2}$$ $$\leq\left(1-\frac{A}{2}\right)\frac{\mu^{2}}{4C}+\frac{1+3AB}{A}L_{\mathrm{F}}^{2}\cdot\frac{A^{2}\mu^{2}}{8(1+3AB)CL_{\mathrm{F}}^{2}}$$ $$=\frac{\mu^{2}}{4C}.$$ ## F.4 Proof Of Lemma 4.4 We prove this by induction. Assume ∥x k − x ∗∥ ≤ e1 and ∥Hk i − ∇2fi(x ∗)∥ 2 F ≤ µ 2 4C for k ≤ K. Then we also have Hk ≤ µ 2 4C for k ≤ K. From (24), we can get $$\|x^{K+1}-x^{*}\|^{2}\leq\frac{C}{\mu^{2}}\|x^{K}-x^{*}\|^{2}{\cal H}^{K}+\frac{D}{2\mu^{2}}\|x^{K}-x^{*}\|^{4}$$ $$\leq\frac{1}{4}\|x^{K}-x^{*}\|^{2}+\frac{1}{4}\|x^{K}-x^{*}\|^{2}\leq e_{1}^{2}.$$ From the definition $$\mathbf{H}_{i}^{k+1}=\begin{cases}\mathbf{H}_{i}^{k}+\mathcal{C}(\nabla^{2}f_{i}(x^{k+1})-\mathbf{H}_{i}^{k})&\text{with probability$p$,}\\ \mathbf{H}_{i}^{k}&\text{with probability$1-p$.}\end{cases}\tag{27}$$ we have two cases for Hk+1 i we need to upper bound individually instead of in expectation. Note that the case Hk+1 i = Hk i is trivial as ∥Hk+1 i − ∇2fi(x ∗)∥F = ∥Hk i − ∇2fi(x ∗)∥F ≤µ 2 √C . For the other case when Hk+1 i = Hk i + C(∇2fi(x k+1) − Hk i ), we have ∥Hk+1 i − ∇2fi(x ∗)∥F = ∥Hk i + C(∇2fi(x k+1) − Hk i ) − ∇2fi(x ∗)∥F ≤ ∥C(∇2fi(x k+1) − Hk i ) − (∇2fi(x k+1) − Hk i )∥F + ∥∇2fi(x k+1) − ∇2fi(x ∗)∥F ≤ √1 − α∥∇2fi(x k+1) − Hk i ∥F + LF∥x k+1 − x ∗∥ ≤ √1 − α∥Hk i − ∇2fi(x ∗)∥F + √1 − α∥∇2fi(x k+1) − ∇2fi(x ∗)∥F + LF∥x k+1 − x ∗∥ ≤ √1 − α∥Hk i − ∇2fi(x ∗)∥F + 2LF∥x k+1 − x ∗∥ ≤ √1 − αµ 2 √C + 2LF · (1 − √1 − α)µ 4 √CLF= µ 2 √C , which completes our induction step and the proof. ## G Deferred Proofs From Section 5 (Newton-3Pc-Bc) G.1 Proof Of Theorem 5.1 First we have $$\|x^{k+1}-x^{*}\|^{2}=\|z^{k}-x^{*}-[{\bf H}^{k}]^{-1}_{\mu}g^{k}\|^{2}\tag{28}$$ $$=\left\|[{\bf H}^{k}]^{-1}_{\mu}\left([{\bf H}^{k}]_{\mu}(z^{k}-x^{*})-(g^{k}-\nabla f(x^{*}))\right)\right\|^{2}$$ $$\leq\frac{1}{\mu^{2}}\left\|[{\bf H}^{k}]_{\mu}(z^{k}-x^{*})-(g^{k}-\nabla f(x^{*}))\right\|^{2},$$ where we use ∇f(x ∗) = 0 in the second equality, and ∥[Hk] −1 µ ∥ ≤ 1µ in the last inequality. If ξ k = 1, then [Hk]µ(z k − x ∗) − (g k − ∇f(x ∗)) 2 =∇f(z k) − ∇f(x ∗) − ∇2f(x ∗)(z k − x ∗) + (∇2f(x ∗) − [Hk]µ)(z k − x ∗) 2 ≤ 2∇f(z k) − ∇f(x ∗) − ∇2f(x ∗)(z k − x ∗) 2+ 2(∇2f(x ∗) − [Hk]µ)(z k − x ∗) 2 ≤ L 2∗ 2 ∥z k − x ∗∥ 4 + 2∥[Hk]µ − ∇2f(x ∗)∥ 2· ∥z k − x ∗∥ 2 ≤ L 2∗ 2 ∥z k − x ∗∥ 4 + 2∥Hk − ∇2f(x ∗)∥ 2 F∥z k − x ∗∥ 2 = L 2∗ 2 ∥z k − x ∗∥ 4 + 2 1 n Hk i − 1 n ∇2fi(x ∗) 2 F ∥z k − x ∗∥ 2 ≤ L 2∗ 2 ∥z k − x ∗∥ 4 + 2 n Xn i=1 ∥Hk i − ∇2fi(x ∗)∥ 2 F∥z k − x ∗∥ 2, (29) where in the second inequality, we use the Lipschitz continuity of the Hessian of f, and in the last inequality, we use the convexity of *∥ · ∥*2F . If ξ k = 0, then [Hk]µ(z k − x ∗) − (g k − ∇f(x ∗)) 2 =[Hk]µ(z k − w k) + ∇f(w k) − ∇f(x ∗) − [Hk]µ(z k − x ∗) 2 =[Hk]µ(x ∗ − w k) + ∇f(w k) − ∇f(x ∗) 2 =∇f(w k) − ∇f(x ∗) − ∇2f(x ∗)(w k − x ∗) + (∇2f(x ∗) − [Hk]µ)(w k − x ∗) 2 ≤ L 2∗ 2 ∥w k − x ∗∥ 4 + 2∥Hk − ∇2f(x ∗)∥ 2 F∥w k − x ∗∥ 2 ≤ L 2∗ 2 ∥w k − x ∗∥ 4 + 2 n Xn i=1 ∥Hk i − ∇2fi(x ∗)∥ 2 F∥w k − x ∗∥ 2. (30) For k ≥ 1, from the above three inequalities, we can obtain Ek∥x k+1 − x ∗∥ 2 ≤ L 2∗p 2µ2 ∥z k − x ∗∥ 4 + 2p nµ2 Xn i=1 ∥Hk i − ∇2fi(x ∗)∥ 2 F∥z k − x ∗∥ 2 + L 2∗ (1 − p) 2µ2∥w k − x ∗∥ 4 + 2(1 − p) nµ2 Xn i=1 ∥Hk i − ∇2fi(x ∗)∥ 2 F∥w k − x ∗∥ 2 =p 2µ2 L 2 ∗∥z k − x ∗∥ 2 + 4Hk∥z k − x ∗∥ 2 + (1 − p) 2µ2L 2 ∗∥w k − x ∗∥ 2 + 4Hk∥w k − x ∗∥ 2, (31) where we denote Hk:= 1n Pn i=1 ∥Hk i − ∇2fi(x ∗)∥ 2 F . For k = 0, since z 0 = w 0, it is easy to verify that the above equality also holds. From the update rule of z k, we have Ek∥z k+1 − x ∗∥ 2 ≤ (1 + α)Ek∥z k+1 − x k+1∥ 2 + 1 + 1 α Ek∥x k+1 − x ∗∥ 2 ≤ (1 + α)(1 − AM)∥z k − x k∥ 2 + (1 + α)BMEk∥x k+1 − x k∥ 2 + 1 + 1 α Ek∥x k+1 − x ∗∥ 2 ≤ (1 + α)(1 − AM)(1 + β)∥z k − x ∗∥ 2 + (1 + α)(1 − AM) 1 + 1 β ∥x k − x ∗∥ 2 + 2(1 + α)BM∥x k − x ∗∥ 2 + 2(1 + α)BM + 1 + 1 α Ek∥x k+1 − x ∗∥ 2, for any α > 0, β > 0. By choosing α = AM 4and β =AM 4(1− 3AM4 ) , we arrive at $$\mathbb{E}_{k}\|z^{k+1}-x^{*}\|^{2}\leq\left(1-\frac{A_{M}}{2}\right)\|z^{k}-x^{*}\|^{2}+\left(\frac{A}{A_{M}}-3+\frac{5B_{M}}{2}\right)\|x^{k}-x^{*}\|^{2}+\left(\frac{4}{A_{M}}+1+\frac{5B_{M}}{2}\right)\mathbb{E}_{k}\|x^{k+1}-x^{*}\|^{2}$$ $$\leq\left(1-\frac{A_{M}}{2}\right)\|z^{k}-x^{*}\|^{2}+C_{M}\|x^{k}-x^{*}\|^{2}+C_{M}\mathbb{E}_{k}\|x^{k+1}-x^{*}\|^{2},\tag{32}$$ where we denote CM := 4 AM Ek[∥z k+1 − x ∗∥ 2 + 2CM∥x k+1 − x ∗∥ 2] ≤ 1 − AM 2 ∥z k − x ∗∥ 2 + CM∥x k − x ∗∥ 2 + 3CMEk∥x k+1 − x ∗∥ 2 (31) ≤ 1 − AM 2 ∥z k − x ∗∥ 2 + 3CMp 2µ2L 2 ∗∥z k − x ∗∥ 2 + 4Hk∥z k − x ∗∥ 2 + 3CM(1 − p) 2µ2L 2 ∗∥w k − x ∗∥ 2 + 4Hk∥w k − x ∗∥ 2 + CM∥x k − x ∗∥ 2. + 1 + 5BM 2. Then we have Assume ∥z k − x ∗∥ 2 ≤AMµ 2 24CML2∗ and Hk ≤ AMµ 2 96CM for k ≥ 0. Then from the update rule of w k, we also have ∥w k − x ∗∥ 2 ≤AMµ 2 $$\mathbb{E}_{k}[\|z^{k+1}-x^{*}\|^{2}+2C_{M}\|x^{k+1}-x^{*}\|^{2}]\leq\left(1-\frac{A_{M}}{2}+\frac{A_{M}p}{8}\right)\|z^{k}-x^{*}\|^{2}+\frac{A_{M}(1-p)}{8}\|w^{k}-x^{*}\|^{2}+C_{M}\|x^{k}-x^{*}\|^{2}.\tag{33}$$ for k ≥ 0. Therefore, we have $$x^{\ast}\|^{2}.$$ (33) $$(34)$$ From the update rule of w k, we have $$\mathbb{E}_{k}\|w^{k+1}-x^{*}\|^{2}=p\|z^{k+1}-x^{*}\|^{2}+(1-p)\|w^{k}-x^{*}\|^{2}.$$ 2. (34) Define $\Phi_1^k:=\|z^k-x^s\|^2+C_M\|x^k-x^s\|^2+\frac{A_M(1-p)}{4p}\|w^k-x^s\|^2.$ Then we have : := ∥z k − x ∗∥ 2 + CM∥x k − x ∗∥ 2 + AM(1−p) 4p∥w k − x ∗∥ 2. Then we have 1] = Ek[∥z k+1 − x ∗∥ 2 + 2CM∥x k+1 − x ∗∥ 2] + AM(1 − p) 4p Ek∥w k+1 − x ∗∥ 2 (34) ≤ 1 + AM(1 − p) 4 Ek[∥z k+1 − x ∗∥ 2 + 2CM∥x k+1 − x ∗∥ 2] + AM(1 − p) 2 4p∥w k − x ∗∥ 2 (33) ≤ 1 + AM(1 − p) 4 1 − AM 2+ AMp 8 ∥z k − x ∗∥ 2 + 1 + AM(1 − p) 4 CM∥x k − x ∗∥ 2 + 1 + AM(1 − p) 4 AM(1 − p) 8+ AM(1 − p) 2 4p ∥w k − x ∗∥ 2 ≤ 1 − AM 4 ∥z k − x ∗∥ 2 + 1 − 3 8 2CM∥x k − x ∗∥ 2 + AM(1 − p) 4p 1 − 3p 8 ∥w k − x ∗∥ 2 ≤ 1 − min{2AM, 3p} 8 Φ k 1 . $$\mathbb{E}_{k}[\Phi_{1}^{k+1}]$$ By applying the tower property, we have $$\mathbb{E}[\Phi_{1}^{k+1}]\leq\left(1-\frac{\operatorname*{min}\{2A_{\mathrm{M}},3p\}}{8}\right)\mathbb{E}[\Phi_{1}^{k}].$$ Unrolling the recursion, we can get the result. ## G.2 Proof Of Lemma 5.2 We prove the results by mathematical induction. Assume the results hold for k ≤ K. From the update rule of w k, we know ∥w k − x ∗∥ 2 ≤ min{ AMµ 2 24CML2∗ ,AW AMµ 2 384CMCW L2F } for k ≤ K. If ξ K = 1, from (28) and (29), we have $$\|x^{K+1}-x^{*}\|^{2}\leq\frac{1}{\mu^{2}}\left(\frac{L^{2}}{2}\|z^{K}-x^{*}\|^{2}+2{\cal H}^{K}\right)\|z^{K}-x^{*}\|^{2}\tag{35}$$ $$\leq\frac{A_{M}}{24C_{M}}\|z^{K}-x^{*}\|^{2}.$$ If ξ K = 0, from ∥w K − x ∗∥ 2 ≤ min{ AMµ 2 24CML2∗ ,AW AMµ 2 384CMCW L2F } and (30), we can obtain the above inequality similarly. From the upper bound of ∥z K −x ∗∥ 2, we further have ∥x K+1 −x ∗∥ ≤ 11AM 24CM min{ AMµ 2 24C2ML2∗ ,AW AMµ 2 384CMCW L2F }. Then from (32) and the fact that CM z k,xk (x k+1) is deterministic, we have $$\|z^{K+1}-x^{*}\|^{2}\leq\left(1-\frac{A_{M}}{2}\right)\|z^{K}-x^{*}\|^{2}+C_{M}\|x^{K}-x^{*}\|^{2}+C_{M}\|x^{K+1}-x^{*}\|^{2}$$ $$\leq\left(1-\frac{A_{M}}{2}+\frac{A_{M}}{2}\right)\|z^{K}-x^{*}\|^{2}+C_{M}\cdot\frac{11A_{M}}{24C_{M}}\min\{\frac{A_{M}\mu^{2}}{24C_{M}^{2}L^{2}},\frac{A_{W}A_{M}\mu^{2}}{384C_{M}C_{W}L_{F}^{2}}\}$$ $$\leq\min\{\frac{A_{M}\mu^{2}}{24C_{M}^{2}L^{2}},\frac{A_{W}A_{M}\mu^{2}}{384C_{M}C_{W}L_{F}^{2}}\}.$$ For ∥Hk+1 i − ∇2fi(x ∗)∥ 2 F , we have Ek∥Hk+1 i − ∇2fi(x ∗)∥ 2 F ≤ (1 + α)Ek∥Hk i − ∇2fi(z k+1)∥ 2 F + 1 + 1 α Ek∥∇2fi(z k+1) − ∇2fi(x ∗)∥ 2 F ≤ (1 + α)(1 − AW )∥Hk i − ∇2fi(z k)∥ 2 F + (1 + α)BW Ek∥∇2fi(z k) − ∇2fi(z k+1)∥ 2 F + 1 + 1 α Ek∥∇2fi(z k+1) − ∇2fi(x ∗)∥ 2 F ≤ (1 + α)(1 − AW )∥Hk i − ∇2fi(z k)∥ 2 F + (1 + α)BW L 2 FEk∥z k − z k+1∥ 2 + 1 + 1 α L 2 FEk∥z k+1 − x ∗∥ 2 ≤ (1 + α)(1 − AW )(1 + β)∥Hk i − ∇2fi(x ∗)∥ 2 F + (1 + α)(1 − AW ) 1 + 1 β L 2 F∥z k − x ∗∥ 2 + 2(1 + α)BW L 2 F∥z k − x ∗∥ 2 + 2(1 + α)BW + 1 + 1 α L 2 F∥z k+1 − x ∗∥ 2, for any α > 0, β > 0. By choosing α = AW 4and β =AW 4(1− ) Ek∥Hk+1 i − ∇2fi(x ∗)∥ 2 F ≤ 1 − AW 2 ∥Hk i − ∇2fi(x ∗)∥ 2 F + CW L 2 F∥z k − x ∗∥ 2 + CW L 2 FEk∥z k+1 − x ∗∥ 2, (36) where we denote CW := 4 AW + 1 + 5BW 2. Since CW Hk i ,∇2fi(z k) (z k+1) is disterministic, from (36), we have HK+1 ≤ 1 − AW 2 HK + CW L 2 F∥z K − x ∗∥ 2 + CW L 2 F∥z K+1 − x ∗∥ 2 ≤ 1 − AW 2 AMµ 2 96CM + 2CW L 2 F · AW AMµ 2 384CMCW L 2 F ≤ AMµ 2 96CM . ## 3Aw4 , We Arrive At G.3 Proof Of Lemma 5.3 We prove the results by mathematical induction. From the assumption on Hk i , we have $$\mathcal{H}^{k}=\frac{1}{n}\sum_{i=1}^{n}\|\mathbf{H}_{i}^{k}-\nabla^{2}f_{i}(x^{*})\|^{2}$$ $$\leq\frac{1}{n}\sum_{i=1}^{n}d^{2}\max_{jl}\{|(\mathbf{H}_{i}^{k})_{jl}-(\nabla^{2}f(x^{*}))_{jl}|^{2}\}$$ $$\leq d^{2}L_{\infty}^{2}\max_{0\leq t\leq k}\|z^{t}-x^{*}\|^{2}.$$ 2. (37) $$(37)^{\frac{1}{3}}$$ Then from ∥x 0 − x ∗∥ 2 ≤ c˜1, we have H0 ≤ min{ AMµ 2 96CM , µ 2 4d }. Assume the results hold for all k ≤ K. If ξ K = 1, from (35), we have $$\|x^{K+1}-x^{*}\|^{2}\leq\frac{1}{\mu^{2}}\left(\frac{L_{*}^{2}}{2}\|z^{K}-x^{*}\|^{2}+2{\cal H}^{K}\right)\|z^{K}-x^{*}\|^{2}$$ $$\leq\frac{1}{d}\|z^{K}-x^{*}\|^{2}$$ $$\leq\tilde{c}_{1}.$$ If ξ K = 0, from ∥w K − x ∗∥ 2 ≤ dc˜1 and (30), we can obtain the above inequality similarly. From the assumption on z k, we have $$\begin{split}\|z^{K+1}-x^{*}\|^{2}&\leq d\max_{j}|z_{j}^{K+1}-x_{j}^{*}|^{2}\\ &\leq d\max_{0\leq t\leq K+1}\|x^{t}-x^{*}\|^{2}\\ &\leq d\tilde{c}_{1}.\end{split}$$ ``` At last, using (37), we can get HK+1 ≤ min{ AMµ 2 96CM , µ 2 4d }, which completes the proof. ``` ## H Extension To Bidirectional Compression And Partial Participation In this section, we unify the bidirectional compression and partial participation in Algorithm 3. The algorithm can also be regarded as an extension of BL2 in (Qian et al., 2022) by the three point compressor. Here the symmetrization operator [·]s is defined as $$[\mathbf{A}]_{s}:={\frac{\mathbf{A}+\mathbf{A}^{\top}}{2}}$$ for any A ∈ R d×d. The update of the global model at k-th iteration is $$x^{k+1}=\left([\mathbf{H}^{k}]_{s}+l^{k}\mathbf{I}\right)^{-1}g^{k},$$ where Hk, l k, and g k are the average of Hk i , l k i , and g k i respectively. This update is based on the following step in Stochastic Newton method (Kovalev et al., 2019) $$x^{k+1}=\left[{\frac{1}{n}}\sum_{i=1}^{n}\nabla^{2}f_{i}(w_{i}^{k})\right]^{-1}\left[{\frac{1}{n}}\sum_{i=1}^{n}\left(\nabla^{2}f_{i}(w_{i}^{k})w_{i}^{k}-\nabla f_{i}(w_{i}^{k})\right)\right].$$ We use [Hk i ]s + l k i I to estimate ∇2fi(w k i ), and g k i to estimate ∇2fi(w k i )w k i − ∇fi(w k i ), where l k i = ∥[Hk i ]s − ∇2fi(z k i )∥F is adopted to guarantee the positive definiteness of [Hk]s + l kI. Hence, like BL2 in (Qian et al., 2022), we maintain the key relation $$g_{i}^{k}=([{\bf H}_{i}^{k}]_{s}+l_{i}^{k}{\bf I})w_{i}^{k}-\nabla f_{i}(w_{i}^{k}).\tag{1}$$ ). (38) Since each node has a local model w k i , we introduce z k i to apply the bidirectional compression with the three point compressor and Hk i is expected to learn h i(∇2fi(z k i )) iteratively. For the update of g k i on the server when ξ k i = 0, from (38), it is natural to let $$g_{i}^{k+1}-g_{i}^{k}=([\mathbf{H}_{i}^{k+1}]_{s}-[\mathbf{H}_{i}^{k}]_{s}+l_{i}^{k+1}\mathbf{I}-l_{i}^{k}\mathbf{I})w_{i}^{k+1},$$ since we have w k+1 i = w k i when ξ k i = 0. The convergence results of Newton-3PC-BC-PP are stated in the following two theorems. $$(38)$$ Algorithm 3 Newton-3PC-BC-PP (Newton's method with 3PC, BC and Partial Participation) 1: **Parameters:** Worker's (CW ) and Master's (CM) 3PC; probability p ∈ (0, 1]; 0 < τ ≤ n 2: **Initialization:** w 0 i = z 0 i = x 0 ∈ R d; H0 i ∈ R d×d; l 0 i = ∥[H0 i ]s − ∇2fi(w 0 i )∥F; g 0 i = ([H0 i ]s + l 0 i I)w 0 i − ∇fi(w 0 i ); Moreover: H0 = 1 n Pn i=1 H0 i ; l 0 = 1 n Pn i=1 l 0 i ; g 0 = 1 n Pn i=1 g 0 i 3: on server 4: x k+1 =[Hk]s + l kI−1g k, 5: choose a subset S k ⊆ [n] such that P[i ∈ S k] = τ/n for all i ∈ [n] 6: z k+1 i = CM z k i ,xk (x k+1) for i ∈ S k 7: z k+1 i = z k i , w k+1 i = w k i for i /∈ S k 8: Send CM z k i ,xk (x k+1) to the selected devices i ∈ S k 9: for each device i = 1*, . . . , n* in parallel do 10: **for participating devices** i ∈ S k do 11: z k+1 i = CM z k i ,xk (x k+1) 12: Hk+1 i = CW Hk i ,∇2fi(z k i ) (∇2fi(z k+1 i)) 13: l k+1 i = ∥[Hk+1 i]s − ∇2fi(z k+1 i)∥F 14: Sample ξ k+1 i ∼ Bernoulli(p) 15: if ξ k+1 i = 1 16: w k+1 i = z k+1 i, g k+1 i = ([Hk+1 i]s + l k+1 iI)w k+1 i − ∇fi(w k+1 i), send g k+1 i − g k i to server 17: if ξ k+1 i = 0 18: w k+1 i = w k i , g k+1 i = ([Hk+1 i]s + l k+1 iI)w k+1 i − ∇fi(w k+1 i) 19: Send Hk+1 i, l k+1 i − l k i , and ξ k+1 ito the server 20: **for non-participating devices** i /∈ S k do 21: z k+1 i = z k i , w k+1 i = w k i , Hk+1 i = Hk i , l k+1 i = l k i , g k+1 i = g k i 22: **end for** 23: on server 24: if ξ k+1 i = 1 25: w k+1 i = z k+1 i, receive g k+1 i − g k i 26: if ξ k+1 i = 0 27: w k+1 i = w k i , g k+1 i − g k i =-Hk+1 i − Hk i s w k+1 i + (l k+1 i − l k i )w k+1 i 28: g k+1 = g k + 1 n Pi∈Skg k+1 i − g k i 29: Hk+1 = 1 n Pn i=1 Hk+1 i 30: l k+1 = l k + 1 n Pi∈Skl k+1 i − l k i For k ≥ 0, define Lyapunov function $$\Phi_{3}^{k}:={\mathcal{Z}}^{k}+{\frac{2\tau C_{M}}{n}}\|x^{k}-x^{*}\|^{2}+{\frac{A_{M}}{4p}}{\mathcal{W}}^{k},$$ where τ ∈ [n] is the number of devices participating in each round. Theorem H.1. *Let Assumption 4.1. Assume* ∥z k i − x ∗∥ 2 ≤AMµ 2 36(H2+4L2F )CM and Hk ≤ AMµ 2 576CM for all i ∈ [n] and k ≥ 0*. Then we have* $$\mathbb{E}[\Phi_{3}^{k}]\leq\left(1-\frac{\tau\operatorname*{min}\{2A_{M},3p\}}{8n}\right)^{k}\Phi_{3}^{0},$$ for k ≥ 0. Proof. First, similar to (30) in (Qian et al., 2022), we can get ∥x k+1 − x ∗∥ 2 ≤ 3L 2∗ 4µ2 (Wk) 2 + 12Wk nµ2 Xn i=1 ∥Hk i − ∇2fi(x ∗)∥ 2 F + 3L 2 F µ2 Z kWk = 3L 2∗ 4µ2 (Wk) 2 + 12Wk µ2 Hk + 3L 2 F µ2 Z kWk, (39) where Wk = 1 n Pn i=1 ∥w k i − x ∗∥ 2 and Z k = 1 n Pn i=1 ∥z k i − x ∗∥ 2. For i ∈ S k, we have z k+1 i = CM z k i ,xk (x k+1). Then, similar to (32), we have $$\mathbb{E}_{k}\|z_{i}^{k+1}-x^{*}\|^{2}\leq\left(1-\frac{A_{M}}{2}\right)\|z_{i}^{k}-x^{*}\|^{2}+C_{M}\|x^{k}-x^{*}\|^{2}+C_{M}\|x^{k+1}-x^{*}\|^{2}.$$ Noticing that $\mathbb{P}[i\in S^k]=\tau/n$ and $z_i^{k+1}=z_i^k$ for $i\not\in S^k$, we further have . i Ek∥z k+1 i − x ∗∥ 2 = τ n Ek[∥z k+1 i − x ∗∥ 2| i ∈ S k] + 1 − τ n Ek[∥z k+1 i − x ∗∥ 2| i /∈ S k] ≤ τ n 1 − AM 2 ∥z k i − x ∗∥ 2 + τCM n∥x k − x ∗∥ 2 + τCM n∥x k+1 − x ∗∥ 2 + 1 − τ n ∥z k i − x ∗∥ 2 = 1 − τAM 2n ∥z k i − x ∗∥ 2 + τCM n∥x k − x ∗∥ 2 + τCM n∥x k+1 − x ∗∥ 2, which implies that $$\mathbb{E}_{k}[\mathcal{Z}^{k+1}]=\frac{1}{n}\sum_{i=1}^{n}\mathbb{E}_{k}\|z_{i}^{k+1}-x^{*}\|^{2}\tag{40}$$ $$\leq\frac{1}{n}\sum_{i=1}^{n}\left(1-\frac{\tau A_{M}}{2n}\right)\|z_{i}^{k}-x^{*}\|^{2}+\frac{\tau C_{M}}{n}\|x^{k}-x^{*}\|^{2}+\frac{\tau C_{M}}{n}\|x^{k+1}-x^{*}\|^{2}$$ $$=\left(1-\frac{\tau A_{M}}{2n}\right)\mathcal{Z}^{k}+\frac{\tau C_{M}}{n}\|x^{k}-x^{*}\|^{2}+\frac{\tau C_{M}}{n}\|x^{k+1}-x^{*}\|^{2}.$$ Combining (39) and (40), we have Ek[Z k+1 + 2τCM n∥x k+1 − x ∗∥ 2] ≤ 1 − τAM 2n Z k + τCM n∥x k − x ∗∥ 2 + 3τCM n∥x k+1 − x ∗∥ 2 ≤ 1 − τAM 2n Z k + τCM n∥x k − x ∗∥ 2 + 3τCM n 3L 2∗ 4µ2 Wk + 12Hk µ2+ 3L 2 FZ k µ2 Wk. 2 2 Assume $\|z_i^k-x^*\|^2\leq\frac{A_M\mu^2}{36(L_{\star}^2+4L_{\mathrm{F}}^2)C_M}$. for all i ∈ [n] and k ≥ 0. Then we have $\frac{}{C_M}$ and $\mathcal{H}^k\leq\frac{A_M\mu^2}{576C_M}$ for all $i$. $$\begin{array}{c c c}{{}}&{{}}&{{}}\\ {{}}&{{}}&{{3L_{*}^{2}}}\\ {{}}&{{}}&{{}}\\ {{}}&{{}}&{{\frac{3L_{*}^{2}}{4\mu^{2}}{\mathcal W}^{k}+\frac{12{\mathcal H}^{k}}{\mu^{2}}+\frac{3L_{F}^{2}{\mathcal Z}^{k}}{\mu^{2}}\leq\frac{A_{M}}{24C_{M}},}}\end{array}$$ which indicates that $$\mathbb{E}_{k}[\,\mathbb{Z}^{k+1}+\frac{2\tau C_{M}}{n}\|x^{k+1}-x^{*}\|^{2}]\leq\left(1-\frac{\tau A_{M}}{2n}\right)\mathbb{Z}^{k}+\frac{\tau C_{M}}{n}\|x^{k}-x^{*}\|^{2}+\frac{\tau A_{M}}{8n}\mathcal{W}^{k}.\tag{41}$$ For Wk, similar to (32) in (Qian et al., 2022), we have $$\mathbb{E}_{k}[{\mathcal{W}}^{k+1}]=\left(1-{\frac{\tau p}{n}}\right){\mathcal{W}}^{k}+{\frac{\tau p}{n}}\mathbb{E}[{\mathcal{Z}}^{k+1}].$$ Then from the above two inequalities we have Ek[Φk+1 3] ≤ 1 + τAM 4n Ek[Z k+1 + 2τCM n∥x k+1 − x ∗∥ 2] + AM 4p 1 − τ p n Wk (41) ≤ 1 − τAM 4n Z k + 1 + τAM 4n τCM n∥x k − x ∗∥ 2 + AM 4p 1 − τ p n + τ p 2n 1 + τAM 4n Wk ≤ 1 − τ min{2AM, 3p} 8n Φ k 3 . By applying the tower property, we have $$\mathbb{E}[\Phi_{3}^{k+1}]\leq\left(1-\frac{\tau\operatorname*{min}\{2A_{M},3p\}}{8n}\right)\mathbb{E}[\Phi_{3}^{k}].$$ Unrolling the recursion, we can obtain the result. Define Φ k 4 = Hk + 16CW L 2 F AM∥x k − x ∗∥ 2for k ≥ 0, where CW := 4A + 1 + 5B 2 . Theorem H.2. *Let Assumption 4.1 holds,* ξ k ≡ 1, S k ≡ [n], and CM z k i ,xk (x k+1) ≡ x k+1 for all i ∈ [n] and k ≥ 0*. Assume* ∥z k i − x ∗∥ 2 ≤AMµ 2 36(L2∗+4L2F )CM and Hk ≤ AMµ 2 576CM for all i ∈ [n] and k ≥ 0*. Then we have* E[Φk 4 ] ≤ θ k 2Φ 0 4 , $$\mathbb{E}\left[\frac{\|x^{k+1}-x^{*}\|^{2}}{\|x^{k}-x^{*}\|^{2}}\right]\leq\theta_{2}^{k}\left(\frac{3(L_{*}^{2}+4L_{F}^{2})A_{\mathrm{M}}}{64C_{W}L_{F}^{2}\mu^{2}}+\frac{12}{\mu^{2}}\right)\Phi_{4}^{0}.$$ _for $k\geq0$, where $\theta_{2}:=\left(1-\frac{\min\{2A_{W},A_{M}\}}{4}\right)$._ Proof. Since ξ k ≡ 1, S k ≡ [n], and CM z k i ,xk (x k+1) ≡ x k+1 for all i ∈ [n] and k ≥ 0, we have z k i ≡ w k i ≡ x kfor all i ∈ [n] and k ≥ 0. Then from (41), we have $$\mathbb{E}_{k}\|x^{k+1}-x^{*}\|^{2}\leq\left(1-\frac{3A_{M}}{8}\right)\|x^{k}-x^{*}\|^{2}.\tag{42}$$ For ∥Hk+1 i − ∇2fi(x ∗)∥ 2 F , similar to (36), we have $$\mathbb{E}_{h}\|\mathbf{H}_{t}^{k+1}-\nabla^{2}f_{t}(x^{*})\|_{\mathbb{F}}^{2}\leq\left(1-\frac{A_{W}}{2}\right)\|\mathbf{H}_{t}^{k}-\nabla^{2}f_{t}(x^{*})\|_{\mathbb{F}}^{2}+C_{W}L_{\mathbb{F}}^{2}\|z_{t}^{k}-x^{*}\|^{2}+C_{W}L_{\mathbb{F}}^{2}\mathbb{E}_{h}\|z_{t}^{k+1}-x^{*}\|^{2}.$$ Considering z k i ≡ x k, we further have Considering $\omega_{1}=x^{*}$, we further have $$\begin{aligned} \mathbb{E}_{b}\|\mathbf{H}_{i}^{k+1}-\nabla^{2}f_{i}(x^{*})\|_{F}^{2}&\leq&\left(1-\frac{A_{W}}{2}\right)\|\mathbf{H}_{i}^{k}-\nabla^{2}f_{i}(x^{*})\|_{F}^{2}+C_{W}L_{F}^{2}\|x^{k}-x^{*}\|^{2}+C_{W}L_{F}^{2}\mathbb{E}_{b}\|x^{k+1}-x^{*}\|^{2}\\ &\stackrel{(G2)}{\leq}&\left(1-\frac{A_{W}}{2}\right)\|\mathbf{H}_{i}^{k}-\nabla^{2}f_{i}(x^{*})\|_{F}^{2}+2C_{W}L_{F}^{2}\|x^{k}-x^{*}\|^{2}, \end{aligned}$$ which implies that $$\mathbb{E}_{k}[\mathcal{H}^{k+1}]\leq\left(1-\frac{A_{W}}{2}\right)\mathcal{H}^{k}+2C_{W}L_{F}^{2}\|x^{k}-x^{*}\|^{2}.\tag{43}$$ 33 Thus, we have $$\mathbb{E}_{k}[\Phi_{4}^{k+1}]=\mathbb{E}_{k}[\mathcal{H}^{k+1}]+\frac{16C_{W}L_{\mathrm{F}}^{2}}{A_{M}}\mathbb{E}_{k}\|x^{k+1}-x^{*}\|^{2}$$ $$\leq\left(1-\frac{A_{W}}{2}\right)\mathcal{H}^{k}+2C_{W}L_{\mathrm{F}}^{2}\|x^{k}-x^{*}\|^{2}+\frac{16C_{W}L_{\mathrm{F}}^{2}}{A_{M}}\mathbb{E}_{k}\|x^{k+1}-x^{*}\|^{2}$$ $$\leq\left(1-\frac{\min\{2A_{W},A_{M}\}}{4}\right)\Phi_{4}^{k}.$$ and H0 ≤AMµ 2 576CM . Then we have ∥x k − x ∗∥ ≤ 11AM 24CM min{AMµ 2 36(L2∗+4L2F )CM ,AW AMµ 2 2304CMCW L2F }, ∥z k i − x ∗∥ 2 ≤ min{AMµ 2 36(L2∗+4L2F )CM ,AW AMµ 2 2304CMCW L2F } and Hk ≤ AMµ 2 576CM for all i ∈ [n] and k ≥ 0. By applying the tower property, we have E[Φk+1 4] ≤ θ1E[Φk 4 ]. Unrolling the recursion, we have E[Φk 4 ] ≤ θ k 2Φ 0 4 . Then we further have E[Hk] ≤ θ k 2Φ 0 4 and E∥x k − x ∗∥ 2 ≤AM 16CW L2F θ k 2Φ 0 4 . From (39), we can get $$\|x^{k+1}-x^{*}\|^{2}\leq{\frac{1}{\mu^{2}}}\left({\frac{3(L_{*}^{2}+4L_{\mathrm{F}}^{2})}{4}}\|x^{k}-x^{*}\|^{2}+12{\mathcal{H}}^{k}\right)\|x^{k}-x^{*}\|^{2}.$$ Assume x k ̸= x ∗for all k ≥ 0. Then we have $$\frac{\|x^{k+1}-x^{*}\|^{2}}{\|x^{k}-x^{*}\|^{2}}\leq\frac{1}{\mu^{2}}\left(\frac{3(L_{*}^{2}+4L_{\mathrm{F}}^{2})}{4}\|x^{k}-x^{*}\|^{2}+12{\mathcal{H}}^{k}\right),$$ and by taking expectation, we arrive at $$\mathbb{E}\left[\frac{\|x^{k+1}-x^{*}\|^{2}}{\|x^{k}-x^{*}\|^{2}}\right]\leq\frac{3(L_{*}^{2}+4L_{\mathrm{F}}^{2})}{4\mu^{2}}\mathbb{E}[\|x^{k}-x^{*}\|^{2}+\frac{12}{\mu^{2}}\mathbb{E}[\mathcal{H}^{k}]$$ $$\leq\theta_{2}^{k}\left(\frac{3(L_{*}^{2}+4L_{\mathrm{F}}^{2})A_{\mathrm{M}}}{64C_{W}L_{\mathrm{F}}^{2}\mu^{2}}+\frac{12}{\mu^{2}}\right)\Phi_{4}^{0}.$$ Next, we explore under what conditions we can guarantee the boundedness of ∥z k i − x ∗∥ 2 and Hk. Theorem H.3. Let Assumption 4.1 holds. (i) Let CM and CW *be deterministic. Assume* ∥x 0 − x ∗∥ 2 ≤11AM 24CM min{AMµ 2 36(L2∗+4L2F )CM ,AW AMµ 2 2304CMCW L2F } (ii) Assume (z k i )j *is a convex combination of* {(x t)j} k t=0*, and* (Hk i )jl *is a convex combination of* {(∇2fi(z k i ))jl} k t=0 for all i ∈ [n], j, l ∈ [d], and k ≥ 0*. If* ∥x 0 − x ∗∥ 2 ≤ c˜2 := min{2µ 2 3d2(L2∗+4L2F ) ,AMµ 2 36dCM(L2∗+4L2F ) ,AMµ 2 576d3CML2∞ ,µ 2 24d4L2∞ }*, then* ∥z k i − x ∗∥ 2 ≤ dc˜2 and Hk ≤ ``` min{ AMµ 2 576CM , µ 2 24d } for all i ∈ [n] and k ≥ 0. ``` Proof. The proof is similar to that of Lemmas 5.2 and 5.3. Hence we omit it. ## I Globalization Through Cubic Regularization And Line Search Procedure So far, we have discussed only the local convergence of our methods. To prove global rates, one must incorporate additional regularization mechanisms. Otherwise, global convergence cannot be guaranteed. Due to the smooth transition from contractive compressors to general 3PC mechanism, we can easily adapt two globalization strategies of FedNL (equivalent to Newton-EF21) to our Newton-3PC algorithm. The two globalization strategies are *cubic regularization* and *line search procedure*. We only present the extension with cubic regularization Newton-3PC-CR (Algorithm 4) analogous to FedNL-CR (Safaryan et al., 2022). Similarly, line search procedure can be combined as it was done in FedNL-LS (Safaryan et al., 2022). Algorithm 4 Newton-3PC-CR (Newton's method with 3PC and Cubic Regularization) 1: **Input:** x 0 ∈ R d, H01 , . . . , H0n ∈ R d×d, H0:= 1n Pn i=1 H0 i , l0 = 1 n Pn i=1 ∥H0 i − ∇2fi(x 0)∥F 2: on master 3: h k = arg minh∈Rd Tk(h), where Tk(h) := ∇f(x k), h+ 1 2 (Hk + l kI)*h, h*+ L∗ 6 ∥h∥ 3 4: Update global model to x k+1 = x k + h k and send to the nodes 5: for each device i = 1*, . . . , n* in parallel do 6: Get x k+1 and compute local gradient ∇fi(x k+1) and local Hessian ∇2fi(x k+1) 7: Take ∇2fi(x k) from memory and update Hk+1 i = CHk i ,∇2fi(xk) (∇2fi(x k+1)) 8: Send ∇fi(x k+1), Hk+1 iand l k+1 i:= ∥Hk+1 i − ∇2fi(x k+1)∥F to the server 9: **end for** 10: on server ### n server Aggregate $\nabla f(x^{k+1})=\frac{1}{n}\sum_{i=1}^n\nabla f_i(x^{k+1}),\mathbf{H}^{k+1}=\frac{1}{n}\sum_{i=1}^n\mathbf{H}_i^{k+1},l^{k+1}=\frac{1}{n}\sum_{i=1}^n l_i^{k+1}$. We omit theoretical analysis of these extension as they can be obtained directly from FedNL approach with minor adaptations. In particular, one can get global linear rate for Newton-3PC-CR, global O( 1 k ) rate for general convex case and the same fast local rates (9) and (11) of Newton-3PC. ## J Additional Experiments And Extended Numerical Analysis In this section we provide extended variety of experiments to analyze the empirical performance of Newton-3PC. We study the efficiency of Newton-3PC in different settings changing 3PC compressor and comparing with other second-order state-of-the-art algorithms. Tests were carried out on logistic regression problem with L2 regularization $$\min_{x\in\mathbb{R}^{d}}\left\{\frac{1}{n}\sum_{i=1}^{n}f_{i}(x)+\frac{\lambda}{2}\|x\|^{2}\right\},\quad f_{i}(x)=\frac{1}{m}\sum_{j=1}^{m}\log\left(1+\exp(-b_{ij}a_{ij}^{\top}x)\right),\tag{44}$$ where {aij , bij}j∈[m] are data points at the i-th device. On top of that, we also consider L2 regularized Softmax problem of the form $$\min_{x\in\mathbb{R}^{n}}\left\{\frac{1}{n}\sum_{i=1}^{n}f_{i}(x)+\frac{\lambda}{2}\|x\|^{2}\right\},\quad f_{i}(x)=\sigma\log\left(\sum_{j=1}^{m}\exp\left(\frac{a_{ij}^{\top}x-b_{ij}}{\sigma}\right)\right),\tag{45}$$ where σ > 0 is a smoothing parameter. One can show that this function has both Lipschitz continuous gradient and Lipschitz continuous Hessian. Let a˜ij be initial data points, and ˜fi be defined as $${\tilde{f}}_{i}(x)=\sigma\log\left(\sum_{j=1}^{m}\exp\left({\frac{{\tilde{a}}_{i j}^{\top}x-b_{i j}}{\sigma}}\right)\right)$$ Then data shift is performed as follows $$u_{\mathrm{TJ}}\quad\quad J$$ $$\mathbf{a_{ij}}=\mathbf{a_{i j}}$$ aij = ˜aij − ˜fi(0), j ∈ [m], i ∈ [n]. After such shift we may claim that 0 is the optimum since ∇f(0) = 0. Note that this problem does not belong to the class of *generalized linear models.* ## J.1 Datasets Split We use standard datasets from LibSVM library (Chang & Lin, 2011). We shuffle and split each dataset into n equal parts representing a local data of i-th client. Exact names of datasets and values of n are shown in Table 2. | Data set | # workers n | total # of data points (= nm) | # features d | |------------|---------------|---------------------------------|----------------| | a1a | 16 | 1600 | 123 | | a9a | 80 | 32560 | 123 | | w2a | 50 | 3450 | 300 | | w8a | 142 | 49700 | 300 | | phishing | 100 | 11000 | 68 | Table 2: Datasets used in the experiments with the number of worker nodes n used in each case. ## J.2 Choice Of Parameters We follow the authors' choice of DINGO (Crane & Roosta, 2019) in choosing hyperparameters: θ = 10−4, ϕ = 10−6, ρ = 10−4. Besides, DINGO uses a backtracking line search that selects the largest stepsize from {1, 2 −1*, . . . ,* 2 −10}. The initialization of H0 i for Newton-3PC, FedNL (Safaryan et al., 2022) and its extensions, NL1 (Islamov et al., 2021) is ∇2fi(x 0) if it is not specified directly. For Fib-IOS (Fabbro et al., 2022) we set d i k = 1. Local Hessians are computed following the partial sums of Fibonacci number and the parameter ρ = λqj+1 . This is stated in the description of the method. The parameters of backtracking line search for Fib-IOS are α = 0.5 and β = 0.9. We conduct experiments for two values of regularization parameter λ ∈ {10−3, 10−4}. In the figures we plot the relation of the optimality gap f(x k) − f(x ∗) and the number of communicated bits per node. In the heatmaps numbers represent the communication complexity per client of Newton-3PC for some specific choice of 3PC compression mechanism (see the description in corresponding section). The optimal value f(x ∗) is chosen as the function value at the 20-th iterate of standard Newton's method. In our experiments we use various compressors for the methods. Examples of classic compression mechanisms include Top-K and Rank-R. The parameters of these compressors are parsed in details in Section A.3 of Safaryan et al. (2022); we refer a reader to this paper for disaggregated description of aforementioned compression mechanisms. Besides, we use various 3PC compressors introduced in (Richtárik et al., 2022). ## J.3 Behavior Of Newton-Clag Based On Top-K And Rank-R **Compressors** Next, we study how the performance of Newton-CLAG changes when we vary parameters of biased compressor CLAG compression mechanism is based on. In particular, we test Newton-CLAG combined with Top-K and Rank-R compressors modifying compression level (parameters K and R respectively) and trigger parameter ζ. We present the results as heatmaps in Figure 3 indicating the communication complexity in Mbytes for particular choice of a pair of parameters ((K, ζ) or (R, ζ) for CLAG based on Top-K and Rank-R respectively) . First, we can highlight that in special cases Newton-CLAG reduces to FedNL (ζ = 0, left column) and Newton-LAG (compression is identity, bottom row). Second, we observe slight improvement from using the lazy aggregation. ## J.4 Efficiency Of Newton-3Pcv2 **Under Different Compression Levels** On the following step we study how Newton-3PCv2 behaves when the parameters of compressors 3PCv2 is based on are changing. In particular, in the first set of experiments we test the performance of Newton-3PCv2 assembled from Top-K1 and Rand-K2 compressors where K1 + K2 = d. Such constraint is forced to make the cost of one iteration to be O(d). In the second set of experiments we choose K1 = K2 = K and vary K. The results are presented in Figure 4. ![36_image_0.png](36_image_0.png) LAG 40 90 140 190 45 95 145 195 Figure 3: First row: The performance of Newton-CLAG based on Top-K varying values of (*ζ, K*) in terms of communication complexity (in Mbytes). **Second row:** The performance of Newton-CLAG based on Rank-R varying values of (*ζ, R*) in terms of communication complexity (in Mbytes). ![36_image_1.png](36_image_1.png) 20 Figure 4: First row: The performance of Newton-3PCv2 where 3PCv2 compression mechanism is based on Top-K1 and Rand-K2 compressors with K1 + K2 = d in terms of communication complexity. **Second row:** The performance of Newton-3PCv2 where 3PCv2 compression mechanism is based on Top-K1 and Rand-K2 compressors with K1 = K2 ∈ {d/8, d/4, d/2, d} in terms of communication complexity. For the first set of experiments, one can notice that randomness hurts the convergence since the larger the value of K2, the worse the convergence in terms of communication complexity. In all cases a weaker level of randomness is preferable. For the second set of experiments, we observe that the larger K, the better communication complexity of Newton-3PCv2 except the case of w8a where the results for K = 150 are slightly better than those for K = 300. ## J.5 Behavior Of Newton-3Pcv4 **Under Different Compression Levels** Now we test the behavior of Newton-3PCv4 where 3PCv4 is based on a pair (Top-K1, Top-K2) of compressors. Again, we have to sets of experiments: in the first one we examine the performance of Newton-3PCv4 when K1 + K2 = d; in the second one we check the efficiency of Newton-3PCv4 when K1 = K2 = K varying K. In both cases we provide the behavior of Newton-EF21 (equivalent to FedNL) for comparison. All results are presented in Figure 5. ![37_image_0.png](37_image_0.png) Figure 5: First row: The performance of Newton-3PCv4 where 3PCv4 compression mechanism is based on Top-K1 and Top-K2 compressors with K1 + K2 = d in terms of communication complexity. Second row: The performance of Newton-3PCv4 where 3PCv4 compression mechanism is based on Top-K1 and Top-K2 compressors with K1 = K2 ∈ {d/8, d/4, d/2, d} in terms of communication complexity. Performance of Newton-EF21 with Top-d is given for comparison. ![37_image_1.png](37_image_1.png) 22 2 24 Figure 6: The performance of Newton-3PCv1 with 3PCv1 based on Top-d, Newton-EF21 (equivalent to FedNL) with Top-d, NL1 with Rand-1, and DINGO in terms of communication complexity. As we can see, in the first set of experiments it does not matter how we distribute d between K1 and K2 since it does not affect the performance. Regarding the second set of experiments, we can say that in some cases less aggressive compression (K1 = K2 = d) could be better than Newton-EF21. ## J.6 Study Of Newton-3Pcv1 Next, we investigate the performance of Newton-3PCv1 where 3PC compression mechanism is based on Top-K. We compare its performance with Newton-EF21 (equivalent to FedNL) with Top-d, NL1 with Rand-1, and DINGO. We observe in Figure 6 that Newton-3PCv1 is not efficient method since it fails in all cases. ## J.7 Performance Of Newton-3Pcv5 In this section we investigate the performance of Newton-3PCv5 where 3PC compression mechanism is based on Top-K. We compare its performance with Newton-EF21 (equivalent to FedNL) with Top-d, NL1 with Rand-1, and DINGO. According to the plots presented in Figure 7, we conclude that Newton-3PCv5 is not as effective as NL1 and Newton-EF21, but it is comparable with DINGO. The reason why Newton-3PCv5 is not efficient in terms of communication complexity is that we still need to send true Hessians with some nonzero probability which hurts the communication complexity of this method. ![38_image_0.png](38_image_0.png) 20 2 22 Figure 7: The performance of Newton-3PCv5 with 3PCv5 based on Top-d, Newton-EF21 (equivalent to FedNL) with Top-d, NL1 with Rand-1, and DINGO in terms of communication complexity. ![38_image_1.png](38_image_1.png) 24 Figure 8: The performance of Newton-3PC with different choice of 3PC compression mechanism in terms of communication complexity. ## J.8 Newton-3Pc **With Different Choice Of 3Pc Compression Mechanism** Now we investigate how the choice of 3PC compressor influences the communication complexity of Newton-3PC. We test the performance of Newton-3PC with EF21, CLAG, LAG, 3PCv1 (based on Top-K), 3PCv2 (based on Top-K1 and Rand-K2), 3PCv4 (based on Top-K1 and Top-K2), and 3PCv5 (based on Top-K). We choose p = 1/d for Newton-3PCv5 in order to make the communication cost of one iteration to be O(d). The choice of K, K1, and K2 is justified by the same logic. We clearly see that Newton-3PC combined with EF21 (Newton-3PC with this 3PC compressor reduces to FedNL), CLAG, 3PCv2, 3PCv4 demonstrates almost identical results in terms of communication complexity. Newton-LAG performs worse than previous methods except the case of phishing dataset. Surprisingly, Newton-3PCv1, where only true Hessian differences is compressed, demonstrates the worst performance among all 3PC compression mechanisms. This probably caused by the fact that communication cost of one iteration of Newton-3PCv1 is significantly larger than those of other Newton-3PC methods. ## J.9 Analysis Of Bidirectional Newton-3Pc J.9.1 Ef21 Compression Mechanism In this section we analyze how each type of compression (Hessians, iterates, and gradients) affects the performance of Newton-3PC. In particular, we choose Newton-EF21 (equivalent to FedNL) and change parameters of each compression mechanism. For Hessians and iterates we use Top-K1 and Top-K2 compressors respectively. In Figure 9 we present the results when we vary the parameter K1, K2 of Top-K compressor and probability p of Bernoulli Aggregation. The results are presented as heatmaps indicating the number of Mbytes transmitted in uplink and downlink directions by each client. In the first row in Figure 9 we test different combinations of compression parameters for Hessians and iterates keeping the probability p of BAG for gradients to be equal 0.5. In the second row we analyze various combinations of pairs of parameters (*K, p*) for Hessians and gradients when the compression on iterates is not applied. Finally, the third row corresponds to the case when Hessians compression is fixed (we use Top-d), and we vary pairs of parameters (*K, p*) for iterates and gradients compression. According to the results in the heatmaps, we can conclude that Newton-EF21 benefits from the iterates compression. Indeed, in both cases (when we vary compression level applied on Hessians or gradients) the best result is given in the case when we do apply the compression on iterates. This is not the case for gradients (see second row) since the best results are given for high probability p; usually for p = 1 and rarely for p = 0.75. Nevertheless, we clearly see that bidirectional compression is indeed useful in almost all cases. ![39_image_0.png](39_image_0.png) 13 22 31 40 17 26 35 44 22 31 Figure 9: First row: The performance of Newton-3PC-BC in terms of communication complexity for different values of (K1, K2) of Top-K1 and Top-K2 compressors applied on Hessians and iterates respectively while probability p = 0.75 of BAG applied on gradients is fixed. **Second row:** The performance of Newton-EF21 in terms of communication complexity for different values of (K1, p) of Top-K1 compressor applied on Hessians and probability p of BAG applied on gradients while K2 = d parameter of Top-K2 applied on iterates is fixed. Third row: The performance of Newton-EF21 in terms of communication complexity for different values of (K2, p) of Top-K2 compressor applied on iterates and probability p of BAG applied on gradients while K1 = d parameter of Top-K1 applied on Hessians is fixed. ## J.9.2 3Pcv4 Compression Mechanism In our next set of experiments we fix EF21 compression mechanism based on Top-d compressor applied on Hessians and probability p = 0.75 of Bernoulli aggregation applied on gradients. Now we use 3PCv4 update rule on iterates based on outer and inner compressors (Top-K1, Top-K2) varying the values of pairs (K1, K2). We report the results as heatmaps in Figure 10. We observe that in all cases it is better to apply relatively smaller outer and inner compression levels as this leads to better performance in terms of communication complexity. Note that the first row in heatmaps corresponds to Newton-3PC-BC when we apply just EF21 update rule on iterates. As a consequence, Newton3PC-BC reduces to FedNL-BC method (Safaryan et al., 2022). We obtain that 3PCv4 compression mechanism applied on iterates in this setting is more communication efficient than EF21. This implies the fact that Newton-3PC-BC could be more efficient than FedNL-BC in terms of communication complexity. ## J.10 Bl1 **(Qian Et Al., 2022) With 3Pc Compressor** As it was stated in Section 4.1 Newton-3PC covers methods introduced in (Qian et al., 2022) as a special case. Indeed, in order to run, for example, BL1 method we need to use rotation compression operator 20. The role of orthogonal matrix in the definition plays the basis matrix. In this section we test the performance of BL1 in terms of communication complexity with different 3PC compressors: EF21, CBAG, CLAG. For CBAG update rule the probability p = 0.5, and for CLAG the ![40_image_0.png](40_image_0.png) 32 42 52 62 Figure 10: The performance of Newton-3PC-BC with EF21 update rule based on Top-d compressor applied on Hessians, BAG update rule with probability p = 0.75 applied on gradients, and 3PCv4 update rule based on (Top-K1, Top-K2) compressors applied on iterates for different values of pairs (K1, K2). trigger ζ = 2. All aforementioned 3PC compression operators are based on Top-τ compressor where τ is the dimension of local data (see Section 2.3 of (Qian et al., 2022) for detailed description). Observing the results in Figure 11, we can notice that there is no improvement of one update rule over another. However, in EF21 is slightly better than other 3PC compressors in a half of the cases, and CBAG insignificantly outperform in other cases. This means that even if the performance of BL1 with EF21 and CBAG are almost identical, CBAG is still preferable since it is computationally less expensive since we do not need to compute local Hessians and their representations in new basis. ![40_image_1.png](40_image_1.png) CLAG CBAG Figure 11: The performance of BL1 with EF21, CBAG and CLAG 3PC compression mechanisms in terms of communication complexity. ## J.11 Analysis Of Newton-3Pc-Bc-Pp J.11.1 3Pc'S Parameters Fine-Tuning For Newton-3Pc-Bc-Pp On the following step we study how the choice of parameters of 3PC compression mechanism and the number of active clients influence the performance of Newton-3PC-BC-PP. In the first series of experiments we test Newton-3PC-BC-PP with CBAG compression combined with Top-2d compressor and probability p applied on Hessians; EF21 with Top-2d/3 compressor applied on iterates; BAG update rule with probability p = 0.75 applied on gradients. We vary aggregation probability p of Hessians and the number of active clients τ . Looking at the numerical results in Figure 12 (first row), we may claim that the more clients are involved in the optimization process in each communication round, the faster the convergence since the best results in each case always belongs the first column. However, we do observe that lazy aggregation rule with probability p < 1 is still beneficial. In the second row of Figure 12 we investigate Newton-3PC-BC-PP with CBAG compression based on Top-d and probability p = 0.75 applied on Hessians; 3PCv5 update rule combined with Top-2d/3 and probability p applied on iterates; BAG lazy aggregation rule with probability p − 0.75 applied gradients. In this case we modify iterate aggregation probability p and the number of clients participating in the training. We observe that again the fastest convergence is demonstrated when all clients are active, but aggregation parameter p of iterates smaller than 1. Finally, we study the effect of BAG update rule on the communication complexity of Newton-3PC-BC-PP. As in previous cases, Newton-3PC-BC-PP is more efficient when all clients participate in the training process. Nevertheless, lazy aggregation rule of BAG still brings the benefit to communication complexity of the method. ![41_image_0.png](41_image_0.png) 100 310 520 730 390 680 970 100 410 720 1030 Figure 12: The performance of Newton-3PC-BC-PP with various update strategies in terms of communication complexity (in Mbytes). ## J.11.2 Comparison Of Different 3Pc Update Rules Now we test different combinations of 3PC compression mechanisms applied on Hessians and iterates. First, we fix probability parameter of BAG update rule applied on gradients to p = 0.7. The number of active clients in all cases τ = n/2. We analyze various combinations of 3PC compressors: CBAG (Top-d and p = 0.7) and 3PCv5 (Top-d/2 and p = 0.7); EF21 (Top-d) and EF21 (Top-d/2); CBAG (Top-d and p = 0.7) and EF21 (Top-d/2); EF21 (Top-d) and 3PCv5 (Top-d/2 and p = 0.7) applied on Hessians and iterates respectively. Numerical results might be found in Figure 13. We can see that in all cases Newton-3PC-BC-PP performs the best with a combination of 3PC compressors that differ from EF21+EF21. This allows to conclude that EF21 update rule is not always the most effective since other 3PC compression mechanisms lead to better performance in terms of communication complexity. Nonetheless one can notice that it is useless to apply CBAG or LAG compression mechanisms on iterates. Indeed, in the case when we skip communication the iterates remain intact, and the next step is equivalent to previous one. Thus, there is no need to carry out the step again. ![41_image_1.png](41_image_1.png) Figure 13: The performance of Newton-3PC-BC-PP with different combinations of 3PC compressors applied on Hessians and iterates respectively. ## J.12 Global Convergence Of Newton-3Pc Now we investigate the performance of globally convergent Newton-3PC-LS - an extension of Newton3PC - based on the line search as it performs significantly better than Newton-3PC-CR based on cubic regularization. The experiments are done on synthetically generated datasets with heterogeneity control. A detailed description of how the datasets are created is given in section B.12 of (Safaryan et al., 2022). Roughly speaking, the generation function has 2 parameters α and β that control the heterogeneity of local data. We denote datasets created in a such way with parameters α and β as Synt(α, β). All datasets are generated with dimension d = 100, split between n = 20 clients each of which has m = 1000 local data points. In all cases the regularization parameter is chosen λ = 10−4. We compare 5 versions of Newton-3PC-LS combined with EF21 (based on Rank-1 compressor), CBAG (based on Rank-1 compressor with probability 0.8), CLAG (based on Rank-1 compressor and communication trigger ζ = 2), 3PCv2 (based on Top-3d/4 and Rand-d/4 compressors), and 3PCv4 (based on Top-d/2 and Top-d/2 compressors). In this series of experiments the initialization of H0 i is equal to zero matrix. The comparison is performed against ADIANA (Li et al., 2020b) with random dithering (s = √d), Fib-IOS (Fabbro et al., 2022), and GIANT (Wang et al., 2018). The numerical results are shown in Figure 14. According to them, we observe that Newton-3PC-LS is more resistant to heterogeneity than other methods since they outperform others *by several orders in magnitude*. Besides, we see that Newton-CBAG-LS and Newton-EF21-LS are the most efficient among all Newton-3PC-LS methods; in some cases, the difference is considerable. ![42_image_0.png](42_image_0.png) Figure 14: The performance of Newton-3PC-LS with different combinations of 3PC compressors applied on Hessians against ADIANA, Fib-IOS, and GIANT.
Review 1: Summary: This paper discusses Newton-type convex optimization methods in a distributed setting. Specifically, the authors consider a general approach using three point compressors for communicating Hessian information. A variety of compressors and aggregation schemes are explored, and two new techniques for deciding when to aggregate are proposed. Local linear and superlinear convergence rates are established for this general method depending on the quantity under consideration. Strengths and Weaknesses: ## Strengths When viewed as a generalization of FedNL to arbitrary three point compressors, while maintaining convergence guarantees, the core idea seems strong. As well, the idea of randomized updating through Bernoulli aggregation has clear benefits in terms of reducing complexity. ## Weaknesses Overall, the paper suffers from a general lack of clarity in exposition and focus on what makes this work novel. - One of the main suggested contributions is the extension of three point compressors to Hessian communication in Definition 3.1. However, using the Frobenius norm for matrices is equivalent to using the 2-norm for vectors, so the original definition suffices if the matrix is simply reshaped. Thus the novelty of this purported extension is questionable. - Fast local convergence rates are the focus of the theoretical analysis, yet in many cases it seems this would likely not be the dominant cost. Globalization strategies are partially presented in the appendix, but there is limited discussion on the subject in the main text. - In Section 4.2 it is stated that "The key novelty Newton-3PC brings" is in reducing communication and computational complexity. While the communication complexity depends on the compressor being used, it seems that the computational complexity on any local node is still large as a new Hessian must be computed and stored at every step even if there is no update. - Lemma 4.4 appears to have no dependence on the probability of updating the estimate, which begs the question of what happens when $p=0$, i.e. no update is ever sent? - In Section 4.4 local convergence rates are provided for three different quantities, yet discussion surrounding these results is lacking. - In Section 6.2 and Figure 1 the benefits of Bernoulli aggregation on communcation and computational complexity are discussed, but these results seem somewhat trivial. Infrequent updates necessarily result in a reduction of costs. - Unclear algorithm presentation. The following specifically apply to Algorithm 1, but Algorithm 2 has similar issues. - How are the initial local Hessian estimates computed? - The option to send the local error seems unnecessarily confusing, perhaps a comment that this step is only necessary if using the second update strategy would suffice. - Line 9 always sends the local updated local Hessian estimate to the server, but this will always incur a $d^2$ communication cost even if there has been no update - Unclear language - In the discussion of Example 3.3, the idea of Top-K is referenced but not defined. This, and other compressors such as Rank-K are again brought up in Section 6, but never clearly defined. - The second paragraph of Section 5 introduces three sets of parameters, but where these parameters live and their purpose is not discussed. - Throughout Section 3 the domain and range are given as $\mathrm{R}^d$ when it should be $\mathrm{R}^{d\times d}$. Requested Changes: Overall, the paper needs to be thoroughly updated to provide a clearer presentation of the author's work and a more focused discussion of their specific contributions. Addressing the weaknesses given above provide a starting point for these changes. Broader Impact Concerns: No ethical concerns. ================================================== Review 2: Summary: This paper stuides distributed Newton method with communication compression. Specifically, the three point compressor (3PC) of Richtarik et al. [2022] is combined with the traditional Newton method. Several new 3PC mechanisms, such as adaptive thresholding and Bernoulli aggregation, are discovered in this paper. Fast condition-number-independent local linear and/or superlinear convergence rates are derived for the proposed methods. Strengths and Weaknesses: Strengths: 1. The proposed Newton-3PC method is clean. 2. The theory is solid with local linear and/or superlinear convergence rates. Weaknesses: 1. The improvement of the proposed methods over the SOTA methods is not significant. In the first row of Figure 1, to achieve the same accuracy, the proposed method only saves half communication bits compared with NL1 or DINGO. 2. I am not sure if it is a trival combination of 3PC and Newton method. I suggest the authors to discuss the challenges in the proof of Theorem 4.2, especially something new beyong the proofs in the Newton method and 3PC. Requested Changes: 1. I suggest the authors to discuss the challenges in the proof of Theorem 4.2, especially something new beyong the proofs in the Newton method and 3PC. 2. I suggest the authors to compare with the uncompressed distributed Newton method in the first row of Figure 1, which communicates the full Hessian matrix. Then, the readers will know how many bits are saved after compression. 3. In Table 1, the communication cost is O(d). However, the proposed methods need to send the compressed Hessian matrix to the server. Is this because the compresser only sets the top-d elements non-zero in the d*d matrix? Broader Impact Concerns: No ================================================== Review 3: Summary: The paper proposes the use of 3pc compressors for a few federated learning settings. Strengths and Weaknesses: Strengths: The empirical results are promising and adequate. The presented algorithms and theory and clear to read and understand. I have not gone through all the proofs in the Questions/weaknesses: The paper rehashes known techniques, so novelty is limited but that is not what tmlr is about. I would suggest add more information about aggregation mechanisms and what that implies, since it is an equal part of the CLAG mechanisms. Some of the “lemmas” such as 3.6 and 3.4 are trivial and could be written as sentences to save place, if needed. Generally the convergence rates are known where the shrinkage factor (e.g. \rho in Theorem 4.2) depends on the condition number. Even if there is no compression, should the convergence rate not “fall back”to what is known about strongly convex functions? It would be nice if the authors can provide some intuition on why this does not happen, and why the presented rates turn out to be free of the condition number. The locality conditions mentioned in Lemmas 4.3 and 4.4 are required to hold for \mathcal{H^k} for Theorem 4.2, and not really required for || x^k – x^*||^2, no ? why is the latter also mentioned in the lemmas, when it can be skipped and it is not useful ? This is not really related to the paper itself or its contributions, but are the authors aware of approximate compression techniques that does not required full instantiation/calculation of the local hessians? The use of sketch and project operator is unclear, and it is also not clear how to hunt for "good" compression operators, since the analysis itself assumes this is known already. Requested Changes: Please see the strenghts/weaknesses section. Broader Impact Concerns: None ================================================== Metareview: Recommendation: Accept as is Comment: All three reviewers agreed there were interesting ideas, and that the paper was by-and-large well-executed; the paper is also a good length, which may help its impact. In terms of clarity, the high-level ideas were clear, but even after the rebuttal and revision, reviewer pEt4 still felt the details of the presentation could be cleaned up to make the paper more clear. If the authors wish to make any minor changes related to clarity before submitting the camera-ready version, that is fine with me [also for the camera-ready version, if the authors have github code that they did not include a link to before since it would de-anonymize the paper, they may choose to add it back in]. ==================================================
# Fairness Via In-Processing In The Over-Parameterized Regime: A Cautionary Tale With Mindiff Loss Akshaj Kumar Veldanda akv275@nyu.edu Electrical and Computer Engineering Department New York University Ivan Brugere∗*ivan.brugere@jpmchase.com* JP Morgan Chase AI Research Jiahao Chen∗cjiahao@gmail.com Parity Sanghamitra Dutta∗*sanghamd@umd.edu* Electrical and Computer Engineering Department University of Maryland College Park Alan Mishler∗*alan.mishler@jpmchase.com* JP Morgan Chase AI Research Siddharth Garg sg175@nyu.edu Electrical and Computer Engineering Department New York University Reviewed on OpenReview: *https: // openreview. net/ forum? id= f4VyYhkRvi& noteId* ## Abstract Prior work has observed that the test error of state-of-the-art deep neural networks often continues to decrease with increasing over-parameterization, a phenomenon referred to as double descent. This allows deep learning engineers to instantiate large models without having to worry about over-fitting. Despite its benefits, however, prior work has shown that overparameterization can exacerbate bias against minority subgroups. Several fairness-constrained DNN training methods have been proposed to address this concern. Here, we critically examine MinDiff, a fairness-constrained training procedure implemented within TensorFlow's Responsible AI Toolkit, that aims to achieve Equality of Opportunity. We show that although MinDiff improves fairness for under-parameterized models, it is likely to be ineffective in the over-parameterized regime. This is because an overfit model with zero training loss is trivially group-wise fair on training data, creating an "illusion of fairness," thus turning off the MinDiff optimization (this will apply to any disparity-based measures which care about errors or accuracy; while it won't apply to demographic parity). We find that within specified fairness constraints, under-parameterized MinDiff models can even have lower error compared to their over-parameterized counterparts (despite baseline over-parameterized models having lower error compared to their under-parameterized counterparts). We further show that MinDiff optimization is very sensitive to choice of batch size in the under-parameterized regime. Thus, fair model training using MinDiff requires time-consuming hyper-parameter searches. Finally, we suggest using previously proposed regularization techniques, viz. L2, early stopping and flooding in conjunction with MinDiff to train fair over-parameterized models. In our results, over-parameterized models trained using MinDiff+regularization with standard batch sizes are fairer than their under-parameterized counterparts, suggesting that at the very least, regularizers should be integrated into fair deep learning flows, like MinDiff. ## 1 Introduction Over the past few years, machine learning (ML) solutions have found wide applicability in a wide range of domains. However, recent work has shown that ML methods can exhibit unintended biases towards specific population groups, for instance in applications like hiring (Schumann et al., 2020), credit verification (Khandani et al., 2010), facial recognition (Buolamwini & Gebru, 2018; Grother et al., 2010; Ngan & Grother, 2015), recidivism prediction (Chouldechova, 2017) and recommendation systems (Biega et al., 2018; Singh & Joachims, 2018), resulting in negative societal consequences. To address this concern, there is a growing and influential body of work on mitigating algorithmic unfairness of ML models. These solutions are being integrated within widely used ML frameworks and are beginning to find practical deployment (Responsible-AI; Akihiko Fukuchi, 2020). As ML fairness methods make the transition from theory to practice, their ability to achieve stated goals in real-world deployments merits closer examination. Methods to train fair models can be broadly categorized based on the stage at which they are used: pre-training, in-training, or post-training. Of these, only in-training methods substantively modify the model training process. This paper examines the performance of MinDiff (Prost et al., 2019), the principal in-training method integrated within TensorFlow's Responsible AI Toolkit (Responsible-AI). We are particularly interested in MinDiff for training fair deep learning models because, given TensorFlow's widespread adoption, there is good reason to believe that it will be picked as the default choice by practitioners working within this framework. We evaluate MinDiff on three datasets, Waterbirds, CelebA, and HAM10000, that are commonly used in fairness literature; and we observe several notes of caution. Because the success of deep learning can be attributed at least in part to the surprising ability of over-parameterized deep networks to generalize (Nakkiran et al., 2020), we begin by evaluating the relationship between model capacity and fairness with MinDiff. Over-parameterized models have more parameters than required to memorize the training dataset; underparameterized models have fewer. The point at which a model is just large enough to memorize the training data is referred to as the interpolation threshold. We observe that MinDiff does increase fairness for small, under-parameterized models, but is almost entirely ineffective on larger over-parameterized networks. Thus, in some cases, under-parameterized MinDiff models can have lower fairness-constrained error compared to their over-parameterized counterparts even though over-parameterized models are always better on baseline error (i.e., error on models trained without MinDiff optimization). We caution that when using MinDiff for fairness, ML practitioners must carefully choose model capacity, something which is generally unnecessary when fairness is not a concern and the goal is simply to minimize error. We find the reason MinDiff is ineffective in the over-parameterized regime is because when a model's training loss goes to zero, any fairness metric that relies on differences in the model's accuracy across different sub-groups will also go to zero, thus creating an "illusion of fairness" and turning off MinDiff optimization. For completeness, we note that this argument does not apply to demographic parity (Calders et al., 2009) which cares about equal proportions of positive predictions in each group. Thus, we explore whether strong regularization used along with MinDiff can alleviate its ineffectiveness. Specifically, we consider two classes of regularization techniques: implicit such as batch sizing (Smith et al., 2021; Barrett & Dherin, 2021) and early stopping (Morgan & Bourlard, 1990), and explicit such as weight decay (Krogh & Hertz, 1992) and a recently proposed "loss flooding" method (Ishida et al., 2020) regularizers. We find that: (1) batch sizing only helps for medium sized models around the interpolation threshold; (2) the remaining three methods all improve fairness in the over-parameterized regime; (3) early-stopping and flooding result in the fairest models for the Waterbirds, CelebA and HAM10000 datasets, respectively; and (4) with effective regularization, over-parameterized models are fairer than their under-parameterized counterparts. ## 2 Related Work There are several techniques in the literature to mitigate algorithmic bias. These techniques can be broadly categorized as: pre-processing, in-processing and post-processing. Pre-processing techniques aim to de-identify sensitive information and create more balanced training datasets (Quadrianto et al., 2019; Ryu et al., 2018; Feldman et al., 2015; Wang & Deng, 2019; Karkkainen & Joo, 2021; Dixon et al., 2018). In-processing techniques (Prost et al., 2019; Cherepanova et al., 2021; Sagawa et al., 2020a;b; Padala & Gujar, 2021; Agarwal et al., 2018; Zafar et al., 2019; Donini et al., 2018; Lahoti et al., 2020; Beutel et al., 2019; Martinez et al., 2020; Wadsworth et al., 2018; Goel et al., 2018; Wang & Deng, 2019; Hashimoto et al., 2018) alter the training mechanism by imposing fairness constraints to the training objective, or utilize adversarial training (Beutel et al., 2017; Zhang et al., 2018; Madras et al., 2018) to make predictions independent of sensitive attributes. Post-processing techniques (Hardt et al., 2016; Wang et al., 2020; Savani et al., 2020; Chzhen et al., 2019; Jiang et al., 2020; Wei et al., 2020) alter the outputs of an existing model, for instance, using threshold correction (Zhou & Liu, 2006; Collell et al., 2016; Menon et al., 2021a) that applies different classification thresholds to each sensitive group (Hardt et al., 2016). In this paper, we focus on MinDiff (Prost et al., 2019), the primary in-processing procedure implemented within TensorFlow's Responsible AI toolkit. While our quantitative conclusions might differ, we believe that similar qualitative conclusions might hold for other in-processing methods because overfit models are trivially fair. With the growing adoption of large over-parameterized deep networks, recent efforts have sought to investigate their fairness properties (Menon et al., 2021b; Sagawa et al., 2020a; Cherepanova et al., 2021; Sagawa et al., 2020b). Pham et al. (2021); Dehghani et al. (2023) observed that over-parameterized ERM models have better worst-group generalization compared to their under-parameterized counterparts. However, Maity et al. (2022) warn that baseline ERM models should not be considered state-of-the-art to train fair over-parameterized models. Sagawa et al. (2020b) proposed a pre-processing technique by investigating the role of training data characteristics (such as ratio of majority to minority groups and relative informativeness of spurious versus core features) on fairness and observed that sub-sampling improves fairness in the over-parameterized regime. Menon et al. (2021b) found that post-processing techniques including retraining with sub-sampled majority groups and threshold correction also enhance fairness in over-parameterized models. Alabdulmohsin & Lucic (2021) proposed a post-processing algorithm that can be effectively used to debias large models. Cherepanova et al. (2021) report that in-processing convex surrogates of fairness constraints like equal loss, equalized odds penalty, disparate impact penalty, etc., (Padala & Gujar, 2021) are ineffective on over-parameterized models, but do not propose any techniques to increase the effectiveness of in-processing methods. Wald et al. (2022) theoretically show that interpolating models cannot satisfy fairness constraints. However, it is not thoroughly investigated how fairness constraints can be effectively implemented in over-parameterized models. It is possible that using methods such as MinDiff may improve the training of fair over-parameterized models. Our work is the first to systematically compare under- vs. over-parameterized deep learning models trained using in-processing fairness methods, using MinDiff as a representative technique. Regularization techniques (Morgan & Bourlard, 1990; Srivastava et al., 2014; Krogh & Hertz, 1992; Ishida et al., 2020) are popularly used in deep learning frameworks to avoid over-fitting. Lately, researchers have also exploited the benefits of regularizers to train fair models. For example, Sagawa et al. (2020a) proposed distributionally robust optimization (DRO) to improve worst-group generalization, but they observed that their approach fails if training loss converges to zero. Hence, they use L2 weight regularization and early stopping to improve fairness in the over-parameterized regime. Our paper systematically evaluates different regularizers, including batch sizing, early stopping, weight decay and the recently proposed flooding loss (Ishida et al., 2020) for MinDiff training across different model sizes, and makes several new observations about the role of regularization in enhancing fairness. ## 3 Methodology We now describe our evaluation methodology. ## 3.1 Formal **Setup** In this paper, we consider binary classification problem on a training dataset D = {xi, ai, yi} N i=1, where xi is an input (an image for instance) ai ∈ {0, 1} is a sensitive attribute of the input, and yi ∈ {0, 1} is the corresponding ground-truth label. The training data is sampled from a joint distribution D*X,A,Y* over random variables X, A, and Y . Deep neural network (DNN) classifiers are represented as a parameterized function fθ : X → [0, 1], where θ are trainable parameters, obtained in practice by minimizing the empirical binary cross-entropy primary loss function LP : $${\mathcal{L}}_{P}=-{\frac{1}{N}}\sum_{i=1}^{N}[y_{i}\cdot\log(f_{\theta}(x_{i}))+(1-y_{i})\cdot\log(1-f_{\theta}(x_{i}))]$$ via stochastic gradient descent (SGD). We denote the classification threshold as τ which can be used to make predictions ˆfθ(x; τ ) as shown below .) $\blacksquare$ $$\hat{f}_{\theta}(x;\tau)=\begin{cases}1,&f_{\theta}(x)\geq\tau\\ 0,&\text{otherwise}.\end{cases}\tag{2}$$ $$\left({3}\right)$$ The goal is to attain low error at the population level, i.e., P[ ˆfθ(X; τ ) ̸= Y ] (typically, τ = 0.5). As the data-generating distribution is unavailable, standard DNN training seeks to achieve low empirical error on a test set, which we refer to as *test error* for short. However, performance conditioned on sensitive attributes can vary, leading to outcomes that are biased in favor of or against specific sub-groups. Several fairness metrics have been defined in prior work to account for this bias; in this paper, we will use the widely adopted equality of opportunity metric (Hardt et al., 2016). Equality of Opportunity (Hardt et al., 2016) is a widely adopted fairness notion that seeks to equalize false negative rates (FNR) across sensitive groups to achieve fairness in contexts where a higher FNR for a certain group can result in unfair outcomes, such as wrongful convictions or denial of opportunities in comparison to other groups. For binary sensitive attributes the FNRgap at the population level is defined as: $$\mathbb{P}[{\hat{f}}_{\theta}(X;\tau)=0|Y=1,A=0]-\mathbb{P}[{\hat{f}}_{\theta}(X;\tau)=0|Y=1,A=1]\big[.$$ In practice, we measure the population-level FNRgap on a test set, which we will refer to as just FNRgap for short. As we describe next, MinDiff (and several other methods) seek to minimize the FNRgap during training. ## 3.2 Mindiff Training MinDiff (Prost et al., 2019) is an in-processing optimization framework that seeks to achieve a balance between two objectives: low test error and low FNRgap. For this, MinDiff proposes a modified loss function LT = LP + λLM, where LT is the total loss, that is a weighted sum of the primary cross-entropy loss, defined in Equation (1), and LM, a differentiable proxy for the FNRgap. In the modified loss function, λ ∈ R+ is a user-defined parameter that controls the relative importance of the fairness versus the empirical cross-entropy loss. The fairness term in the modified loss function, LM, uses the maximum mean discrepancy (MMD) distance between the neural network's outputs for the two sensitive groups when Y = 1, i.e., $${\mathcal{L}}_{M}=\mathrm{MMD}(f_{\theta}(X)|A=0,Y=1,f_{\theta}(X)|A=1,Y=1).$$ LM = MMD(fθ(X)|A = 0, Y = 1, fθ(X)|A = 1, Y = 1). (4) Intuitively, the MMD loss LM penalizes any statistical dependence between the predictions for the two subgroups which are made by the model on positive examples. We refer the reader to Appendix A for a formal mathematical definition of the MMD distance (Prost et al., 2019). ## 3.3 Post-Hoc Threshold Correction Due to fairness requirements of the application, ML practitioners might seek to train models with a population level FNRgap lower than a specified threshold ∆FNR. This can be done using an additional post-processing step as proposed by Hardt et al. (2016). The idea is to use different classification thresholds for each sub-group, τA=0 and τA=1, that are selected such that the population level FNRgap under these thresholds is below the constraint: $$\left|\mathbb{P}[\hat{f}_{\theta}(X;\tau_{A=0})=0|Y=1,A=0]-\mathbb{P}[\hat{f}_{\theta}(X;\tau_{A=1})=0|Y=1,A=1]\right|\leq\Delta_{\mathrm{FNR}}$$ $$\left({\boldsymbol{4}}\right)$$ $\left(5\right)^3$ ![4_image_0.png](4_image_0.png) Figure 1: We show the model-wise double descent behaviour on baseline models trained using (a) Waterbirds and (b) CelebA datasets respectively. Interpolation threshold (shown in green dotted line) is the point where the model is large enough to fit the training data. The region beyond the interpolation threshold is called the over-parameterized regime. In practice, the two thresholds can be picked using grid search and empirically measuring population level FNRgap at each grid point on a validation dataset. The resulting thresholds yield a test error which we refer to as the **fairness-constrained test error**. Pareto front of fairness-constrained test error and ∆FNR is used to compare different model sizes and fairness methods. In particular, a model or method is fairer if it has lower fairness-constrained test error compared to the alternative for a fixed ∆FNR. ## 3.4 Regularization Techniques We evaluate four regularization techniques to improve performance of MinDiff on over-parameterized networks. Reduced Batch Sizes: Due to the stochastic nature of SGD, smaller batch sizes can act as implicit regularizers during training (Smith et al., 2021; Barrett & Dherin, 2021). This is because smaller batch sizes provide a noisy estimate of the total loss LT . Weight Decay: Weight decay (Krogh & Hertz, 1992) explicitly penalizes the parameters θ of the DNN from growing too large. Weight decay adds a penalty, usually the L2 norm of the weights, to the loss function. Early Stopping: Early stopping (Morgan & Bourlard, 1990) terminates DNN training earlier than the point at which training loss converges to a local minima, and has been shown to be particularly effective for over-parameterized deep networks (Li et al., 2019). A common implementation of early stopping is to terminate training once the validation loss has not improved for a certain number of gradient steps or epochs (Morgan & Bourlard, 1990). For models trained with MinDiff, we explore two versions of early stopping in which we use either the primary loss, LP , or total loss, LT , as a stopping criterion. Flooding Regularizer: Finally, motivated by our goal to prevent the primary training loss from going to zero (which then turns off MinDiff as well), we apply the flooding regularizer (Ishida et al., 2020) that encodes this goal *explicitly*. Flooding operates by performing gradient descent only if LP > b, where b is the flood level. Otherwise, if LP ≤ b, then gradient ascent takes place as shown in Equation 6. This phenomenon ensures that LP floats around the flood level b and never approaches zero. We implement flooding by replacing the primary loss term in LT with a new loss term: $${\mathcal{L}}_{P}^{\prime}=\left|{\mathcal{L}}_{P}-b\right|+b,$$ P = LP − b + b, (6) which, in turn, enables continued minimization of the MinDiff loss term, LM, over the training process. $\left(6\right)$. ![5_image_0.png](5_image_0.png) Figure 2: We show the (a) average test error, and (b) FNRgap versus model width for MinDiff optimization with λ = {0.0, 0.5, 1.0, 1.5}'s on Waterbirds dataset. MinDiff optimization has negligible to no impact on fairness in the over-parameterized models. However, for under-parameterized models, we find that increasing λ substantially reduces the FNRgap. ## 4 Experimental Setup We perform our experiments on the Waterbirds (Sagawa et al., 2020a), CelebA (Liu et al., 2015) and HAM10000 (Tschandl, 2018) datasets which have previously been used in fairness evaluations of deep learning models. Here, we describe network architectures, training and evaluations for the two datasets. ## 4.1 Waterbirds Dataset Waterbirds is a synthetically created dataset (Sagawa et al., 2020a) which contains water- and land-bird images overlaid on water and land backgrounds. A majority of waterbirds (landbirds) appear in water (land) backgrounds, but in a minority of cases waterbirds (landbirds) also appear on land (water) backgrounds. As in past work, we use the background as the sensitive feature. Further, we use waterbirds as the positive class and landbirds as the negative class. The dataset is split into training, validation and test sets with 4795, 1199 and 5794 images in each dataset respectively. We follow the training methodology described in (Sagawa et al., 2020b) to train a deep network for this dataset. First, a fixed pre-trained ResNet-18 model is used to extract a d-dimensional feature vector µ. This feature vector is then converted into an m-dimensional feature µ ′ = *ReLU*(Uµ), where U ∈ R m×dis a random matrix with each row sampled uniformly from a unit sphere S d−1. A logistic regression classifier is trained on µ ′. Model width is controlled by varying m, the dimensionality of µ ′, from 10 to 10, 000. ## 4.2 Celeba Dataset The CelebA dataset consists of 202,599 celebrity face images annotated with 40 binary attributes including gender, hair colour, hair style, eyeglasses, etc. In our experiments, we set the target label Y to be hair color, which is either blond (Y = 1) or non-blond (Y = 0), and the sensitive attribute to be gender. Blond individuals constitute only 15% of this dataset, and only 6% of blond individuals are men. Consequently baseline models make disproportionately large errors on blond men versus blond women. The objective of MinDiff training is to minimize the FNRgap between blond men and blond women1. The dataset is split into training, validation and test sets with 162770, 19867 and 19962 images, respectively. We used the ResNet-preact-18 model for this dataset, and vary model capacity by uniformly scaling the number of channels in all layers. We also train a LeNet-5 architecture on CelebA dataset and compare it with the ResNet-preact-18 model. 1Note that the MinDiff paper uses False Positive Rate, but this is totally arbitrary here since the class labels are arbitrary. ![6_image_0.png](6_image_0.png) Figure 3: We show the progress of primary loss and population level FNRgap, evaluated on training dataset and on the validation dataset, versus SGD steps during MinDiff optimization (λ = 1.5) for under-parameterized and over-parameterized models on CelebA dataset. We find that over-parameterized models over-fits to the training data and achieve zero population level FNRgap on the training dataset, thus turning off MinDiff optimization. Whereas, population level FNRgap on the training dataset is positive in the under-parameterized models, allowing for MinDiff optimization to be effective. ## 4.3 Ham10000 Dataset HAM10000 dataset consists of 10,015 dermatoscopic images for automatic diagnosis of pigmented skin lesions. Each image in the dataset contains several annotations including sensitive attributes like age, gender and the diagnosis labels of the patient. Medical imaging is a problem with direct human impact and this dataset has been previously studied in the context of bias and fairness (Daneshjou et al., 2022). Following prior work (Zong et al., 2023; Maron et al., 2019), we split the 7 diagnostic labels into benign: basal cell carcinoma (bcc), benign keratosis-like lesions (bkl), dermatofibroma (df), melanocytic nevi (nv), and vascular lesions (vasc), and malignant: actinic keratoses and intraepithelial carcinoma / Bowen's disease (akiec), and melanoma (mel). In our experiments, we set the target label Y to be the diagnostic label, which is either malignant (Y = 1) or benign (Y = 0), and the sensitive attribute to be age. We categorize all patients into two demographic groups based on their age: those under 40 (< 40) and those 40 years old or above (≥ 40). Malignant individuals constitute only 15% of this dataset, and only 6% of malignant individuals are < 40. Consequently baseline models make disproportionately large errors on malignant (< 40) individuals versus malignant (≥ 40) individuals. The objective of MinDiff training is to minimize the FNRgap between malignant (< 40) and malignant (≥ 40) individuals. We discard images whose sensitive attributes are not available and the dataset is split into training, validation and test sets with 7967, 989 and 1002 images, respectively. We used the pre-trained ResNet-18 as an over-parameterized model and LeNet-5 as an under-parameterized model for this dataset. ## 4.4 Hyper-Parameters And Training Details Waterbirds We train for a total of 30, 000 gradient steps using the Adam optimizer. For our baseline experiments, we set batch size to 128 and use a learning rate schedule with initial learning rate = 0.01 and decay factor of 10 for every 10, 000 gradient steps. We ran every experiment 10 times with random initializations and report the average of all the runs. We trained and evaluated all the models using the Waterbirds dataset on an Intel Xeon Platinum 8268 CPU (24 cores, 2.9 GHz). CelebA We train for a total of 48, 000 gradient steps using the Adam optimizer. We set the baseline batch size to 128 and adopt a learning rate scheduler with initial learning rate of 0.0001 and decay factor of 10 for every 16, 000 gradient steps. In our experiments, we varied the number of channels in the first ResNet-preact-18 block from 1 to 64 (the number of channels is then scaled up by two in each block). We trained all the models using the CelebA dataset on NVIDIA 4 x V100 (32 GB) GPU cards. HAM10000 We train for a total of 12, 600 and 7, 000 gradient steps using the Adam optimizer for LeNet-5 and ResNet-18 architectures, respectively. We set the baseline batch size to 128 and set the learning rate to 0.0001. We adopt a learning rate scheduler with a decay factor of 10 for every 1, 260 gradient steps for ResNet-18 models. We trained all the models using the HAM10000 dataset on NVIDIA V100 (32 GB) GPU cards. For Waterbirds and CelebA datasets, we performed MinDiff training with values of λ = {0.0, 0.5, 1.0, 1.5}, where recall that λ controls the importance of the fairness objective. λ = 0.0 corresponds to training with the primary loss only, and we refer to the resulting model as the baseline model. To study the effect of batch sizing, we trained additional models with batch sizes {8, 32}. We explored with three different weight decay strengths = {0.001, 0.1, 10.0} and two different flood levels, b ∈ {0.05, 0.1}. We report the average ± 95% confidence interval in all figures and tables. For HAM10000 dataset, we performed MinDiff training with values of λ = {0.0, 0.5, 1.0, 1.5}. We explored with two different weight decay strengths = {0.001, 0.1} and = {0.001, 0.01} for LeNet-5 and ResNet-18 architectures, respectively. Additionally, we tested the impact of two different flood levels, which were b ∈ {0.2, 0.3} for LeNet-5 and b ∈ {0.05, 0.1} for ResNet-18. ## 5 Experimental Results 5.1 Identifying The Interpolation Threshold To distinguish between under- and over-parameterized models, we begin by identifying the interpolation threshold; the point where the model is sufficiently large to interpolate the training data (achieve population level zero error on training data). Figure 1(a) and Figure 1(b) show the population level error on training data and test error curves for baseline training versus model width for the Waterbirds and CelebA datasets, respectively, showing interpolation thresholds at model widths of 400 for Waterbirds and 11 for CelebA. On both the datasets, we also observe the double descent phenomenon (Nakkiran et al., 2020), where the test error *decreases* with increasing model capacity beyond the interpolation threshold. That is, for the original model (training without MinDiff), the largest models provide high accuracy. ![7_image_0.png](7_image_0.png) Figure 4: We plot the fairness constrained test error with a ∆FNR ≤ 10% constraint on the MinDiff trained models with λ = {0.0, 0.5, 1.0, 1.5} on (a) Waterbirds and (b) CelebA datasets respectively. On both these datasets, we find that MinDiff is only effective for under-parameterized models. ## 5.2 Mindiff Evaluation We now re-train our models with MinDiff optimization with λ = {0.0, 0.5, 1.0, 1.5}. Figure 2 shows the test error and FNRgap versus model width for the Waterbirds dataset. In the under-parameterized regime, we observe that, increasing the MinDiff weights significantly reduces the FNRgap with only a small drop in test accuracy. However, in the over-parameterized regime, we find that MinDiff training has no impact on either test error or the FNRgap. ![8_image_0.png](8_image_0.png) Figure 5: We plot the fairness constrained test error with a ∆FNR ≤ 10% constraint on the MinDiff trained model with λ = 1.5 on (a) Waterbirds and (b) CelebA datasets respectively. We find that smaller batch sizes are only effective around the interpolation threshold. | to that in the over-parameterized models. We report each data point by averaging over 10 runs. Width λ = 0 λ = 0.5 λ = 1.0 λ = 1.5 Error FNR Gap Error FNR Gap Error FNR Gap Error FNR Gap | | | | | | | | | |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|--------------|-------------|--------------|-------------|--------------|-------------|--------------| | 5 (Under-) | 4.74 ± 0.07 | 48.77 ± 1.44 | 5.55 ± 0.39 | 39.85 ± 3.82 | 5.46 ± 0.36 | 40.45 ± 5.58 | 5.47 ± 0.34 | 37.06 ± 5.88 | | 7 (Under-) | 5.07 ± 0.07 | 47.35 ± 1.53 | 5.76 ± 0.5 | 40.27 ± 2.45 | 5.64 ± 0.52 | 42.7 ± 3.12 | 5.48 ± 0.4 | 43.05 ± 4.2 | | 9 (Under-) | 5.31 ± 0.07 | 44.78 ± 1.72 | 5.72 ± 0.4 | 42.37 ± 1.75 | 5.77 ± 0.53 | 40.91 ± 3.28 | 5.52 ± 0.42 | 42.43 ± 3.74 | | 13 (Over-) | 5.52 ± 0.07 | 42.79 ± 2.03 | 5.57 ± 0.1 | 42.16 ± 2.33 | 5.66 ± 0.17 | 42.53 ± 0.98 | 5.67 ± 0.32 | 43.07 ± 2.12 | | 19 (Over-) | 5.36 ± 0.09 | 43.98 ± 1.81 | 5.33 ± 0.05 | 42.52 ± 1.25 | 5.42 ± 0.07 | 42.63 ± 1.01 | 5.45 ± 0.11 | 41.34 ± 1.41 | | 55 (Over-) | 4.98 ± 0.07 | 44.14 ± 1.55 | 5.05 ± 0.07 | 42.46 ± 1.28 | 5.24 ± 0.06 | 42.65 ± 1.85 | 5.47 ± 0.15 | 41.93 ± 1.88 | | 64 (Over-) | 4.99 ± 0.06 | 42.54 ± 2.01 | 5.11 ± 0.06 | 43.12 ± 2.04 | 5.28 ± 0.12 | 41.8 ± 2.32 | 5.40 ± 0.15 | 41.56 ± 2.7 | Table 1 shows the test error and FNRgap for selected under- and over-parameterized models on the CelebA dataset trained with MinDiff. Our conclusions are qualitatively the same as for Waterbirds. We find that, MinDiff training significantly reduces the FNRgap compared to the baseline model in the under-parameterized regime, for example, from a 48% FNR gap without MinDiff to a 37% FNR gap with λ = 1.5 for a model width of 5. On the other hand, MinDiff training compared with the baseline model has a negligible effect on both test error and FNRgap in the over-parameterized regime, sometimes even resulting in a (small) increase in both. Table 2: We tabulate the fairness constrained test error (with a ∆FNR ≤ 10% constraint) of early stopped MinDiff models (trained with λ = {0.5, 1.0, 1.5}) for different widths. We compare two methods for early stopping (es) based on the stopping criterion: primary validation loss (es(LP )) and total validation loss (es(LT )). We find that, for CelebA dataset, MinDiff + es(LP ) is better than MinDiff + es(LT ). λ = 0.5 λ = 1.0 λ = 1.5 Width = 5 Width = 19 Width = 64 Width = 5 Width = 19 Width = 64 Width = 5 Width = 19 Width = 64 No es 6.36 ± 0.51 6.54 ± 0.12 5.88 ± 0.13 6.25 ± 0.43 6.43 ± 0.12 6.06 ± 0.06 6.36 ± 0.35 6.54 ± 0.18 6.07 ± 0.2 es(LP ) 6.17 ± 0.34 5.91 ± 0.26 5.45 ± 0.22 6.32 ± 0.28 5.82 ± 0.32 4.79 ± 0.17 6.37 ± 0.25 5.63 ± 0.3 4.70 ± 0.07 es(LT ) 7.76 ± 0.56 6.47 ± 0.31 5.76 ± 0.61 7.79 ± 0.47 7.18 ± 0.58 6.05 ± 0.53 8.65 ± 0.65 7.38 ± 0.77 6.80 ± 0.64 We observe that MinDiff performs poorly for over-parameterized models: Figure 3 shows how the population level primary loss and FNRgap's change, evaluated on training and validation datasets, during SGD steps for under-parameterized and over-parameterized models on the CelebA dataset. We note that at the beginning of training, the population level FNRgap on training dataset is small because randomly initialized models make random predictions. These random predictions are fair w.r.t the error rates but not necessarily fair according to other criteria like Demographic Parity. As training progresses, the over-parameterized model eventually over-fits the training data at around 20,000 steps, achieving zero primary loss. This model also appears to be trivially fair from the standpoint of the training data—observe that at the same point, the population level FNRgap on the training dataset also goes to zero, and no further optimization takes place. On the other hand, the population level FNRgap during training remains positive for the under-parameterized model. Figure 4 plots the fairness constrained test error with a ∆FNR ≤ 10% constraint using post-training threshold correction on the MinDiff trained models. We can again observe that MinDiff is only effective for underparameterized models. We include results for larger λ ∈ {8.0, 16.0, 32.0} values in Appendix B and observe that the findings do not change. For CelebA, the lowest fairness constrained test error is actually achieved by an under-parameterized model. In other words, achieving fairness via MinDiff optimization requires careful selection of model width, including exploring the under-parameterized regime. Table 3: We tabulate the fairness constrained test error (with a ∆FNR ≤ 10% constraint) for different regularization schemes used in conjunction with MinDiff optimization (λ = 1.5) on LeNet-5 and ResNetpreact-18 (with three model widths ∈ {5, 19, 64}) models trained using CelebA dataset. The performance of best regularizer is highlighted in bold for each model width. Notation: wd is weight decay, es(LP ) is early stopping w.r.t primary loss and fl is flooding. Method LeNet-5 Width = 5 Width = 19 Width = 64 Under- Under- Over- Over-λ = 0 9.73 ± 0.26 5.92 ± 0.19 6.51 ± 0.11 5.76 ± 0.1 λ = 1.5 9.53 ± 0.17 6.36 ± 0.35 6.54 ± 0.18 6.07 ± 0.2 λ = 1.5 + wd = 0.001 9.87 ± 0.28 5.82 ± 0.2 6.53 ± 0.16 5.08 ± 0.15 λ = 1.5 + wd = 0.1 12.68 ± 0.03 6.15 ± 0.15 5.82 ± 0.16 6.57 ± 0.1 λ = 1.5 + es(LP ) 9.44 ± 0.14 6.37 ± 0.25 5.63 ± 0.3 4.70 ± 0.07 λ = 1.5 + fl = 0.05 9.53 ± 0.17 6.28 ± 0.25 6.30 ± 0.23 5.49 ± 0.17 λ = 1.5 + fl = 0.1 9.52 ± 0.17 6.30 ± 0.3 5.25 ± 0.**25 4**.67 ± 0.12 ## 5.3 Impact Of Regularization In Over-Parameterized Regime We now examine if additional regularization can help improve the fairness of MinDiff-regularized models in the over-parameterized regime. Unless otherwise stated, in all subsequent evaluations we perform post-training threshold correction with a ∆FNR ≤ 10% constraint and compare fairness constrained test error. Batch sizing only helps around the interpolation threshold. Small batch sizes cause primary training loss curves to converge more slowly, potentially providing more opportunity for MinDiff optimizations. In Figure 5(a) and Figure 5(b), we plot fairness constrained test error curves versus model widths for different batch sizes on the Waterbirds and CelebA datasets, respectively. We find that smaller batch sizes improve fairness constrained test error only around the interpolation threshold for both the datasets, but do not noticeably benefit smaller and larger models. On further examination, we note the benefits around the interpolation threshold are because smaller batch sizes induce stronger regularization effects and push the interpolation threshold to the right (see Appendix Figure 13). As a result, MinDiff is effective on a slightly increased range of model widths. However, other than this behaviour, we see no other benefits of using batch sizing as a regularizer and do not explore it further. Early stopping criterion. We evaluate two methods for early stopping. The first uses the primary validation loss (MinDiff+es(LP )) as a stopping criterion, while the second uses total validation loss for stopping (MinDiff+es(LT )). Figure 6 plots fairness constrained test error versus model width for these two schemes and different values of λ on Waterbirds, and Table 2 shows the same data for CelebA. We find that both schemes improve fairness for over-parameterized models, but have limited impact in the underparameterized regime. For Waterbirds, the differences between the two are small, although using primary validation loss as the stopping criterion (MinDiff+es(LP )) is marginally better than using total validation loss (MinDiff+es(LT )). However, for CelebA, we find that primary loss stopping criterion (MinDiff+es(LP )) is substantially better than total loss stopping criterion (MinDiff+es(LT )), especially for large models. Thus, we use the former for the remainder of our experiments. Comparing regularization methods on Waterbirds. In Figure 7, we plot the fairness constrained test error versus model width for different regularization schemes including early stopping ( )+es), weight decay with two different values ( ) + wd=0.001, x+wd=0.1) and flooding ( ) + fl) on Waterbirds. We find that the early stopping and weight decay regularizes substantially improve fairness for models just below the interpolation threshold and all over-parameterized models. In contrast, flooding shows only small improvements in fairness. For \ = 0.5, we find that early stopping is the best across the board. For \ = 1.5, either early stopping and weight decay are the best depending on model width, although the differences are small. ![10_image_0.png](10_image_0.png) Figure 6: We plot the fairness constrained test error (with a AFNR ≤ 10% constraint) of early stopped MinDiff models (trained with ) = {0.5, 1.0, 1.5}) for several model widths. We compare two methods for early stopping (es) based on the stopping criterion: primary validation loss (es (Cp)) and total validation loss (es (LT)). We find that, for Waterbirds dataset, using either stopping criterion will significantly improve fairness constrained error, especially in the over-parameterized regime. ![10_image_1.png](10_image_1.png) Figure 7: We plot fairness constrained test error (with a AFNR ≤ 10% constraint) versus model widths for different regularization schemes used in conjunction with MinDiff optimization on Waterbirds dataset. We find that early stopping and weight decay are preferred choice of regularizers for Waterbirds dataset. Notation: wd is weight decay, es(Lp) is early stopping w.r.t primary loss and fl is flooding. | λ = 0.5 | | λ = 1.0 | λ = 1.5 | | | | |----------------|--------------|--------------|--------------|--------------|--------------|--------------| | LeNet-5 | ResNet-18 | LeNet-5 | ResNet-18 | LeNet-5 | ResNet-18 | | | λ = 0 | 14.64 ± 0.40 | 10.85 ± 0.22 | 14.64 ± 0.40 | 10.85 ± 0.22 | 14.64 ± 0.40 | 10.85 ± 0.22 | | λ | 14.60 ± 0.35 | 11.91 ± 0.12 | 14.34 ± 0.74 | 10.86 ± 0.45 | 14.61 ± 0.53 | 11.47 ± 0.19 | | λ + wd = 0.001 | 13.97 ± 0.14 | 12.77 ± 1.02 | 14.60 ± 0.47 | 12.34 ± 0.46 | 15.01 ± 0.64 | 10.75 ± 0.08 | | λ + wd = 0.01 | - | 10.94 ± 1.29 | - | 12.74 ± 1.23 | - | 12.35 ± 0.66 | | λ + wd = 0.1 | 14.27 ± 0.10 | - | 14.11 ± 0.08 | - | 14.18 ± 0.24 | - | | λ + es(LP ) | 14.30 ± 0.47 | 13.41 ± 1.32 | 15.10 ± 1.14 | 12.04 ± 1.09 | 14.73 ± 1.11 | 13.12 ± 1.31 | | λ + es(Lt) | 14.20 ± 0.09 | 12.54 ± 0.77 | 14.14 ± 0.09 | 12.51 ± 0.86 | 14.15 ± 0.16 | 12.95 ± 1.4 | | λ + fl = 0.05 | - | 12.11 ± 0.37 | - | 10.68 ± 0.59 | - | 11.02 ± 0.79 | | λ + fl = 0.1 | - | 11.78 ± 1.07 | - | 12.64 ± 1.13 | - | 12.82 ± 0.51 | | λ + fl = 0.2 | 14.47 ± 0.22 | - | 14.27 ± 0.65 | - | 14.53 ± 0.56 | - | | λ + fl = 0.3 | 14.77 ± 0.72 | - | 14.50 ± 0.64 | - | 15.13 ± 0.89 | - | Comparing regularization methods on CelebA. Table 3 compares different regularization schemes for λ = 1.5 on LeNet-5 architecture and three ResNet-preact-18 model widths, each trained on CelebA dataset. For LeNet-5, we observe that early stopping results in lowest fairness constrained test error. For ResNet-preact-18 with smallest width, we find that weight decay schemes result in the lowest fairness constrained test error, while for the large over-parameterized model, flooding works best. Comparing across all models, we find that, the largest model with flooding provides the overall lowest fairness constrained test error. Recalling that flooding was ineffective on Waterbirds, we conclude that no one regularizer works best across datasets and model widths, but additional regularization in general can restore the benefits of over-parameterization with MinDiff training. Comparing regularization methods on HAM10000. From Appendix Figure 9, we observe that for ResNet-18 (λ = 1.5) the primary loss over-fits to the training dataset and achieves zero training loss thus turning off MinDiff optimization on the over-parameterized model. In contrast, for the under-parameterized model, MinDiff optimization is active and aids in improving fairness since training loss is non-zero. Table 4 compares different regularization schemes on the HAM10000 dataset for λ = 0.5, λ = 1.0 and λ = 1.5. We can observe that the fairness constrained test error of MinDiff model is lower for LeNet-5 architecture compared to baseline model, whereas, for over-parameterized ResNet-18 model, the fairness constrained test error of baseline model is lower compared to MinDiff model. However, for both the models, regularization improves the fairness constrained test error for all values of λ except for ResNet-18, where a smaller value of λ = 0.5 seems to be having no effect on fairness. ## 6 Conclusion In this paper, we have critically examined the performance of MinDiff, an in-training fairness regularization technique implemented within TensorFlow's Responsible AI toolkit, with respect to DNN model complexity, with a particular eye towards over-parameterized models. We find that although MinDiff improves the fairness of under-parameterized models relative to baseline, it is ineffective in improving fairness for over-parameterized models. As a result, we find that for one of our datasets, under-parameterized MinDiff models have lower fairness constrained test error than their over-parameterized counterparts, suggesting that time-consuming searches for best model size might be necessary when MinDiff is used with the goal of training a fair model. To address these concerns, we explore traditional batch sizing, weight decay and early stopping regularizers to improve MinDiff training, in addition to flooding, a recently proposed method that is evaluated for the first time in the context of fair training. We find that batch sizing is ineffective in improving fairness except for model widths near the interpolation threshold. The other regularizers do improve fairness for over-parameterized models, but the best regularizer depends on the dataset and model size. In particular, flooding results in the fairest models on the CelebA dataset, suggesting its utility for MinDiff optimization. Finally, we show that with appropriate choice of regularizer, over-parameterized MinDiff models regain their benefits over under-parameterized counterparts even from a fairness lens. ## Availability Code with README.txt file is available at: https://github.com/akshajkumarv/MinDiff ## References Alekh Agarwal, Alina Beygelzimer, Miroslav Dudík, John Langford, and Hanna Wallach. A reductions approach to fair classification. arXiv preprint arXiv:1803.02453, 2018. Masashi Sode Akihiko Fukuchi, Yoko Yabe. Fairtorch. https://github.com/wbawakate/fairtorch, 2020. Ibrahim M Alabdulmohsin and Mario Lucic. A near-optimal algorithm for debiasing trained machine learning models. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan (eds.), *Advances in Neural Information Processing Systems*, volume 34, pp. 8072– 8084. Curran Associates, Inc., 2021. URL https://proceedings.neurips.cc/paper/2021/file/ 43c656628a4a479e108ed86f7a28a010-Paper.pdf. David Barrett and Benoit Dherin. Implicit gradient regularization. In *International Conference on Learning* Representations, 2021. URL https://openreview.net/forum?id=3q5IqUrkcF. Alex Beutel, Jilin Chen, Zhe Zhao, and Ed H. Chi. Data decisions and theoretical implications when adversarially learning fair representations. arXiv preprint arXiv:1707.00075, 2017. Alex Beutel, Jilin Chen, Tulsee Doshi, Hai Qian, Allison Woodruff, Christine Luu, Pierre Kreitmann, Jonathan Bischof, and Ed H. Chi. Putting fairness principles into practice: Challenges, metrics, and improvements. In *Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society*, AIES '19, pp. 453–459, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450363242. doi: 10.1145/3306618.3314234. URL https://doi.org/10.1145/3306618.3314234. Asia J. Biega, Krishna P. Gummadi, and Gerhard Weikum. Equity of attention: Amortizing individual fairness in rankings. The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, 2018. Joy Buolamwini and Timnit Gebru. Gender shades: Intersectional accuracy disparities in commercial gender classification. In Sorelle A. Friedler and Christo Wilson (eds.), Proceedings of the 1st Conference on Fairness, Accountability and Transparency, volume 81 of *Proceedings of Machine Learning Research*, pp. 77–91. PMLR, 23–24 Feb 2018. URL https://proceedings.mlr.press/v81/buolamwini18a.html. Toon Calders, Faisal Kamiran, and Mykola Pechenizkiy. Building classifiers with independency constraints. In 2009 IEEE International Conference on Data Mining Workshops, pp. 13–18, 2009. doi: 10.1109/ICDMW. 2009.83. Valeriia Cherepanova, Vedant Nanda, Micah Goldblum, John P. Dickerson, and Tom Goldstein. Technical challenges for training fair neural networks. arXiv preprint arXiv:2102.06764, 2021. Alexandra Chouldechova. Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. *Big Data*, 5(2):153–163, 2017. doi: 10.1089/big.2016.0047. URL https://doi.org/10.1089/ big.2016.0047. PMID: 28632438. Evgenii Chzhen, Christophe Denis, Mohamed Hebiri, Luca Oneto, and Massimiliano Pontil. *Leveraging* Labeled and Unlabeled Data for Consistent Fair Binary Classification. Curran Associates Inc., Red Hook, NY, USA, 2019. Guillem Collell, Drazen Prelec, and Kaustubh R. Patil. Reviving threshold-moving: a simple plug-in bagging ensemble for binary and multiclass imbalanced data. *ArXiv*, abs/1606.08698, 2016. Roxana Daneshjou, Kailas Vodrahalli, Roberto A. Novoa, Melissa Jenkins, Weixin Liang, Veronica Rotemberg, Justin Ko, Susan M. Swetter, Elizabeth E. Bailey, Olivier Gevaert, Pritam Mukherjee, Michelle Phung, Kiana Yekrang, Bradley Fong, Rachna Sahasrabudhe, Johan A. C. Allerup, Utako Okata-Karigane, James Zou, and Albert S. Chiou. Disparities in dermatology ai performance on a diverse, curated clinical image set. *Science Advances*, 8(32):eabq6147, 2022. doi: 10.1126/sciadv.abq6147. URL https: //www.science.org/doi/abs/10.1126/sciadv.abq6147. Mostafa Dehghani, Josip Djolonga, Basil Mustafa, Piotr Padlewski, Jonathan Heek, Justin Gilmer, Andreas Steiner, Mathilde Caron, Robert Geirhos, Ibrahim Alabdulmohsin, Rodolphe Jenatton, Lucas Beyer, Michael Tschannen, Anurag Arnab, Xiao Wang, Carlos Riquelme, Matthias Minderer, Joan Puigcerver, Utku Evci, Manoj Kumar, Sjoerd van Steenkiste, Gamaleldin F. Elsayed, Aravindh Mahendran, Fisher Yu, Avital Oliver, Fantine Huot, Jasmijn Bastings, Mark Patrick Collier, Alexey Gritsenko, Vighnesh Birodkar, Cristina Vasconcelos, Yi Tay, Thomas Mensink, Alexander Kolesnikov, Filip Pavetić, Dustin Tran, Thomas Kipf, Mario Lučić, Xiaohua Zhai, Daniel Keysers, Jeremiah Harmsen, and Neil Houlsby. Scaling vision transformers to 22 billion parameters. arXiv preprint arXiv:2302.05442, 2023. Lucas Dixon, John Li, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. Measuring and mitigating unintended bias in text classification. In *Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics,* and Society, AIES '18, pp. 67–73, New York, NY, USA, 2018. Association for Computing Machinery. ISBN 9781450360128. doi: 10.1145/3278721.3278729. URL https://doi.org/10.1145/3278721.3278729. Michele Donini, Luca Oneto, Shai Ben-David, John Shawe-Taylor, and Massimiliano Pontil. Empirical risk minimization under fairness constraints. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS'18, pp. 2796–2806, Red Hook, NY, USA, 2018. Curran Associates Inc. Michael Feldman, Sorelle A. Friedler, John Moeller, Carlos Scheidegger, and Suresh Venkatasubramanian. Certifying and removing disparate impact. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '15, pp. 259–268, New York, NY, USA, 2015. Association for Computing Machinery. ISBN 9781450336642. doi: 10.1145/2783258.2783311. URL https://doi.org/10.1145/2783258.2783311. Naman Goel, Mohammad Yaghini, and Boi Faltings. Non-discriminatory machine learning through convex fairness criteria. *Proceedings of the AAAI Conference on Artificial Intelligence*, 32(1), Apr. 2018. URL https://ojs.aaai.org/index.php/AAAI/article/view/11662. Patrick Grother, George Quinn, and P Phillips. Report on the evaluation of 2d still-image face recognition algorithms. NIST Interagency/Internal Report (NISTIR), National Institute of Standards and Technology, Gaithersburg, MD, 2010-06-17 2010. Moritz Hardt, Eric Price, Eric Price, and Nati Srebro. Equality of opportunity in supervised learning. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. URL https://proceedings.neurips.cc/ paper/2016/file/9d2682367c3935defcb1f9e247a97c0d-Paper.pdf. Tatsunori B. Hashimoto, Megha Srivastava, Hongseok Namkoong, and Percy Liang. Fairness without demographics in repeated loss minimization. In *ICML*, 2018. Takashi Ishida, Ikko Yamane, Tomoya Sakai, Gang Niu, and Masashi Sugiyama. Do we need zero training loss after achieving zero training error? In Hal Daumé III and Aarti Singh (eds.), *Proceedings of the 37th* International Conference on Machine Learning, volume 119 of *Proceedings of Machine Learning Research*, pp. 4604–4614. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/ishida20a.html. Ray Jiang, Aldo Pacchiano, Tom Stepleton, Heinrich Jiang, and Silvia Chiappa. Wasserstein fair classification. In Ryan P. Adams and Vibhav Gogate (eds.), Proceedings of The 35th Uncertainty in Artificial Intelligence Conference, volume 115 of *Proceedings of Machine Learning Research*, pp. 862–872. PMLR, 22–25 Jul 2020. URL https://proceedings.mlr.press/v115/jiang20a.html. Kimmo Karkkainen and Jungseock Joo. Fairface: Face attribute dataset for balanced race, gender, and age for bias measurement and mitigation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 1548–1558, 2021. Amir E. Khandani, Adlar J. Kim, and Andrew W. Lo. Consumer credit-risk models via machine-learning algorithms. *Journal of Banking & Finance*, 34(11):2767–2787, 2010. ISSN 0378-4266. doi: https:// doi.org/10.1016/j.jbankfin.2010.06.001. URL https://www.sciencedirect.com/science/article/pii/ S0378426610002372. Anders Krogh and John Hertz. A simple weight decay can improve generalization. In J. Moody, S. Hanson, and R. P. Lippmann (eds.), *Advances in Neural Information Processing Systems*, volume 4. Morgan-Kaufmann, 1992. URL https://proceedings.neurips.cc/paper/1991/file/ 8eefcfdf5990e441f0fb6f3fad709e21-Paper.pdf. Preethi Lahoti, Alex Beutel, Jilin Chen, Kang Lee, Flavien Prost, Nithum Thain, Xuezhi Wang, and Ed H. Chi. Fairness without demographics through adversarially reweighted learning. arXiv preprint arXiv:2006.13114, 2020. Mingchen Li, Mahdi Soltanolkotabi, and Samet Oymak. Gradient descent with early stopping is provably robust to label noise for overparameterized neural networks. arXiv preprint arXiv:1903.11680, 2019. Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015. David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Learning adversarially fair and transferable representations. arXiv preprint arXiv:1802.06309, 2018. Subha Maity, Saptarshi Roy, Songkai Xue, Mikhail Yurochkin, and Yuekai Sun. How does overparametrization affect performance on minority groups? arXiv preprint arXiv:2206.03515, 2022. URL https://arxiv. org/abs/2206.03515. Roman C. Maron, Michael Weichenthal, Jochen S. Utikal, Achim Hekler, Carola Berking, Axel Hauschild, Alexander H. Enk, Sebastian Haferkamp, Joachim Klode, Dirk Schadendorf, Philipp Jansen, Tim HollandLetz, Bastian Schilling, Christof von Kalle, Stefan Fröhling, Maria R. Gaiser, Daniela Hartmann, Anja Gesierich, Katharina C. Kähler, Ulrike Wehkamp, Ante Karoglan, Claudia Bär, Titus J. Brinker, Laurenz Schmitt, Wiebke K. Peitsch, Friederike Hoffmann, Jürgen C. Becker, Christina Drusio, Philipp Jansen, Joachim Klode, Georg Lodde, Stefanie Sammet, Dirk Schadendorf, Wiebke Sondermann, Selma Ugurel, Jeannine Zader, Alexander Enk, Martin Salzmann, Sarah Schäfer, Knut Schäkel, Julia Winkler, Priscilla Wölbing, Hiba Asper, Ann-Sophie Bohne, Victoria Brown, Bianca Burba, Sophia Deffaa, Cecilia Dietrich, Matthias Dietrich, Katharina Antonia Drerup, Friederike Egberts, Anna-Sophie Erkens, Salim Greven, Viola Harde, Marion Jost, Merit Kaeding, Katharina Kosova, Stephan Lischner, Maria Maagk, Anna Laetitia Messinger, Malte Metzner, Rogina Motamedi, Ann-Christine Rosenthal, Ulrich Seidl, Jana Stemmermann, Kaspar Torz, Juliana Giraldo Velez, Jennifer Haiduk, Mareike Alter, Claudia Bär, Paul Bergenthal, Anne Gerlach, Christian Holtorf, Ante Karoglan, Sophie Kindermann, Luise Kraas, Moritz Felcht, Maria R. Gaiser, Claus-Detlev Klemke, Hjalmar Kurzen, Thomas Leibing, Verena Müller, Raphael R. Reinhard, Jochen Utikal, Franziska Winter, Carola Berking, Laurie Eicher, Daniela Hartmann, Markus Heppt, Katharina Kilian, Sebastian Krammer, Diana Lill, Anne-Charlotte Niesert, Eva Oppel, Elke Sattler, Sonja Senner, Jens Wallmichrath, Hans Wolff, Tina Giner, Valerie Glutsch, Andreas Kerstan, Dagmar Presser, Philipp Schrüfer, Patrick Schummer, Ina Stolze, Judith Weber, Konstantin Drexler, Sebastian Haferkamp, Marion Mickler, Camila Toledo Stauner, and Alexander Thiem. Systematic outperformance of 112 dermatologists in multiclass skin cancer image classification by convolutional neural networks. European Journal of Cancer, 119:57–65, 2019. ISSN 0959-8049. doi: https://doi.org/10.1016/j.ejca.2019.06.013. URL https://www.sciencedirect.com/science/article/pii/S0959804919303818. Natalia Martinez, Martin Bertran, and Guillermo Sapiro. Minimax PARETO Fairness: A multi objective perspective. arXiv preprint arXiv:2011.01821, 2020. Aditya Krishna Menon, Sadeep Jayasumana, Ankit Singh Rawat, Himanshu Jain, Andreas Veit, and Sanjiv Kumar. Long-tail learning via logit adjustment. In *International Conference on Learning Representations*, 2021a. URL https://openreview.net/forum?id=37nvvqkCo5. Aditya Krishna Menon, Ankit Singh Rawat, and Sanjiv Kumar. Overparameterisation and worst-case generalisation: friend or foe? In *International Conference on Learning Representations*, 2021b. URL https://openreview.net/forum?id=jphnJNOwe36. N. Morgan and H. Bourlard. *Generalization and Parameter Estimation in Feedforward Nets: Some Experiments*, pp. 630–637. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1990. ISBN 1558601007. Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, and Ilya Sutskever. Deep double descent: Where bigger models and more data hurt. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=B1g5sA4twr. Mei Ngan and Patrick Grother. Face recognition vendor test (frvt) - performance of automated gender classification algorithms. NIST Interagency/Internal Report (NISTIR), National Institute of Standards and Technology, Gaithersburg, MD, 2015-04-20 2015. Manisha Padala and Sujit Gujar. Fnnc: Achieving fairness through neural networks. In *Proceedings* of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI'20, 2021. ISBN 9780999241165. Alan Pham, Eunice Chan, Vikranth Srivatsa, Dhruba Ghosh, Yaoqing Yang, Yaodong Yu, Ruiqi Zhong, Joseph E. Gonzalez, and Jacob Steinhardt. The effect of model size on worst-group generalization. arXiv preprint arXiv:2112.04094, 2021. URL https://arxiv.org/abs/2112.04094. Flavien Prost, Hai Qian, Qiuwen Chen, Ed H. Chi, Jilin Chen, and Alex Beutel. Toward a better trade-off between performance and fairness with kernel-based distribution matching. In NeurIPS Workshop on ML with Guarantees, 2019. Novi Quadrianto, Viktoriia Sharmanska, and Oliver Thomas. Discovering fair representations in the data domain. In *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition* (CVPR), June 2019. Responsible-AI. Tensorflow Responsible AI Toolkit, Accessed 16.02.2022. URL https://www.tensorflow. org/responsible_ai. Hee Jung Ryu, Hartwig Adam, and Margaret Mitchell. Inclusivefacenet: Improving face attribute detection with race and gender diversity. arXiv preprint arXiv:1712.00193, 2018. Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally robust neural networks. In *International Conference on Learning Representations*, 2020a. URL https://openreview. net/forum?id=ryxGuJrFvS. Shiori Sagawa, Aditi Raghunathan, Pang Wei Koh, and Percy Liang. An investigation of why overparameterization exacerbates spurious correlations. In *ICML*, pp. 8346–8356, 2020b. URL http: //proceedings.mlr.press/v119/sagawa20a.html. Yash Savani, Colin White, and Naveen Sundar Govindarajulu. Intra-processing methods for debiasing neural networks. arXiv preprint arXiv:2006.08564, 2020. Candice Schumann, Jeffrey S. Foster, Nicholas Mattei, and John P. Dickerson. We need fairness and explainability in algorithmic hiring. In *Proceedings of the 19th International Conference on Autonomous* Agents and MultiAgent Systems, AAMAS '20, pp. 1716–1720, Richland, SC, 2020. International Foundation for Autonomous Agents and Multiagent Systems. ISBN 9781450375184. Ashudeep Singh and Thorsten Joachims. Fairness of exposure in rankings. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery &; Data Mining, KDD '18, pp. 2219–2228, New York, NY, USA, 2018. Association for Computing Machinery. ISBN 9781450355520. doi: 10.1145/ 3219819.3220088. URL https://doi.org/10.1145/3219819.3220088. Samuel L Smith, Benoit Dherin, David Barrett, and Soham De. On the origin of implicit regularization in stochastic gradient descent. In *International Conference on Learning Representations*, 2021. URL https://openreview.net/forum?id=rq_Qr0c1Hyo. Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. *Journal of Machine Learning Research*, 15(56): 1929–1958, 2014. URL http://jmlr.org/papers/v15/srivastava14a.html. Philipp Tschandl. The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions, 2018. URL https://doi.org/10.7910/DVN/DBW86T. Christina Wadsworth, Francesca Vera, and Chris Piech. Achieving fairness through adversarial learning: an application to recidivism prediction. arXiv preprint arXiv:1807.00199, 2018. Yoav Wald, Gal Yona, Uri Shalit, and Yair Carmon. Malign overfitting: Interpolation and invariance are fundamentally at odds. In *NeurIPS 2022 Workshop on Distribution Shifts: Connecting Methods and* Applications, 2022. URL https://openreview.net/forum?id=1xadmcm2CC. Mei Wang and Weihong Deng. Mitigate bias in face recognition using skewness-aware reinforcement learning. arXiv preprint arXiv:1911.10692, 2019. Zeyu Wang, Klint Qinami, Ioannis Christos Karakozis, Kyle Genova, Prem Nair, Kenji Hata, and Olga Russakovsky. Towards fairness in visual recognition: Effective strategies for bias mitigation. arXiv preprint arXiv:1911.11834, 2020. Dennis Wei, Karthikeyan Natesan Ramamurthy, and Flavio Calmon. Optimized score transformation for fair classification. In Silvia Chiappa and Roberto Calandra (eds.), *Proceedings of the Twenty Third International* Conference on Artificial Intelligence and Statistics, volume 108 of *Proceedings of Machine Learning Research*, pp. 1673–1683. PMLR, 26–28 Aug 2020. URL https://proceedings.mlr.press/v108/wei20a.html. Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez-Rodriguez, and Krishna P. Gummadi. Fairness constraints: A flexible approach for fair classification. *Journal of Machine Learning Research*, 20(75):1–42, 2019. URL http://jmlr.org/papers/v20/18-262.html. Brian Hu Zhang, Blake Lemoine, and Margaret Mitchell. Mitigating unwanted biases with adversarial learning. arXiv preprint arXiv:1801.07593, 2018. Zhi-Hua Zhou and Xu-Ying Liu. Training cost-sensitive neural networks with methods addressing the class imbalance problem. *IEEE Transactions on Knowledge and Data Engineering*, 18(1):63–77, 2006. doi: 10.1109/TKDE.2006.17. Yongshuo Zong, Yongxin Yang, and Timothy Hospedales. MEDFAIR: Benchmarking fairness for medical imaging. In *The Eleventh International Conference on Learning Representations*, 2023. URL https: //openreview.net/forum?id=6ve2CkeQe5S. ## A Maximum Mean Discrepancy Maximum Mean Discrepancy (MMD) is a statistic to test the statistical dependency between two sample distributions. It's mathematical formulation consists of taking the mean between two samples Z0 (consisting of m elements) and Z1 (consisting of n elements) mapped into a Reproducing Kernel Hilbert Subspace, and is computed as follows (Prost et al., 2019): $$\text{MMD}(Z_{0},Z_{1})=\frac{1}{m^{2}}\sum_{i,j=1}^{m}k(z_{0,i},z_{0,j})-\frac{2}{mn}\sum_{i,j=1}^{m,n}k(z_{0,i},z_{1,j})+\frac{1}{n^{2}}\sum_{i,j=1}^{n}k(z_{1,i},z_{1,j})\tag{7}$$ where k is either a Gaussian or a Laplace kernel, (z0,i)i=1,m and (z1,i)i=1,n are elements from Z0 and Z1, respectively. ## B Mindiff Evaluation To study the sensitivity analysis on λ, we plot the fairness constrained test error (with a ∆FNR ≤ 10% ![18_image_0.png](18_image_0.png) constraint) on Waterbirds dataset for different values of λ = {0, 1.5, 8.0, 16.0, 32.0} in Figure 8. We observe that MinDiff is only effective for under-parameterized models even for larger values of λ, but provides no significant gains compared to smaller values of λ. We also observe that when λ is set to high values, like λ = 8.0 or 16.0 or 32.0, the optimization prioritizes minimizing FNRgap rather than accurately classifying the data, leading to poor classification performance in the over-parameterized regime. Therefore, it is crucial to choose lambda carefully in order to strike a balance between classification accuracy and fairness for different model widths. Figure 8: We plot the fairness constrained test error with a ∆FNR ≤ 10% constraint on the MinDiff trained models with λ = {0.0, 1.5, 8.0, 16.0, 32.0} on Waterbirds dataset. On HAM10000 dataset, we observe that for Resnet-18 the primary loss over-fits to the training dataset and achieves zero training loss thus turning off MinDiff optimization on the over-parameterized model. In contrast, for the under-parameterized model, MinDiff optimization is active and aids in improving fairness since training loss is non-zero. ## C Impact Of Regularization In Over-Parameterized Regime C.1 Batch Size C.1.1 Waterbirds ![19_image_0.png](19_image_0.png) Figure 9: We show the progress of primary loss, evaluated on training dataset and on the validation dataset, versus epochs during MinDiff optimization ( \ = 1.5) for under-parameterized (LeNet-5) and overparameterized (ResNet-18) models on HAM10000 dataset. We find that over-parameterized ResNet-18 model over-fits to the training data, thus turning off MinDiff optimization. ![19_image_1.png](19_image_1.png) Figure 10: Batch size - THR with fairness constraint < 10% C.2 ## All Other Regularizers C.2.1 Waterbirds ![20_image_0.png](20_image_0.png) 三 18 Test Error ( 14 ![20_image_1.png](20_image_1.png) Figure 11: Batch size - THR with fairness constraint < 5% ![20_image_2.png](20_image_2.png) Figure 12: Batch size - THR with fairness constraint < 1% ## C.2.2 Celeba Table 5: We tabulate the fairness constrained test error (with a △FNR ≤ 10% constraint) for different regularization schemes used in conjunction with MinDiff optimization ( \ = 0.5) on CelebA dataset. The performance of best regularizer is highlighted in bold for each model width. Notation: wd is weight decay, es(Lp) is early stopping w.r.t primary loss and fl is flooding | Method | Width = 5 | Width = 19 | Width = 64 | |----------------------|-------------|--------------|--------------| | | Under- | Over- | ()ver- | | 入 = 0 | 5.92 ± 0.27 | 6.51 ± 0.16 | 5.76 ± 0.14 | | 入 = 0.5 | 6.36 ± 0.72 | 6.54 ± 0.17 | 5.88 ± 0.19 | | x = 0.5 + wd = 0.001 | 5.89 ± 0.32 | 6.94 ± 0.18 | 6.25 ± 0.48 | | λ = 0.5 + wd = 0.1 | 5.66 ± 0.18 | 5.27 ± 0.16 | 6.40 ± 0.18 | | 1 = 0.5 + es( Cp) | 6.17 ± 0.48 | 5.91 ± 0.37 | 5.45 ± 0.32 | | x = 0.5 + fl = 0.05 | 6.45 ±0.69 | 6.53 ± 0.21 | 6.16 ± 0.09 | | 入 = 0.5+ fl = 0.1 | 6.34 ± 0.63 | 5.75 ± 0.35 | 4.80 ± 0.28 | ![21_image_0.png](21_image_0.png) Figure 13: Training loss vs model widths for different batch sizes ![21_image_1.png](21_image_1.png) Figure 14: Regularization - THR with fairness constraint < 10% Table 6: We tabulate the fairness constrained test error (with a △FNR ≤ 10% constraint) for different regularization schemes used in conjunction with MinDiff optimization (\ = 1.0) on CelebA dataset. The performance of best regularizer is highlighted in bold for each model width. Notation: wd is weight decay, es(Lp) is early stopping w.r.t primary loss and fl is flooding | Method | Width = 5 | Width = 19 | Width = 64 | |----------------------|-------------|--------------|--------------| | Under- | Over- | ()ver- | | | 入 = 0 | 5.92 ± 0.27 | 6.51 ± 0.16 | 5.76 ± 0.14 | | 入 = 1.0 | 6.25 ± 0.61 | 6.43 ± 0.17 | 6.06 ± 0.09 | | x = 1.0 + wd = 0.001 | 5.94 ± 0.39 | 6.75 ± 0.35 | 5.90 ± 0.24 | | x = 1.0 + wd = 0.1 | 5.80 + 0.17 | 5.55 ± 0.19 | 6.42 ± 0.12 | | 6.32 ± 0.40 | 5.82 ± 0.46 | 4.79 ± 0.24 | | | À = 1.0 + es(Lp) | | | | | x = 1.0 + fl = 0.05 | 6.30 ± 0.68 | 6.43 ± 0.17 | 5.87 ± 0.11 | | 入= 1.0 + fl = 0.1 | 6.33 ± 0.52 | 5.4 ± 0.35 | 4.77 ± 0.13 | ![22_image_0.png](22_image_0.png) Figure 15: Regularization - THR with fairness constraint < 5% ![22_image_1.png](22_image_1.png) Figure 16: Regularization - THR with fairness constraint < 1% Table 7: CelebA (MinDiff: 0.5, FNR Gap ≤ 5%, Batch Size: 128) | Table 7: CelebA (MinDiff: 0.5, FNR Gap ≤ 5%, Batch Size: 128) | | | | |-----------------------------------------------------------------|-------------|-------------|-------------| | Method | Width = 5 | Width = 19 | Width = 64 | | | Under- | Over- | Over- | | Original Model | 6.22 ± 0.31 | 6.81 ± 0.21 | 6.10 ± 0.14 | | MinDiff | 6.72 ± 0.70 | 6.78 ± 0.16 | 6.18 ± 0.25 | | MinDiff + wd = 0.001 | 6.20 ± 0.35 | 7.29 ± 0.21 | 6.51 ± 0.55 | | MinDiff + wd = 0.1 | 5.84 ± 0.13 | 5.51 ± 0.15 | 6.70 ± 0.14 | | MinDiff + es | 6.48 ± 0.48 | 6.14 ± 0.38 | 5.61 ± 0.30 | | MinDiff + fl = 0.05 | 6.73 ± 0.70 | 6.80 ± 0.21 | 6.47 ± 0.11 | | MinDiff + fl = 0.1 | 6.65 ± 0.67 | 5.99 ± 0.37 | 5.03 ± 0.29 | | Table 8: CelebA (MinDiff: 1.0, FNR Gap ≤ 5%, Batch Size: 128) Method Width = 5 Width = 19 Width = 64 Under- Over- Over | | | | |----------------------|-------------|-------------|-------------| | Original Model | 6.22 ± 0.31 | 6.81 ± 0.21 | 6.10 ± 0.14 | | MinDiff | 6.57 ± 0.56 | 6.74 ± 0.20 | 6.35 ± 0.07 | | MinDiff + wd = 0.001 | 6.26 ± 0.45 | 7.11 ± 0.34 | 6.21 ± 0.23 | | MinDiff + wd = 0.1 | 6.15 ± 0.18 | 5.82 ± 0.14 | 6.70 ± 0.14 | | MinDiff + es | 6.60 ± 0.40 | 6.15 ± 0.50 | 5.05 ± 0.18 | | MinDiff + fl = 0.05 | 6.57 ± 0.70 | 6.74 ± 0.14 | 6.15 ± 0.15 | | MinDiff + fl = 0.1 | 6.58 ± 0.43 | 5.67 ± 0.38 | 4.92 ± 0.06 | | Table 10: CelebA (MinDiff: 0.5, FNR Gap ≤ 1%, Batch Size: 128) Method Width = 5 Width = 19 Width = 64 Under- Over- OverOriginal Model 6.57 ± 0.32 7.13 ± 0.22 6.31 ± 0.12 MinDiff 6.96 ± 0.72 7.07 ± 0.14 6.50 ± 0.26 | | | | |----------------------|-------------|-------------|-------------| | MinDiff + wd = 0.001 | 6.52 ± 0.35 | 7.57 ± 0.24 | 6.86 ± 0.55 | | MinDiff + wd = 0.1 | 6.12 ± 0.13 | 5.82 ± 0.18 | 6.94 ± 0.20 | | MinDiff + es | 6.71 ± .048 | 6.41 ± 0.42 | 5.85 ± 0.29 | | MinDiff + fl = 0.05 | 7.04 ± 0.70 | 7.09 ± 0.24 | 6.78 ± 0.10 | | MinDiff + fl = 0.1 | 6.94 ± 0.67 | 6.20 ± 0.42 | 5.17 ± 0.28 | | Table 11: CelebA (MinDiff: 1.0, FNR Gap ≤ 1%, Batch Size: 128) Method Width = 5 Width = 19 Width = 64 Under- Over- OverOriginal Model 6.57 ± 0.32 7.13 ± 0.22 6.31 ± 0.12 MinDiff 6.76 ± 0.54 7.00 ± 0.18 6.55 ± 0.14 | | | | |----------------------|-------------|-------------|-------------| | MinDiff + wd = 0.001 | 6.54 ± 0.46 | 7.43 ± 0.41 | 6.46 ± 0.20 | | MinDiff + wd = 0.1 | 6.43 ± 0.22 | 6.11 ± 0.12 | 6.97 ± 0.17 | | MinDiff + es | 6.86 ± 0.42 | 6.40 ± 0.53 | 5.24 ± 0.21 | | MinDiff + fl = 0.05 | 6.87 ± 0.66 | 7.04 ± 0.17 | 6.33 ± 0.15 | | MinDiff + fl = 0.1 | 6.90 ± 0.41 | 5.94 ± 0.33 | 5.09 ± 0.08 | | Table 9: CelebA (MinDiff: 1.5, FNR Gap ≤ 5%, Batch Size: 128) Method Width = 5 Width = 19 Width = 64 Under- Over- Over | | | | |----------------------|-------------|-------------|-------------| | Original Model | 6.22 ± 0.31 | 6.81 ± 0.21 | 6.10 ± 0.14 | | MinDiff | 6.65 ± 0.46 | 6.90 ± 0.30 | 6.40 ± 0.26 | | MinDiff + wd = 0.001 | 6.15 ± 0.41 | 6.85 ± 0.30 | 5.33 ± 0.21 | | MinDiff + wd = 0.1 | 6.45 ± 0.18 | 6.11 ± 0.13 | 6.81 ± 0.10 | | MinDiff + es | 6.73 ± 0.43 | 5.89 ± 0.45 | 4.88 ± 0.05 | | MinDiff + fl = 0.05 | 6.58 ± 0.39 | 6.64 ± 0.40 | 5.77 ± 0.18 | | MinDiff + fl = 0.1 | 6.68 ± 0.44 | 5.56 ± 0.41 | 4.86 ± 0.14 | Table 9: CelebA (MinDiff: 1.5, FNR Gap ≤ 5%, Batch Size: 128) Table 11: CelebA (MinDiff: 1.0, FNR Gap ≤ 1%, Batch Size: 128) Table 12: CelebA (MinDiff: 1.5, FNR Gap ≤ 1%, Batch Size: 128) | Table 12: CelebA (MinDiff: 1.5, FNR Gap ≤ 1%, Batch Size: 128) Method Width = 5 Width = 19 Width = 64 Under- Over- OverOriginal Model 6.57 ± 0.32 7.13 ± 0.22 6.31 ± 0.12 MinDiff 6.86 ± 0.49 7.24 ± 0.31 6.64 ± 0.26 | | | | |----------------------|-------------|-------------|-------------| | MinDiff + wd = 0.001 | 6.42 ± 0.45 | 7.13 ± 0.30 | 5.68 ± 0.25 | | MinDiff + wd = 0.1 | 6.75 ± 0.22 | 6.29 ± 0.17 | 7.05 ± 0.14 | | MinDiff + es | 6.97 ± 0.38 | 6.12 ± 0.49 | 5.07 ± 0.06 | | MinDiff + fl = 0.05 | 6.85 ± 0.39 | 6.92 ± 0.42 | 5.93 ± 0.24 | | MinDiff + fl = 0.1 | 6.89 ± 0.45 | 5.84 ± 0.42 | 5.04 ± 0.16 |
Review 1: Summary: As the deep neural networks are increasingly being used in real-world applications, the fairness issue has also received increasing attention from the community. This work studies one widely used fairness algorithm, i.e,.MinDiff, and has some interesting findings. First, under-parameterized MinDiff models can even have lower error compared to their over-parameterized counterparts within specified fairness constraints. In addition, MinDiff optimization is also sensitive to choice of batch size in the under-parameterized regime, requiring time-consuming hyper-parameter searches. It is suggested to use regularization techniques such as L2, early stopping, and flooding in conjunction with MinDiff to train fair over-parameterized models. Over-parameterized models trained using MinDiff+regularization with standard batch sizes are fairer than their under-parameterized counterparts, suggesting that regularizers should be integrated into fair deep learning flows. Strengths and Weaknesses: Advantages: 1. This paper addresses an important issue regarding fairness, exploring how the performance of mitigation algorithms changes in relation to the number of parameters in DNN models. Specifically, it investigates whether fairness algorithms are effective for over-parameterized models. 2. The study presents interesting experimental findings, including the discovery that under-parameterized MinDiff models can have lower error rates compared to their over-parameterized counterparts. My concerns: 1. When considering fairness, it is crucial to keep in mind that datasets typically involve people. Waterbirds is a dataset typically used for domain generalization/worst group robustness. There are no people in this dataset. If the research topic is for domain generalization/worst group robustness, both Waterbirds and CelebA can be used as the testing datasets. However, it is not feasible the other way around. It is strongly recommended to use other datasets to replace Waterbirds. 2. Another significant concern is whether the study's findings can be generalized to other research studies and more practical real-world settings. The authors used a fixed pre-trained ResNet-18 model to extract a d-dimensional feature vector µ, then transformed it using a linear transformation and one RELU activation to a new feature space. The dimension of this space, along with the logistic regression classifier, determined whether the model was under-parameterized or over-parameterized. This setting is not commonly used in other research studies or real-world applications. A more practical approach would be to use a range of ResNet models, such as ResNet-18, ResNet-34, ResNet-50, ResNet-101, ResNet-110, ResNet-152, ResNet-164, and ResNet-1202. ResNet-18 could be treated as an under-parameterized model, while a shallower model like Alexnet could also be used. In contrast, deeper models like ResNet-110 and ResNet-152 would be considered over-parameterized models. It would be interesting to see whether the findings of this study hold true in this more practical real-world setting of under-parameterization and over-parameterization. 3. It is unclear whether the findings are only applicable to "MinDiff optimization" or whether they can be generalized to other fairness mitigation algorithms. Requested Changes: Please refer to the Strengths And Weaknesses section. Broader Impact Concerns: No ethical concerns found. ================================================== Review 2: Summary: As far as I understand, this paper targets the problem of learning a classification model such as to meet fairness conditions. Presumably for the sake of simplicity the problems (datasets) considered in this work are binary with respect to class labels (two classes) and the special attribute values (two possible attribute values). The classification models are neural network models with many layers, hence deep learning. The paper proposes a training objective for the said kinds of problems, and empirical evaluations, with claims of improvements (or some better properties) with respect to the MinDiff method, the latter being a fairness-constrained training procedure made available by the TensorFlow Responsible AI Toolkit. Strengths and Weaknesses: Strengths: - The problem setting is interesting and of current relevance in potentially many applications. - The experimental results are presented with sufficient detail to be reproduced (I think) and with discussions. - It is believable that the paper's claims are supported by the experimental evaluations results. Weaknesses: - The paper has major (in my opinion) clarity/readability problems that may affect the ability of readers to understand it. - The mathematical notations are unclear in some cases and the precise mathematical meaning of some things is missing. - Most notably, there "test error" has two meanings that are conflated in this work, which can lead to confusions and may spread some misconceptions among the readership if this work is published as is. - Many editorial changes need to be carried out before this paper is acceptable for publication (details below). Requested Changes: Abstract: Appears to be endorsing debatable claims such as "ability to generalize" (which has to be measured according to a suitable notion of generalization which the abstract has not specified) and the connections between things are not very clear. The written in the first parenthetical is strange because it is split by a period, could be avoided. Try without parenthesis: "This will apply to any disparity-based measures which care about errors or accuracy; while it won’t apply to demographic parity." Sec. 1 Introduction Line 1: " in a wide range" (insert "a") A bit further down: " there is a growing" (replace "an" with "a") Next para, first sentence: "Methods to ensure fairness can be broadly categorized according to the stage at which they are used: pre-training, in-training, or post-training." Next page, top line: Replace "Framework" with "Toolkit". It is not at all apparent that "(AI)" is a citation and hyperlink, try changing to "(Google AI)" to fix this. Then the corresponding reference item (when clicking the hyperlink) should read something like "Google AI. TensorFlow Responsible AI Toolkit. URL https://www.tensorflow.org/responsible_ai. (Accessed DD.MM.YYY)" -- Important to record the date because the content of web pages is subject to changes overtime. Next paragraph: "We evaluate MinDiff on two datasets, Waterbirds and CelebA, that are commonly used in fairness literature; and we observe several notes of caution." (comma after "CelebA" and "we observe") Next sentence: The message of this paragraph is unclear, and there are incorrect descriptions such as the given description of "over-parametrized" while there is no description of the meaning of "under-parameterized" which is then being assumed to be known by the readers, or delegated for readers to figure out elsewhere. This needs to be improved. Trying to suggest how to reformulate: "Because the success of deep learning can be attributed at least in part to the surprising ability of over-parameterized deep networks to generalize (Nakkiran et al., 2020), we begin by evaluating the relationship between model capacity and fairness with MinDiff. Recall that over-parameterized networks are those with more trainable parameters than training data, which therefore have sufficient capacity to memorize the training dataset; while under-parameterized networks are those with less parameters than training data. The setting where the number of trainable parameters matches the amount of training data is usually referred to as the interpolation threshold. We observe that MinDiff does increase fairness for small, under-parameterized models, but is almost entirely ineffective on larger over-parameterized networks. Thus, in some cases, under-parameterized MinDiff models can have lower fairness-constrained error compared to their over-parameterized counterparts even though over-parameterized models are always better on baseline error (i.e., error on models trained without MinDiff optimization). We caution that when using MinDiff for fairness, ML practitioners must carefully choose model capacity, something which is generally unnecessary when fairness is not a concern and the goal is simply to minimize error." Next paragraph: Suggesting to succinctly discuss the meaning of "disparity-based" for the sake of the unfamiliar readers. Same comment for the meaning of "demographic parity" which needs to be made explicit for the unfamiliar readers. Or point to suitable references. Noting that the period inside a parenthetical is strange. Try to avoid. Suggesting how to reformulate: "[..] thus turning off the MinDiff optimization. This will apply to any disparity-based measures which care about errors or accuracy, whereas It won’t apply to demographic parity which cares about [..]. Thus, we explore [..]" Next: The parenthesis within parenthesis are an obstacle to clarity. Try to avoid. Try: "Specifically, we consider two classes of regularization techniques: implicit such as batch sizing (Smith et al., 2021; Barrett & Dherin, 2021) and early stopping (Morgan & Bourlard, 1990), and explicit such as weight decay (Krogh & Hertz, 1992) and a recently proposed “loss flooding" method (Ishida et al., 2020). We find [..]" Sec. 2 Related Work First line: "in the literature" (insert "the") "In-processing techniques (Prost et al. [..]) alter the training mechanism [..]" Bottom of the paragraph: " similar qualitative conclusions might hold for other" (replace "will" with "might")? Bottom of the page (last line): remove space before "Sagawa" Next page, top paragraph, last sentence: "deep learning models trained using" (insert "learning") Sec. 3 Methodology Subsec.3.1: augment the title "Setup" to "Formal Setup" ? First para, third line: Delete the coma after $P_{X,A,Y}$ Eq. (1): Could use "\log" in math mode LaTeX to produce a nice looking "log" function. Also, on the left-hand side, the notation $\mathcal{L}_P$ is confusing because the expression on the right hand side is the empirical loss which is a function of the data but not the data-generating distribution. The notation $\mathcal{L}_D$ would then be preferable (and replace throughout the paper). Next line: "via stochastic gradient descent (SGD)." Line after Eq. (2): "seek to achieve low error" (delete "test"). Note that "test error" could be interpreted as "error on the test set" while the expression following this phrase defines the error of $\hat{f}_\theta$ at population level. After Eq. (3): Insert some comment about why/when it make sense to minimise $\mathrm{FNR}_\mathrm{gap}$ to achieve fairness. Subsec.3.2, first para, fourth line: "Equation (1)" (eq. number enclosed in parentheses, same as in the displayed eq's) "and $\mathcal{L}_M$ is a differentiable proxy for the $\mathrm{FNR}_\mathrm{gap}$" Next line: "importance of the fairness versus the empirical cross-entropy loss" (not "test error") Eq. (4): Provide the mathematical definition of the right-hand side. Perhaps discuss its meaning and why it is used as the proxy in this setting. Subsec.3.3, first para, third line: "as proposed by Hardt et al. (2016)" (use \citet{} instead of \citep{} in this case) Two lines further down: "constraint is met and the error is minimized:" (remove "test" replace with "the" and delete period) Eq (5): Remove the comma at the end of the eq. Next paragraph mentions "test error" a few times. Perhaps this suggests that earlier in the paper you should clearly define what you mean by "test error" (mathematical definition) and discuss differences with "error on the test set" Subsec.3.4, no comments here. Sec. 4 Experimental Setup Subsec.4.1, first para, first line: "Waterbirds is a synthetically created dataset" (insert "a") Next para: Specify details about the random matrix $U$, e.g. independent Gaussian entries? What parameters for the Gaussian distribution? Assuming that all entries are Gaussian with the same parameters, but this needs to be specified as well. Subsec.4.2, first para: remove the space between "women" and the footnote number. Sec. 5 Experimental Results Subsec.5.1: This section and related Figure 1 discuss the "test error" but in this case "test error" really actually means the empirical error rate evaluated on a test set (i.e. what I called "error on the test set" before) and once again the distinction needs to be made clear between the error notion at population level (which is distribution-dependent) and the empirical counterpart evaluated on a finite amount of data points (which is data-dependent). Subsec.5.2 and 5.3: Similar comment. Note that the figures necessarily show the test set error rates, while the target quantity of interest I think must be the distribution-dependent error at population level, what has been presented before as $\mathbb{P}[\hat{f}_\theta(X;\tau) \neq Y]$ and the attribute conditioned probabilities $\mathbb{P}[\hat{f}_\theta(X;\tau) = 0 \vert Y=1, A=0]$ and $\mathbb{P}[\hat{f}_\theta(X;\tau) = 0 \vert Y=1, A=1]$. These things need to be discussed to improve the clarity. References: Hardt et al. (2016) "Equality of opportunity in supervised learning" appears duplicate. Need to remove the duplicate. The bibliographic information for Prost et al. (2019) is incomplete (how published?). Needs to be updated. Same for Grother ert al. (2010), Madras et al. (2018), Martinez et al. (2020), Ngan and Grother (2015), Ryu et al. (2018), Savani et al. (2020), Wadsworth et al. (2018), Wang and Deng (2019), Wang et al. (2020), Zhang et al. (2018); there are others like these. Check all the reference items to make sure complete details are provided. Make venue names consistent. Some titles need capital-protecting (e.g. "Pareto") Broader Impact Concerns: N/A ================================================== Review 3: Summary: The authors study the effectiveness of MinDiff for mitigating error disparity across subgroups in overparameterized models. Using experiments on CelebA and Waterbitrds in ResNet18 with varying widths, they argue that MinDiff alone is ineffective when the model is overparameterized but its effectiveness can be enhanced with regularization techniques, such as weight decay and flooding. The authors focus on equality of opportunity as a metric but the conclusions should also hold for any metrics based on error disparities, such as equalized odds, but not (for example) demographic parity. Strengths and Weaknesses: *Strengths*: - The paper is well-written and easy to read. The authors present an important message about the pitfalls of using in-processing techniques for mitigating error disparities in overparameterized models. - The authors consider several regularization techniques in their analysis and show (in the appendix) that their conclusions are insensitive to the choice of the post-hoc threshold level (which is always 10% in the main paper, but is varied in Appendix A). *Weaknesses*: - The main message is somehow known to practitioners already and does not only hold for in-processing methods but also in other techniques such as reweighting [1]. Since overparamterized models will drive the training error to zero, such techniques can be ineffective. As the authors cite in the paper, this has also been demonstrated in published works, such as [2] who also looked into regularization techniques including weight decay and early stopping. - The authors only demonstrate their claims using equality of opportunity. While I think the conclusions should also hold for other error-based metrics, such as equalized odds, it would be good to demonstrate them as well. - Throughout the experiments, the authors vary $\lambda$ only in the set $\{0, 0.5, 1, 1.5\}$. I think the authors should use an exponential spacing. It's likely that MinDiff would perform better if a very large value of $\lambda$ is used (because the loss now focuses on the proxy for error parity rather than on the cross entropy so the model wouldn't interpolate the training data). [1] Byrd, Jonathon, and Zachary Lipton. "What is the effect of importance weighting in deep learning?" ICML, 2019. [2] Sagawa, et al. "Distributionally robust neural networks." ICLR, 2020 Requested Changes: - Typo in Page 4: "once the validation loss has increased" --> "once the validation loss has not increased". - The authors should include experiments with $\lambda\in{4, 8, 16\}$. If this is a challenge timewise, please report results with $\lambda=16$. - Can you please clarify why the setups used in the two datasets are different? It seems that the authors only have access to GPUs for CelebA but not for Waterbirds. Is this the reason? - In Figure 3, can you also add within the same figure the loss and FNR gap for test data? This might help understand the effect of early stopping. - What does $\lambda$ in the legend of Figure 6 mean? I think this is a typo. - The line space in Page 10 is different from the rest of the paper. - In Page 2, it is mentioned that Pham et al. (2021) observed that overparameterized models improve the worst case loss. This has also been recently demonstrated in ViT-22B [3]. It is also observed in [3] and [4] that overparamterization offers a more favorable tradeoff between bias and accuracy. Perhaps the paper would benefit from including this discussion in the related works since it touches upon the relationship between overparameterization and bias. [3] Dehghani, Mostafa, et al. "Scaling Vision Transformers to 22 Billion Parameters." arXiv preprint arXiv:2302.05442 (2023). [4] Alabdulmohsin, Ibrahim M., and Mario Lucic. "A near-optimal algorithm for debiasing trained machine learning models." NeurIPS, 2021. Broader Impact Concerns: None ================================================== Metareview: Recommendation: Accept with minor revision Comment: The reviewers appreciate the paper's interesting findings and agree that reinforcing this understanding within the research community is important. The paper addresses various concerns effectively, and the reviewers believe it will be a valuable addition to TMLR. However, a major concern is the limited generalizability of the paper's finding, as the study only focuses on one particular in-processing algorithm. The authors are advised to either evaluate additional algorithms or reposition the title and paper structure to emphasize that this is a case study with MinDiff. This revision would better align the paper's claims and generalizability. ==================================================
# Bayesian Transformed Gaussian Processes Xinran Zhu *xz584@cornell.edu* Cornell University, Center for Applied Mathematics Leo Huang∗ah839@cornell.edu Cornell University, Department of Computer Science Eric Hans Lee∗eric.lee@intel.com SigOpt: An Intel Company Cameron Ibrahim *cibrahim@udel.edu* University of Delaware, Department of Computer and Information Sciences David Bindel bindel@cornell.edu Cornell University, Department of Computer Science Reviewed on OpenReview: *https: // openreview. net/ forum? id= 4zCgjqjzAv* ## Abstract The Bayesian transformed Gaussian (BTG) model, proposed by Kedem and Oliviera in 1997, was developed as a Bayesian approach to trans-Kriging in the spatial statistics community. In this paper, we revisit BTG in the context of modern Gaussian process literature by framing it as a fully Bayesian counterpart to the Warped Gaussian process that marginalizes out a joint prior over input warping and kernel hyperparameters. As with any other fully Bayesian approach, this treatment introduces prohibitively expensive computational overhead; unsurprisingly, the BTG posterior predictive distribution, itself estimated through high-dimensional integration, must be inverted in order to perform model prediction. To address these challenges, we introduce principled numerical techniques for computing with BTG efficiently using a combination of doubly sparse quadrature rules, tight quantile bounds, and rank-one matrix algebra to enable both fast model prediction and model selection. These efficient methods allow us to compute with higher-dimensional datasets and apply BTG with layered transformations that greatly improve its expressibility. We demonstrate that BTG achieves superior empirical performance over MLE-based models in the low-data regime —situations in which MLE tends to overfit. ## 1 Introduction Gaussian processes (GPs), also known as Kriging models in the spatial statistics community Cressie (1993), are a powerful probabilistic learning framework, including a marginal likelihood which represents the probability of data given only GP hyperparameters. The marginal likelihood automatically balances model fit and complexity terms to favor simple models that explain the data well. A GP assumes normally distributed observations. In practice, however, this condition is not always adequately met. The classic approach to moderate departures from normality is trans-Gaussian Kriging, which applies a normalizing nonlinear transformation to the data (Cressie, 1993). This idea was reprised and expanded upon in the machine learning literature. One instance is the warped GP (WGP), which maps the observation space to a latent space in which the data is well-modeled by a GP and which learns GP hyperparameters through maximum likelihood estimation (Snelson et al., 2004). The WGP paper employs ∗These authors contributed equally to this work. a class of parametrized, hyperbolic tangent transformations. Later, Rios & Tobar (2019) introduced compositionally warped GPs (CWGP), which chain together a sequence of parametric transformations with closed form inverses. Bayesian warped GPs further generalize WGPs by modelling the transformation as a GP (Lázaro-Gredilla, 2012). These are in turn generalized to Deep GPs by Damianou & Lawrence (2013), which stack GPs together in the layers of a neural network. Throughout this line of work, the GP transformation and kernel hyperparameters are typically learned through joint maximum likelihood estimation (MLE). A known drawback of MLE is overconfidence in the data-sparse or low-data regime, which may be exacerbated by warping (Chai & Garnett, 2019). Bayesian approaches, on the other hand, offer a way to account for uncertainty in values of model parameters. Bayesian trans-Kriging (Spöck et al., 2009) treats both transformation and kernel parameters in a Bayesian fashion. A prototypical Bayesian trans-Kriging model is the BTG model developed by Oliveira et al. (1997). The model places an uninformative prior on the precision hyperparameter and analytically marginalizes it out to obtain a posterior distribution that is a mixture of Student's t-distributions. Then, it uses a numerical integration scheme to marginalize out transformation and remaining kernel parameters. In this latter regard, BTG is consistent with other Bayesian methods in the GP literature, including those of Gibbs (1998); Adams et al. (2009); Lalchand & Rasmussen (2020). While BTG was shown to have improved prediction accuracy and better uncertainty propagation, it comes with several computational challenges, which hinder its scalability and limit its competitiveness with the MLE approach. First, the cost of numerical integration in BTG scales with the dimension of hyperparameter space, which can be large when transform and noise model parameters are both incorporated. Traditional methods such as Monte Carlo (MC) suffer from slow convergence. As such, we leverage sparse grid quadrature and quasi Monte Carlo (QMC), which have a higher degree of precision but require a sufficiently smooth integrand. Second, the posterior mean predictor of BTG is not guaranteed to exist, hence the need to use the posterior median predictor. The posterior median and credible intervals do not generally have closed forms, so one must resort to expensive numerical root-finding to compute them. Finally, while fast cross-validation schemes are known for vanilla GP models, leave-one-out-cross-validation (LOOCV) on BTG, which incurs quartic cost naively, is less straightforward to perform because of an embedded generalized least squares problem. In this paper, we reduce the overall computational cost of end-to-end BTG inference, including model prediction and selection. Our main contributions follow. - We revisit the Bayesian transformed Gaussian (BTG) model in the context of machine learning literature and GPs. We show that BTG fills an important gap in the GP research in which a fully Bayesian treatment of input-warped GPs has not been thoroughly investigated. - We extend BTG to support *multi-layered* transformations. - We propose efficient methods for computing BTG predictive medians and predictive quantiles through a combination of doubly sparse quadrature and quantile bounds. We also propose fast LOOCV using rank-one matrix algebra. - We develop a framework to control the tradeoff between speed and accuracy for BTG and analyze the error in sparsifying QMC and sparse grid quadrature rules. - We conduct comparisons between the Bayesian and MLE approaches and provide experimental results for BTG and WGP coupled with 1-layer and 2-layer transformations. We find evidence that BTG is well-suited for low-data regimes, where hyperparameters are under-specified by the data. In these regimes, our empirical testing suggests that BTG provides superior point estimation and uncertainty quantification. - We develop a modular Julia package for computing with transformed GPs (e.g., BTG and WGP) which exploits vectorized linear algebra operations and supports MLE and Bayesian inference1. 1The code used to run experiments in this paper can be found at https://github.com/xinranzhu/BTG. ## 2 Background In this section, we provide a brief overview of Gaussian processes and their transformed counterparts. This section is by no means comprehensive, and is meant to establish common notation and definitions for the reader's convenience. Note that we modified the standard GP treatment of Rasmussen & Williams (2008) to improve clarity when explaining the BTG model; notational differences aside, our formulations are equivalent. ## 2.1 Gaussian Process Regression A GP f ∼ GP(*µ, τ* −1k) is a distribution over functions in R d, where µ(x) is the expected value of f(x) and τ −1k(x, x ′) is the positive (semi)-definite covariance between f(x) and f(x ′). For later clarity, we separate the precision hyperparameter τ from lengthscales and other kernel hyperparameters (typically denoted by θ) 2. Unless otherwise specified, we assume a linear mean field and the squared exponential kernel: $$\begin{array}{c c}{{\mu_{\beta}(\mathbf{x})=\beta^{T}m(\mathbf{x}),}}&{{\quad m\colon\mathbb{R}^{d}\to\mathbb{R}^{p},}}\\ {{}}&{{}}\\ {{k_{\theta}(\mathbf{x},\mathbf{x}^{\prime})=\exp\bigg(-\frac{1}{2}\|\mathbf{x}-\mathbf{x}^{\prime}\|_{\mathbf{D}_{\theta}^{-2}}^{2}\bigg).}}\end{array}$$ Here m(x) is a known function mapping a location x to a vector of covariates, β is a vector of coefficients, and D2 θ is a diagonal matrix of length scales determined by the parameter(s) θ. For any finite set of input locations, let: $$\begin{array}{c}{{X=[\mathbf{x}_{1},\ldots,\mathbf{x}_{n}]^{T}}}\\ {{M_{X}=[m(\mathbf{x}_{1}),\ldots,m(\mathbf{x}_{n})]^{T}}}\\ {{f_{X}=[f(\mathbf{x}_{1}),\ldots,f(\mathbf{x}_{n})]^{T}}}\end{array}$$ T X ∈ R $$X\in\mathbb{R}^{n\times d},$$ MX = [m(x1)*, . . . , m*(xn)]T MX ∈ R $$M_{X}\in\mathbb{R}^{n\times p},$$ $$f_{X}\in\mathbb{R}^{n},$$ fX = [f(x1)*, . . . , f*(xn)]TfX ∈ R where X is the matrix of observations locations, MX is the matrix of covariates at X, and fX is the vector of observations. A GP has the property that any finite number of evaluations of f will have a joint Gaussian distribution: fX | β, τ, θ ∼ N (MX*β, τ* −1KX), where (τ −1KX)ij = τ −1kθ(xi, xj ) is the covariance matrix of fX. We assume MX to be full rank. Typically, the kernel hyperparameters τ , β, and θ are fit by minimizing the negative log likelihood: $$\begin{array}{c}{{-\log{\mathcal{L}}(f_{X}\mid X,\beta,\tau,\theta)\propto}}\\ {{\frac{1}{2}\|f_{X}-M_{X}\beta\|_{K_{X}^{-1}}^{2}+\frac{1}{2}\log\!|K_{X}|.}}\end{array}$$ This is known as type II maximum likelihood estimation (MLE) of the kernel hyperparameters. Having performed MLE to compute the optimal β, τ , and θ, the posterior predictive density of a point x is: Definition 1 (*Posterior predictive density, GP model, type II MLE*). $$f(\mathbf{x})\mid\beta,\ \tau,\ \theta,\ f_{X},X\sim{\mathcal{N}}(\mu_{\theta,\beta},s_{\theta,\beta}).$$ N (µθ,β, sθ,β) is a normal distribution with the following mean and variance: $$\begin{array}{l}{{\mu_{\theta,\beta}=\beta^{T}m(\mathbf{x})+K_{X\mathbf{x}}^{T}K_{X}^{-1}(f_{X}-M_{X}\beta),}}\\ {{s_{\theta,\beta}=\tau^{-1}\big(k_{\theta}(x,x)-K_{X\mathbf{x}}^{T}K_{X}^{-1}K_{X\mathbf{x}}\big),}}\end{array}$$ where (KXx)i = kθ(xi, x). The Bayesian model selection approach forgoes MLE of the negative log likelihood, and instead assumes a prior distribution over kernel hyperparameters p(*β, τ, θ*). This induces a posterior distribution over the kernel hyperparameters by noting that the posterior is proportional to the likelihood times the prior: 2Standard GP literature includes an additional hyperparameter σ which models the observed noise. We omit σ in this section for brevity but treat it in our experiments. $$p(\beta,\tau,\theta\mid f_{X},X)\propto{\mathcal{L}}(f_{X}\mid X,\beta,\tau,\theta)p(\beta,\tau,\theta).$$ Given this posterior distribution, the posterior predictive density is given by the following. Definition 2 (*Posterior predictive density, fully Bayesian GP*). $$p(f(\mathbf{x})\mid f_{X},X)=\int_{\beta,\tau,\theta}p(f(\mathbf{x})\mid\beta,\ \tau,\ \theta,\ f_{X},X)\,p(\beta,\tau,\theta\mid f_{X},X).$$ We call this the *fully Bayesian* approach to Gaussian process modeling. The well-known tradeoff between type II MLE and the fully Bayesian approach is that of tractability; the fully Bayesian approach requires computing integrals with no generic, analytic solution (often through MCMC) where as type II MLE is much more straightforward. ## 2.2 Warped Gaussian Processes While GPs are powerful tools for modeling nonlinear functions, they make the fairly strong assumptions of Gaussianity and homoscedasticity. WGPs (Snelson et al., 2004) challenge these assumptions by transforming ("warping") the observation space to a latent space, which itself is modeled by a GP. Given a strictly increasing, differentiable parametric transformation gλ determined by a parameter λ, WGPs model the composite function gλ ◦ f with a GP. Definition 3 (*Warped Gaussian Process*). $$(g_{\lambda}\circ f)\mid\beta,\tau,\lambda,\theta\sim{\mathcal{G P}}(\mu_{\beta},\tau^{-1}k_{\theta}).$$ Let (gλ(fX))i = gλ(f(xi)). WGP jointly computes the parameters through MLE in the latent space, where the negative log likelihood is: $$\begin{array}{c}{{-\log{\mathcal{L}}\big(g_{\lambda}(f_{X})\mid X,\beta,\tau,\theta,\lambda\big)\propto}}\\ {{\frac{1}{2}\|g_{\lambda}(f_{X})-M_{X}\beta\|_{K_{X}^{-1}}^{2}+\frac{1}{2}\log\!|K_{X}|-\log J_{\lambda}.}}\end{array}$$ Note that the difference between this equation and the negative log likelihood is the inclusion of J, which represents the Jacobian of the transformation: $$J_{\lambda}=\left|\prod_{i=1}^{n}{\frac{\partial}{\partial f(\mathbf{x}_{i})}}g_{\lambda}(f(\mathbf{x}_{i}))\right|.$$ WGPs predict the value of a point x by computing its posterior mean in the latent space and then inverting the transformation back to the observation space: g −1 λ (ˆµ(x)). Snelson et al. (2004) uses the tanh transform family, whose members do not generally have closed form inverses; they must be computed numerically. ## 2.3 Other Transformed Gp Models There exist a variety of other transformed GP models, and in this section we briefly summarize a few of them. This overview is by no means comprehensive, but we hope it succinctly communicates not only the breadth of existing work, but also the gaps that we believe BTG fills. The compositionally warped GP (CWGP) (Rios & Tobar, 2019) considers a set of augmented warping functions used by the standard WGP, which possess analytic inverses (for computational simplicity) and are then composed together for additional expressiveness. The Bayesian warped GP (BWGP) (Lázaro-Gredilla, 2012) takes a different approach to transformations, placing a GP prior on the warping function and variationally marginalizing it out so that model prediction and selection does not require numerical integration. Table 1: A table summarizing some of the different GP models in the literature today. The main differences among models are whether or not they use transformations (all do except for the standard GP), what sorts of transformations are used, and what type of inference method is used. *Single* denotes a single function used for transformations. *Multiple* refers to a composition of such functions. At the bottom of the table is the topic of this paper, the Bayesian transformed GP (BTG). | Name | Transformations | Type | Inference | | |---------------------------|-------------------|--------|-------------------|----------------| | GP-MLE | No | N/A | MLE | | | GP-Bayesian | No | N/A | Fully Bayesian | | | Warped GP | (WGP) | Yes | Single Analytic | MLE | | Compositionally Warped GP | (CWGP) | Yes | Multiple Analytic | MLE | | Bayesian Warped GP | (BWGP) | Yes | Single GP | Variational | | Deep GP | (DGP) | Yes | Multiple GPs | Variational | | Bayesian Transformed GP | (BTG) | Yes | Multiple Analytic | Fully Bayesian | Deep GPs (Damianou & Lawrence, 2013) extends the "GP of a GP" idea by building a network of GPs, and also uses variational inference to accelerate model prediction and selection by avoiding numerical integration. Indeed, a whole body of literature exists solely towards the application of variational inference to Gaussian process regression (Tran et al., 2015; Salimbeni & Deisenroth, 2017; Jakkala, 2021). Like all these other models, BTG considers a family of warping functions —single layer or multiple compositions. However, instead of using type II MLE (which can sometimes be overconfident) or variational inference (VI) (whose approximations often require significant data before showing their advantages), BTG opts for a carefully chosen prior and explicit numerical integration during the model selection process for a fully Bayesian approach to transformed Gaussian process regression. While we focus on improving the Bayesian treatment and scale BTG to higher dimensions using exact kernel inference, another line of work, orthogonal to ours, focuses on combining the warping setting with sparse GP techniques to scale to large datasets. Graßhoff et al. (2020) adopt the Structured Kernel Interpolation (SKI) method (Wilson & Nickisch, 2015) to the WGP setting, which scales WGP up to large training data in low dimensions. Rossi et al. (2021) considers the sparse GP setting with inducing points and focuses on a fully Bayesian treatment of both the inducing points and model hyperparameters, based on stochastic gradient Hamiltonian Monte Carlo. ## 3 The Bayesian Transformed Gaussian Process (Btg) Model One might think of the Bayesian Transformed Gaussian (BTG) model (Oliveira et al., 1997) as a fully Bayesian generalization of WGP. WGP uses MLE to learn optimal values for the transformation parameters λ, mean function parameters β, signal variance parameters τ , and GP lengthscales θ. Just like WGP, BTG models a function f(x) as: $$(g_{\lambda}\circ f)\mid\beta,\tau,\lambda,\theta\sim{\mathcal{G P}}(\mu_{\beta},\tau^{-1}k_{\theta}).$$ Unlike WGP, BTG places a joint prior p(*β, τ, θ, λ*) over all model parameters and performs fully Bayesian model selection by computing the usual marginal likelihood instead of performing the MLE. A key idea of BTG is to carefully select a joint prior over λ, β, τ , and θ to simplify the computation so that the BTG's posterior predictive density is a mixture of t-distributions —this will be derived in later subsections. Definition 4 (Posterior predictive density, BTG). $$f(\mathbf{x})\mid f_{X},X\sim\sum_{i=1}^{M}w_{i}T_{i}^{n-p}$$ ![5_image_0.png](5_image_0.png) Figure 1: A comparison of GP and BTG, both trained on 48 random samples from the rounded sine function with noise from N (0, 0.05). Left: the predictive mean and 95% equal tailed credible interval of a Gaussian process using the squared exponential kernel. Right: the predictive median and 95% equal tailed credible interval of BTG using the squared exponential kernel. BTG is better able to capture the irregularity in the training data despite a highly smooth kernel, largely due to it's Bayesian treatment of warping functions that map the data points to a latent space. where each T n−p iis a different transformed T distribution whose mean and variance we will derive in §3.2 and §4; for a comprehensive analysis, see Box & Cox (1964). Like in the case of the WGP, this predictive distribution must then be inverted to perform prediction or uncertainty quantification. BTG appears to possess the same advantages that any fully Bayesian model will possess over it's MLE counterpart: robustness to overconfidence. This results in a better fit, as demonstrated in Figure 1. The underlying kernel is the highly smooth squared exponential, resulting in a GP that is unable to capture the underlying function, which is not smooth at all. Due to a combination of input warping and Bayesian inference, BTG is able to resolve the underlying datapoints much better than a GP despite using the same smooth kernel. In later sections, we explore the advantages of being Bayesian in the low-data regime. ## 3.1 The Parameter Posterior A key idea of the BTG model is that, conditioned on λ, θ, and fX, the resulting WGP is a generalized linear model (Oliveira et al., 1997). We estimate β by βˆθ,λ, the solution to the weighted least squares problem: $$q_{\theta,\lambda}=\operatorname*{min}_{\beta}\left\|g_{\lambda}(f_{X})-M_{X}\beta\right\|_{K_{x}^{-1}}^{2},$$ $$\operatorname{have}$$ $\mathbf{v}$ where qθ,λ is the residual norm. Explicity, we have $$\begin{array}{l}{{\hat{\beta}_{\theta,\lambda}=(M_{X}^{T}K_{X}^{-1}M_{X})^{-1}M_{X}^{T}K_{X}^{-1}g_{\lambda}(f_{X}),}}\\ {{q_{\theta,\lambda}=(g_{\lambda}(f_{X})-M_{X}\hat{\beta}_{\theta,\lambda})^{T}K_{X}^{-1}(g_{\lambda}(f_{X})-M_{X}\hat{\beta}_{\theta,\lambda}).}}\end{array}$$ Therefore, we have the marginal probability $$p(f_{X}\mid X)=\int p(f_{X}|\beta,\tau,\theta,\lambda,X)p(\beta,\tau,\theta,\lambda)\,d\lambda\,d\beta\,d\theta\,d\tau$$ $$=\int|K_{X}|^{-1/2}|M_{X}^{T}K_{X}^{-1}M_{X}|^{-1/2}q_{\theta,\lambda}^{-(n-p)/2}J_{\lambda}^{1-p/n}p(\theta)p(\lambda)\,d\theta\,d\lambda.$$ Further using Bayes theorem, we have $$p(\theta,\lambda\mid f_{X},X)\propto|K_{X}|^{-1/2}|M_{X}^{T}K_{X}^{-1}M_{X}|^{-1/2}q_{\theta,\lambda}^{-(n-p)/2}J_{\lambda}^{1-p/n}p(\theta)p(\lambda).$$ λp(θ)p(λ). (1) $$(1)$$ On the other hand, because appropriate values for β, τ , and θ depend nontrivially on λ, BTG adopts the improper joint prior: p(β, τ, θ, λ) ∝ p(θ)p(λ) / (τ Jp/n λ). This effectively decouples the priors on θ and λ; p(θ) and p(λ) are independent and user-specified. BTG then selects the prior on (*β, τ* ) to follow the conditional normal-inverse-gamma distribution: $${\mathcal{H}}$$ $$\begin{array}{l}{{\beta\mid\tau,\lambda,\theta,f_{X},X\sim\mathcal{N}\big(\hat{\beta}_{\lambda,\theta},\tau^{-1}(M_{X}^{T}K_{X}^{-1}M_{X})^{-1}\big),}}\\ {{\tau\mid\lambda,\theta,f_{X},X\sim\Gamma^{-1}\Big(\frac{n-p}{2},\frac{2}{q_{\lambda,\theta}}\Big).}}\end{array}$$ $$\left(2\right)$$ $$\left({\boldsymbol{3}}\right)$$ Note that, due to the improper joint prior, the distribution on β and τ depends on the values of θ and λ. Using (1) and (2), the posterior distribution, up to some constant, is determined: $$p(\beta,\tau,\theta,\lambda\mid f_{X},X)=p(\beta,\tau\mid\theta,\lambda,f_{X},X)p(\theta,\lambda\mid f_{X},X).$$ The reason for the normal-inverse-gamma prior becomes apparent; the marginal of a normal-inverse-gamma is a t-distribution, and so once we marginalize out equation 3, the mixture of t-distributions seen in equation 4 will be the result. We derive this in the following subsection. ## 3.2 The Predictive Density BTG bases the prediction at x on the *Bayesian predictive density function* (Aitchinson & Dunsmore, 1975): $$p(f(\mathbf{x})\mid f_{X},X)=\int p(f(\mathbf{x})\mid\beta,\tau,\lambda,\theta,f_{X},X)p(\beta,\tau,\lambda,\theta\mid f_{X},X)\,d\lambda\,d\beta\,d\theta\,d\tau.\tag{4}$$ The Bayesian predictive density function is simply an integral of a product of two probability densities. In the previous section, we derived p(β, τ, λ, θ | fX, X), so we know the second probability density. The first probability density is that of a warped GP (Definition 3): $$\begin{array}{l}{{g_{\lambda}\circ f(\mathbf{x})\mid\beta,\tau,\lambda,\theta,f_{X},X\sim{\mathcal{N}}(m_{\beta,\theta,\lambda},D_{\theta}),}}\\ {{m_{\beta,\theta,\lambda}=\beta^{T}m(\mathbf{x})+K_{X\mathbf{x}}^{T}K_{X}^{-1}(g_{\lambda}\circ f_{X}-M_{X}\beta),}}\\ {{D_{\theta}=\tau^{-1}\big(k_{\theta}(x,x)-K_{X\mathbf{x}}^{T}K_{X}^{-1}K_{X\mathbf{x}}\big).}}\end{array}$$ We consequently know everything needed to specify Equation 4. Because we adopted a conditional normalinverse-gamma distribution, once we marginalize out β and τ , the posterior of gλ ◦ f(x) is the t-distribution: $$g_{\lambda}\circ f(\mathbf{x})\mid\lambda,\theta,f_{X},X\sim T^{n-p}\big(m_{\lambda,\theta},(q_{\theta,\lambda}C_{\theta,\lambda})^{-1}\big),$$ −1, (5) where the mean largely resembles that of a GP: $$m_{\lambda,\theta}=I$$ mλ,θ = KxXK −1 X gλ(fX) − MXβˆλ,θ+ βˆT λ,θm(x), and Cλ,θ is the final Schur complement B(x)/[kθ(x, x)] of the bordered matrix: $$B(\mathbf{x})={\left[\begin{array}{l l l}{0}&{M_{X}^{T}}&{m(\mathbf{x})}\\ {M_{X}}&{K_{X}}&{K_{X\mathbf{x}}}\\ {m(\mathbf{x})^{T}}&{K_{X\mathbf{x}}^{T}}&{k_{\theta}(\mathbf{x},\mathbf{x})}\end{array}\right]}\,.$$ $${\cal{I}}_{X}\tilde{\beta}_{\lambda,\theta})+\tilde{\beta}_{\lambda,\theta}^{T}$$ $$\left(5\right)$$ Therefore, by Bayes theorem, the marginal posterior of BTG is: $$p(f(\mathbf{x})\mid f_{X},X)={\frac{\int_{\Theta,\Lambda}\phi(f(\mathbf{x})\mid\theta,\lambda,f_{X},X)p(f_{X}\mid\lambda,\theta)p(\theta)p(\lambda)d\lambda d\theta}{\int_{\Theta,\Lambda}p(\theta,\lambda|f_{X},X)p(\theta)p(\lambda)\,d\lambda\,d\theta}},$$ p(θ, λ|fX, X)p(θ)p(λ) *dλ dθ* , (6) where the posterior being integrated is a transformed t-distribution with the pdf $$\phi(f(\mathbf{x})\mid\theta,\lambda,f_{X},X)=\tag{7}$$ $$\frac{\Gamma(\frac{n-p+1}{2})|g^{\prime}_{\lambda}(f(\mathbf{x}))|}{\Gamma(\frac{n-p}{2})\pi^{1/2}|g_{\mu\lambda}C_{\theta,\lambda}|^{1/2}}[1+(f(\mathbf{x})-m_{\theta,\lambda})^{T}(g_{\theta,\lambda}C_{\theta,\lambda})^{-1}(f(\mathbf{x})-m_{\theta,\lambda})]^{-(n-p+1)/2}.$$ Unlike WGP, BTG may not have first or second moments, because its marginal posterior may be for example, a mixture of log-t distributions. If this occurs, the probability density function (pdf) will not have a mean or variance. Therefore, BTG instead uses the median and credible intervals, computed by inverting its cumulative distribution function (cdf). ## 3.3 The Approximate Predictive Density For general nonlinear transformations, the posterior distribution of BTG (Equation 6) is intractable and therefore we approximate it using a set of M quadrature nodes and weights ([θi, λi], wi), yielding the mixture of transformed t-distributions $$p\big{(}f({\bf x})\mid f_{X},X\big{)}\approx{\frac{\sum_{i=1}^{M}w_{i}\phi\big{(}f({\mathbf{x}})\mid\theta_{i},\lambda_{i},f_{X},X\big{)}p(f_{X}|\theta_{i},\lambda_{i})p(\theta_{i})p(\lambda_{i})}{\sum_{i=1}^{M}w_{i}p(\theta_{i},\lambda_{i}\mid f_{X})p(\theta_{i})p(\lambda_{i})}}.$$ Here, ϕ (f(x) | θi, λi, fX, X) is the pdf of the transformed t-distributions (Equation 3.2), p(fX|θi, λi) is the likelihood of data given hyperparameters, p(θi) and p(λi) are the user-specified hyperparameter priors, and wiis a quadrature weight at the quadrature point (θi, λi). To simplify notation, we combine all terms except for the transformed t-distribution pdf into weights w˜i to simplify the predictive distribution into our desired mixture of transformed t-distributions: $$\begin{array}{l}{{\tilde{w}_{i}:=\frac{w_{i}p(f_{X}|\theta_{i},\lambda_{i})p(\theta_{i})p(\lambda_{i})}{\sum_{i=1}^{M}w_{i}p(\theta_{i},\lambda_{i}\mid f_{X})p(\theta_{i})p(\lambda_{i})},}}\\ {{p\big(f(\mathbf{x})\mid f_{X},X\big)\approx\sum_{i=1}^{M}\tilde{w}_{i}\phi\big(f(\mathbf{x})\mid\theta_{i},\lambda_{i},f_{X},X\big).}}\end{array}$$ $$(8)$$ As mentioned earlier, pf(x) | fX, Xis not guaranteed to have a mean, so we must use the median predictor instead. We do so by computing the quantile P −1(0.5) by numerical root-finding, where P is the cdf of pf(x) | fX, X, and therefore a mixture of transformed t-distribution cdfs. ## 4 Methodology BTG regression via the median predictor (or any other quantile) of Equation 8 is challenging. The dimensionality of the integral scales with the total number of hyperparameters, which contains the kernel lengthscale hyperparameters θ that grow with the ambient dimension of the data, as well as the transformation parameters λ that grow with the number of transformations used. Furthermore, its cdf must be numerically inverted, requiring many such quadrature computations for even a single, point-wise regression task. This is further complicated by the difficulty in assessing model fit through LOOCV, which must be repeated at every quadrature node as well. As a result, a naive implementation of BTG scales poorly. In this section, we discuss and propose efficient algorithms that make BTG model prediction and model validation far faster, and indeed, comparable to the speed of its MLE counterparts. First, we discuss our doubly sparse quadrature rules for computing the BTG predictive distribution (§4.1 and §4.2). We then provide quantile bounds that accelerate the root-finding convergence (§4.3). Next, we propose an O(n 3) LOOCV algorithm for BTG using Cholesky downdates and rank-1 matrix algebra (§4.4), which greatly improves the naive O(n 4) LOOCV cost. Finally we discuss the single and multi-layer nonlinear transformations used in our experiments (§4.5). ## 4.1 Sparse Grid Quadrature Sparse grid methods, or Smolyak algorithms, are effective for approximating integrals of sufficient regularity in moderate to high dimensions. While the conventional Monte Carlo (MC) quadrature approach used by Oliveira et al. (1997) converges at the rate of O(1/ √M), where M is the number of quadrature nodes, the approximation error of Smolyak's quadrature rule is O M−r|log2 M| (d−1)(r+1)where d is the dimensionality of the integral and r is the integrand's regularity i.e., number of derivatives. In this paper, we use a sparse grid rule detailed by Bungartz & Griebel (2004) and used for likelihood approximation by Heiss & Winschel (2008). ## 4.2 Quadrature Sparsification Numerical integration schemes such as sparse grids and QMC use M fixed quadrature nodes, where M depends on the dimensionality of the domain and fineness of the grid. In the Bayesian approach, expensive GP operations such as computing a log determinant and solving a linear system are repeated across quadrature nodes, for a total time complexity of O(Mn3). In practice, many nodes are associated with negligible mixture weights, so their contribution to the posterior predictive distribution can effectively be ignored. We thus adaptively drop nodes when their associated weights fall below a certain threshold. To do so in a principled way, we approximate the mixture with a subset of dominant weights and then quantify the error in terms of the total mass of discarded weights. We assume the posterior cdf is the mixture of cdfs F(x) = PM i=1 wifi(x), where each fiis a cdf. Assume the weights {wi}M i=1 are ordered by decreasing magnitude. Consider Fk(x), a truncated and re-scaled F(x). We first quantify the pointwise approximation error in Lemma 4.1. We then quantify the error in quantile computation: Propositions 4.1, 4.2 show that the approximated quantile F −1 k(p) can be bounded by perturbed true quantiles. Proposition 4.3 gives a simple bound between F −1 k(p) and F −1(p) within the region of interest, and applies to both QMC—which uses positive weights—and sparse grid quadrature—which uses positive and negative weights. See Appendix A.1 for proofs. Lemma 4.1. Let k *be the smallest integer such that* Pk i=1 wi ≥ 1 − ϵ*. Then define the scaled, truncated* mixture $$F_{k}(x):=\frac{1}{c}\sum_{i=1}^{k}w_{i}f_{i}(x),\quad c:=\sum_{i=1}^{k}w_{i}.$$ We have $$|F(x)-F_{k}(x)|\leq2\epsilon.$$ Proposition 4.1 (Error Bound for Positive Weights). For any ϵ ∈ (0, 1), let k be the smallest integer such that Pk i=1 wi ≥ 1 − ϵ*. Define the scaled, truncated mixture* $$F_{k}(x):={\frac{1}{c}}\sum_{i=1}^{k}w_{i}f_{i}(x),\quad c:=\sum_{i=1}^{k}w_{i}.$$ Let p ∈ (0, 1) and assume that p±2ϵ ∈ (0, 1)*. Then the approximate quantile* F −1 k(p) is bounded by perturbed true quantiles: $$F^{-1}(p-2\epsilon)\leq F_{k}^{-1}(p)\leq F^{-1}(p+2\epsilon).$$ Proposition 4.2 (Error Bound for Negative Weights). Let F(x) be defined as before, except each wi *is no* longer required to be positive. Consider the split F(x) = FM′ (x) + RM′ (x)*, where* FM′ (x) = PM′ i=1 wifi(x) and RM′ (x) = PM i=M′+1 wifi(x). Then for any x, we have RM′ (x) ∈ [ϵ−, ϵ+]*, where the epsilons are defined* as the sum of positive (resp. negative) weights of RM′ (x) $$\epsilon_{-}=\sum_{i=M^{\prime}+1}^{M}[w_{i}]_{-}\leq0\;,\;\epsilon_{+}=\sum_{i=M^{\prime}+1}^{M}[w_{i}]_{+}\geq0.$$ Let p ∈ (0, 1) and assume p + ϵ−, p + ϵ+ ∈ (0, 1)*. Then the approximate quantile* F −1 M′ (p) is bounded by perturbed true quantiles: F −1(p + ϵ−) ≤ F −1 M′ (p) ≤ F −1(p + ϵ+). Proposition 4.3 (Error Bound at a quantile). Let F(x) be defined as before, ϵ1, ϵ2 ∈ (0, 1)*, and* Fk(x) be an approximate to F(x) *such that* F −1(p − ϵ1) ≤ F −1 k(p) ≤ F −1(p − ϵ2) for some p ∈ (0, 1)*. Assuming* p − ϵ1, p + ϵ2 ∈ (0, 1)*, we have the following error bound at a quantile,* $$\left|F_{k}^{-1}(p)-F^{-1}(p)\right|\leq\epsilon\operatorname*{max}_{\xi\in(p-\epsilon_{1},p+\epsilon_{2})}\left|{\frac{d F^{-1}}{d x}}(\xi)\right|,$$ where ϵ = max{ϵ1, ϵ2}. By adaptively sparsifying our numerical quadrature schemes, we are able to discard a significant portion of summands in the mixture F(x), which in turn, enables significant speedup of BTG model prediction. Empirical results are shown in §5. ## 4.3 Quantile Bounds To compute posterior quantiles, we apply Brent's algorithm, a standard root-finding algorithm combining the secant and bisection methods, to the cdf defined in Equation 8. Since Brent's algorithm is box-constrained, we use quantile bounds to narrow down the locations of the quantiles for p ∈ {0.025, 0.5, 0.975}. Let F(x) = PM i=1 wifi(x). Then we have the following bounds for the quantile F −1(p). See Appendix A.2 for proofs. Proposition 4.4 (Convex Hull). Let F(x) be defined as before with wi > 0 and PM i=1 wi = 1*. Then* min if −1 i(p) ≤ F $$\leq F^{-1}(p)\leq\operatorname*{max}_{i}f_{i}^{-1}(p).$$ Proposition 4.5 (Singular Weight). Let F(x) be defined as before with wi > 0 and PM i=1 wi = 1*. Let* wi = 1 − wi*. Then* $$\operatorname*{max}_{p-\overline{{{w}}}_{i}\geq0}f_{i}^{-1}(p-\overline{{{w}}}_{i})\leq F^{-1}(p)\leq\operatorname*{min}_{p+\overline{{{w}}}_{i}\leq1}f_{i}^{-1}(p+\overline{{{w}}}_{i}).$$ When solving for y ∗ = F −1(p), we run Brent's algorithm using our quantile bounds as the box constraints. Furthermore, we adaptively set the termination conditions xtol and ftol to be on the same order of magnitude as the error in quadrature sparsification from §4.2. This greatly accelerates convergence in practice. A performance comparison between quantile bounds outlined in this section can be found in §5. ## 4.4 Fast Leave-One-Out-Cross-Validation (Loocv) LOOCV is a standard measure of model fit: in practice, it is most commonly used for tuning hyperparameters and for model selection. While fast LOOCV schemes are known for GP regression, it is less straightforward to perform LOOCV on BTG. In particular, the computational difficulty lies in two LOOCV sub-problems: a generalized least squares problem and principle sub-matrix determinant computation. These correspond to the terms in the BTG likelihood function and the BTG conditional posterior in Equation 6. Being Bayesian about covariance and transform hyperparameters introduces additional layers of cost: LOOCV must be repeated at each quadrature node in the hyperparameter space. This further motivates the need for an efficient algorithm. For notational clarity, let (−i) denote the omission of the ith point. For a kernel matrix, this means deletion of the ith row and column; for a vector, this indicates the omission of the ith entry. We seek to compute the mean m (−i) θ,λ and standard deviation σ (−i) θ,λ =C (−i) θ,λ q (−i) θ,λ −1/2of the t-distributions (Equations 5) for each submodel, obtained by leaving out the ith training point. Specifically, computing {q (−i) θ,λ } n i=1 entails solving the generalized least squares problems for i = 1*, . . . , n*: $$\operatorname*{arg\,min}_{\beta^{(-i)}}\left\|Y^{(-i)}-M_{X}{}^{(-i)}\beta^{(-i)}\right\|_{K_{X}^{(-i)}}^{2},$$ Table 2: Elementary Transformations: analytic function forms and parameter constraints. Parameters are assumed to be in R unless stated otherwise. | Name | g(y) | Req. | Num. Params | | |-------------|----------------------|----------|---------------|----| | Affine | a + by | b > 0 | 1 | | | ArcSinh | a + b asinh y − c | b, d > 0 | 4 | | | d | | | | | | SinhArcSinh | sinh(b asinh(y − a)) | b > 0 | 2 | | |   | | | | | | Box-Cox | y λ − 1 λ | if λ > 0 | λ ≥ 0 | 1 | |  log(y) | if λ = 0 | | | | where Y = g ◦ fX. In addition, computing C (−i) θ,λ and m (−i) θ,λ entails solves with K (−i) X , which naively takes O(n 3) per sub-problem. Therefore, the BTG LOOCV proceedure naively takes O(n 4) total time. We develop an O(n 3) fast LOOCV algorithm for BTG using three building blocks: fast determinant computations (Proposition 4.6), fast abridged linear system solves (Proposition 4.7) and fast rank-one O(p 2) Cholesky down-dates (Proposition 4.8). We refer to Stewart (1998) for the rank-1 Cholesky downdate algorithm. For algorithm details as well as proofs, see Appendix B. The scaling behavior of our fast LOOCV algorithm is shown in Figure 4. Proposition 4.6 (Determinant of a Principal Minor). $$\operatorname*{det}{\big(}\Sigma^{(-i)}{\big)}=\operatorname*{det}(\Sigma){\big(}e_{i}^{T}\Sigma^{-1}e_{i}{\big)}.$$ $${\dot{\imath}}\,\mathbf{\dot{\imath}}$$ Proposition 4.7 (Abridged Linear System). Let K ∈ R n×n be of full rank, and let *c, y* ∈ R n *satisfy* Kc = y. Then if ri = ci/eT i K−1ei*, we have:* $$c^{(-i)}=(K^{(-i)})^{-1}y^{(-i)}=c-r_{i}K^{-1}e_{i}$$ Proposition 4.8 (Rank one matrix downdate). If X ∈ R n×m with m < n has full column rank and Σ *is a* positive definite matrix in R n×n*, then we have* $$X^{(-i)^{T}}\Sigma^{(-i)^{-1}}X^{(-i)}=X^{T}\left(\Sigma^{-1}-\frac{\Sigma^{-1}e_{i}e_{i}^{T}\Sigma^{-1}}{e_{i}^{T}\Sigma^{-1}e_{i}}\right)X,$$ where Σ (−i) ∈ R (n−1)×(n−1) is the (i, i)th minor of Σ and ei is the i*th canonical basis vector.* ## 4.5 Transformations The original BTG model of Oliveira et al. (1997) uses the Box-Cox family of power transformations and places an uniform prior on λ. Recent research has greatly expanded the set of flexible transformations available. Snelson et al. (2004) uses a sum of tanh(·) transforms in the WGP model and Rios & Tobar (2019) composes various transformations to provide a flexible compositional framework in the CWGP model. We apply BTG with more elementary transformations and compositions thereof, summarized in Table 2. As we show in §5, these compositions have greater expressive power and generally outperform single transformations, at the expense of greater computational overhead. ## 5 Experiments This section contains: - Experimental details necessary to reproduce our experiments, including the datasets we used as well as the decisions we made regarding the BTG and GP models (such as the kernel). Comparing likelihood functions when n=5 and when n=30 ![11_image_0.png](11_image_0.png) Figure 2: Plots of marginal log likelihoods for a SinhArcSinh-transformed WGP and corresponding training data. In the first four columns, *a, b* are transformation hyperparameters, and *θ, σ*2 are kernel hyperparameters; the optimal values of marginal log likelihoods are marked with a red star. The last column shows the underlying function (dashed curves) and the training data (red dots). The top row represents a data-sparse setting with 5 training points, while the bottom row represents a data-rich setting with 30 training points. We can see that in the data-sparse setting, optimal marginal log likelihood values with respect to θ and σ 2 are clearly not as well defined as the data-rich setting. - A small example highlighting that when data is sparse, the likelihoods for transformations and kernel hyperparameters can be very flat, thus demonstrating the need for BTG in these scenarios. - Experiments to validate the efficiency of our computational techniques. - Thorough regression experiments, which demonstrate BTG's strong empirical performance when compared to appropriately selected baselines. We also provide timing results of our fast BTG implementation, showing that BTG has a comparable computational cost to WGP. We hope these experiments provide a thorough and nuanced picture that highlights *when and why* BTG can perform better than it's GP counterparts. All methods possess their strengths and weaknesses, and BTG is not an exception. ## 5.1 Motivation For The Bayesian Approach 5.2 Experiment Details We provide the datasets we use, the performance metrics we measure and additional implementation details necessary to reproduce our experiments in this subsection. Two synthetic datasets: IntSine and SixHumpCamel. The IntSine dataset, also used by Lázaro-Gredilla (2012), is sampled from a rounded 1-dimensional sine function with Gaussian noise of a given variance. The training set is comprised of 51 uniformly spaced samples on [−*π, π*]. The testing set consists of 400 uniformly spaced points on [−*π, π*]. The SixHumpCamel function is a 2-dimensional benchmark optimization function usually evaluated on [−3, 3] × [−2, 2] (Molga & Smutnicki, 2005). We shift its values to be strictly positive. The training set is comprised of 50 quasi-uniform samples, i.e., a 2d Sobol sequence, from [−1, 1] × [−2, 2]. The testing set consists of 400 uniformly distributed points on the same domain. Three real datasets: Abalone, WineQuality and Creep. Abalone is an 8-dimensional dataset, for which the prediction task is to determine the age of an abalone using eight physical measurements (Dua & Graff, 2017). The WineQuality dataset has 12-dimensional explanatory variables and relates the quality of wine to input attributes (Cortez et al., 2009). The Creep dataset is 30-dimensional and relates the creep rupture ![12_image_0.png](12_image_0.png) Figure 3: Comparison of sparse grid quadrature (blue) and QMC (red). Weights are ordered by decreasing magnitude. (*Left*) Number of nodes versus percent of total mass they comprise (*Middle*) Number of nodes versus BTG prediction MSE (*Right*) Number of nodes versus prediction time. We can see that sparse grid quadrature has a prediction error that decreases much faster than QMC. stress (in MPa) for steel to chemical composition and other features (Cole et al., 2000). To simulate datasparse training scenarios, we randomly select training samples of size 30, 200, and 100 from Abalone, WineQuality, and Creep, respectively, and test on 500, 1000 and 1500 out-of-sample points. ## 5.2.1 Sparse Grids Vs Qmc Performance Metrics: Our empirical experiments involve three loss functions to evaluate model performance: root mean squared error (RMSE), mean absolute error (MAE) and mean negative log predictive density (NLPD). Let {f ∗(xi)} n i=1 be true test labels and { ˆf(xi)} n i=1 be predictions, which are taken to be predictive medians in WGP and BTG. The predictive median is also used by Snelson et al. (2004). Let p¯ be the predictive distribution from model. The RMSE, MAE and NLPD are defined as follows $$\text{RMSE}=\left(\frac{1}{n}\sum_{i=1}^{n}(f^{*}(\mathbf{x_{i}})-\hat{f}(\mathbf{x_{i}}))^{2}\right)^{\frac{1}{2}}$$ $$\text{MAE}=\frac{1}{n}\sum_{i=1}^{n}|f^{*}(\mathbf{x_{i}})-\hat{f}(\mathbf{x_{i}})|,$$ $$\text{NLPD}=-\frac{1}{n}\sum_{i=1}^{n}\log(\bar{p}(f^{*}(\mathbf{x_{i}}))).$$ , $\frac{1}{2}$. Implementation: We run all experiments using our Julia software package, which supports a variety of models (WGP, CWGP and BTG) and allows for flexible treatment of hyperparameters. We also implement several single and composed transformations. For MLE optimization, we use the L-BFGS algorithm from the Julia Optim package (Mogensen & Riseth, 2018). Kernel: We used the squared exponential (RBF) kernel for all experiments: $$k_{\theta}(\mathbf{x},\mathbf{x}^{\prime})={\frac{1}{\tau^{2}}}\exp\bigg(-{\frac{1}{2}}\|\mathbf{x}-\mathbf{x}^{\prime}\|_{D_{\theta}^{-2}}^{2}\bigg)+\sigma^{2}\delta_{\mathbf{x}\mathbf{x}^{\prime}}.$$ Model: To model observation input noise for BTG, we add a regularization term to make the analytical marginalization of mean and precision tractable. We also assume the constant covariate m(x) = 1n in the BTG model, and normalize observations to the unit interval. We assume the constant mean field for both BTG and WGP. Our motivation for using a Bayesian approach like BTG rather than a MLE-based one like WGP is that the maximum value of the marginal log likelihood in a data-sparse setting is not as well-defined as that in a data-rich setting. We demonstrate this motivation using a 1D toy example. We examine the marginal log Table 3: Compute time (seconds) for computing predictive median and credible intervals using no quantile bound, convex hull quantile bound, and singular weight quantile bound. Results are averaged over 10 trials. We find that both bounds significantly reduce the total time used to compute the predictive median and credible intervals —though the convex hull bound performs better on average than the singular weight bound, likely because the former is often a better bound than the latter. | Total (s) | Median (s) | Credible Interval (s) | | |-----------------|--------------|-------------------------|------| | Baseline | 13.0 | 3.24 | 7.87 | | Convex Hull | 6.21 | 1.11 | 3.19 | | Singular Weight | 11.0 | 2.52 | 6.54 | likelihoods of transformation and kernel hyperparameters in the WGP model in Figure 2. We consider a 1D synthetic function, the 1D Levy function: $$f(\mathbf{x})=\sin^{2}\left({\frac{(\mathbf{x}+3)\pi}{4}}\right)+\left({\frac{\mathbf{x}-1}{4}}\right)^{2}\left(1+\sin^{2}\left({\frac{(\mathbf{x}+3)\pi}{2}}\right)\right)$$ As a toy example, we use n = 5 training data for a data-sparse setting and use n = 30 for a data-rich setting. We use a SinhArcSinh transformation for both settings, which is parameterized by two parameters a and b (see Table 2). We thus have four total hyperparameters (*a, b, θ, σ*), and we plot their marginal log likelihoods in Figure 2 for both the data-sparse and data-rich setting. We also identify the optimal hyperparameters (a ∗, b∗, θ∗, σ∗) using MLE, which we plot with a red star. We observe that in the data-sparse setting, the marginal log likelihoods tend to be quite flat, even on a log scale, which is especially true of θ and σ 2. This means that many possible hyperparameters explain the data, and consequently that an MLE-based model (which selects only one hyperparameter value) will likely be a poor fit. This also suggests that a fully Bayesian approach—which is what BTG does—could be more appropriate in the data-sparse setting than MLE estimation. In the data-rich setting, the distribution of θ and σ 2 are tightly concentrated, and thus the MLE approach does make sense. ## 5.3 Scaling Experiments We demonstrate the efficiency of the proposed computational techniques discussed in §4. First, we illustrate our quadrature sparsification scheme discussed in §4.2 on two different quadrature rules, and compare the performance under varying sparsification levels. Second, we evaluate the fast quantile bound for root-finding used in BTG prediction proposed in §4.3 by comparing the total time cost of BTG with WGP. Last but not least, we verify the complexity improvement of the proposed fast cross validation. We compare sparse grid and QMC quadrature rules under our quadrature sparsification framework. We use the SixHumpCamel dataset with 30 training data points and 100 testing data points as a toy problem. We train BTG with the composed transformation Affine-SinhArcSinh. The hyperparameter space is 7-dimensional. In our experiment, we begin with a handful of quadrature nodes, and gradually extend this set to the entire quadrature grid. As more and more quadrature nodes are incorporated into the approximate integral (the approximate posterior distribution), we record the percentage of total weight that is used, and then compare how the prediction MSE and the prediction time cost vary. Intuitively, increasing quadrature nodes would reduce the prediction MSE and increase the prediction time cost. To better study our quadrature sparsification framework and balance the prediction accuracy and cost, we closely compare such phenomenon on the two quadrature rules allowed in BTG. Results are plotted in Figure 3. From Figure 3 we observe that the sparse grid quadrature rule yields lower prediction MSE: QMC converges to an MSE of 3.99, while sparse grid converges to an MSE of 3.80. We also observe that the sub-grids have similar *weight concentration*, which we showed was a proxy for quadrature approximation error in §4. Therefore, as the mass of the dropped weights falls below 0.1, the error in the integration scheme can ![14_image_0.png](14_image_0.png) Figure 4: Compare the LOOCV timing of computing posterior distribution parameters of n sub-models with the proposed Cholesky downdate and without. It is verified that the naive way has a O(n 4) cost while our proposed Cholesky downdate reduce the cost, by a factor of n, to O(n 3). increasingly be attributed to the error in the quadrature rule itself as opposed to sparsification. Since the error of the sparse grid rule decays faster than that of QMC, we expect sparse grid prediction error to also decay more quickly and this trend is supported by Figure 3. We empirically find that the joint-likelihood function is sufficiently smooth, so that sparse grids are effective. Finally, we confirm that inference time scales linearly with the number of quadrature nodes. ## 5.3.1 Quantile Bounds Speedup To assess the effectiveness of quantile bounds for root-finding, we record BTG prediction times using the convex hull bound and singular weight bound proposed in §4.3. We set up a problem using the Levy1D dataset Molga & Smutnicki (2005) and 200 training points. The tolerance for the root-finding Brent's algorithm is set to be 10−3. We record the total time cost of prediction, the time cost of computing medians and time cost of computing credible intervals. Intuitively, using a more precise bound in a root-finding algorithm would greatly improve convergence speed, and this is verified with results in Table 3. We find that the convex hull bound decreases the overall computational overhead by a factor of at least two. The convex hull bound outperforms the singular weight bound for finding credible intervals and in overall time, but the singular weight bound was faster for finding the median in many scenarios. ## 5.3.2 Fast Cross Validation To assess our fast LOOCV proposed in §4.4, we infer the sub-model posterior distribution moments on a toy problem in two different ways: with and without using Cholesky rank-one downdates on RX to compute the Cholesky factors for R (−i) X . We plot timing results in Figure 4, which confirm that our O(n 3) method scales significantly better than the naive O(n 4) method. We note that these timings are generated using exact GP inference, and that more generally our fast cross validation is O(n) faster than standard cross validation. We note that this speed-up applies not only to the typical O(n 3) cost of dense GP inference, but also any other scalable GP method, such as variational GPs which would be a O(n 2) cost instead. ## 5.4 Regression And Uncertainty Quantification Experiments Our efficient algorithms allow us to test BTG on a set of synthetic and real-world problems. We consider 5 datasets: IntSine, SixHumpCamel, Abalone, Wine, and Creep with dimension ranging from 1 to 30. The total dimension of the hyperparmeter space is further increased by transform parameters by as much as 8. Table 4: A comprehensive set of RMSE and NLPD results for prediction using the IntSine, SixHumpCamel, Abalone, Wine and Creep datasets. We generally kept the training sets small, to highlight BTG's advantages in the data-sparse regime, though for the IntSine function there was a good amount of data. We compare the following models3: GP, DeepGP, WGP, CWGP, BTG, and use the following transformations transformations: I: Identity, A: ArcSinh, SA: SinhArcSinh, BC: BoxCox, L: affine. The best method is bolded; we find that BTG has lower RMSE and NLPD than the other models, though unsurprisingly, different transformations are more suitable for different datasets. | IntSine | Camel | Abalone | Wine | Creep | | | | | | | |-----------|---------|-----------|--------|---------|-------|--------|-------|--------|-------|--------| | RMSE | NLPD | RMSE | NLPD | RMSE | NLPD | RMSE | NLPD | RMSE | NLPD | | | GP | 0.227 | -1.179 | 2.003 | 11.20 | 3.290 | 1.120 | 1.994 | -0.074 | 37.88 | -1.189 | | DeepGP | 0.241 | 0.013 | 1.344 | 1.761 | 3.212 | 3.988 | 0.824 | 1.377 | 91.95 | 20.39 | | WGP-A | 0.179 | -1.392 | 2.055 | 44.10 | 3.097 | 1.105 | 0.811 | -1.108 | 35.48 | -1.421 | | WGP-SA | 0.172 | -1.693 | 2.012 | 45.10 | 2.992 | 4.879 | 0.809 | -1.269 | 61.62 | 1.001 | | WGP-BC | 0.184 | -1.371 | 1.964 | 44.70 | 2.826 | 0.837 | 1.045 | -0.186 | 40.38 | -1.357 | | CWGP-L-SA | 0.172 | -1.693 | 2.055 | 13.80 | 3.117 | 3.444 | 0.808 | -1.415 | 39.71 | -1.134 | | CWGP-A-BC | 0.174 | -1.457 | 1.960 | 37.90 | 3.088 | 1.151 | 0.808 | -1.416 | 37.89 | -1.399 | | BTG-I | 0.169 | -1.429 | 1.820 | 2.342 | 2.804 | -0.070 | 0.808 | -1.356 | 38.11 | -1.273 | | BTG-A | 0.168 | -1.443 | 1.827 | 2.331 | 2.890 | -0.174 | 0.807 | -1.360 | 38.65 | -1.239 | | BTG-SA | 0.165 | -1.759 | 1.801 | 0.907 | 2.791 | -0.123 | 0.820 | -0.856 | 91.69 | -0.358 | | BTG-BC | 0.170 | -1.439 | 1.675 | 0.659 | 3.225 | 0.110 | 0.808 | -1.358 | 39.10 | -1.332 | | BTG-L-SA | 0.145 | -1.781 | 1.673 | 0.730 | 2.871 | -0.023 | 0.809 | -1.359 | 91.83 | -0.374 | | BTG-A-BC | 0.159 | -1.516 | 1.828 | 2.330 | 2.832 | -0.299 | 0.802 | -1.361 | 35.25 | -1.433 | We compare with a standard GP model, WGP models and CWGP models using transformations4 and their compositions from Table 2. For each of these datasets, we perform both regression and uncertainty quantification (UQ) by computing the RMSE and NLPD, which we record in Table 4. Our two metrics evaluate both the predictive mean and predictive variance, respectively: RMSE is the root mean squared error metric evaluating predictive mean, and NLPD is the mean negative log predictive density metric evaluating both the predictive mean and predictive variance (uncertainty). For space's sake, we record additional performance metrics such as MAE in the appendix (Table 6). We also compare end-to-end inference time cost in Table 5 to give the reader a better idea of the computational overhead associated with BTG. This compute time generally depends on the dimension of the integral, i.e., the total number of hyperparameters that we must marginalize out in the fully Bayesian approach, and thus the numbers vary by a bit depending on the dataset. Our results are largely favorable. We find that composed BTG models tend to outperform singletransformation BTG models, which themselves tend to outperform their GP, WGP, and CWGP counterparts. The DeepGP model performs poorly in most of these problems due to the lack of enough data, which would otherwise allow it to overcome the approximation error associated with variational inference. More generally, BTG outperforms other baselines on almost all problems for both regression and uncertainty quantification (UQ), and quite convincingly in certain cases —for example, BTG achieves an NLPD around two orders of magnitude better than existing models in the Camel dataset. 5 These results demonstrate the improved flexibility afforded by layered transformations, and is evidence of the superior performance possible with a fully Bayesian approach on small to medium sized datasets. 4We omit the tanh(·) transform used in the original WGP paper (Snelson et al., 2004) since Rios & Tobar (2019) shows that the elementary transforms in Table 2 are competitive with tanh(·). 5We tried to compare against BWGP, but could not find a code release available. We suspect BWGP to possess similar performance to the DeepGP, as both use variational inference and highly flexible families of warping functions. | | SixHumpCamel | Abalone | | | Wine | | |-----------|----------------|------------|-----|------------|--------|------------| | | Dim | Time (min) | Dim | Time (min) | Dim | Time (min) | | WGP-BC | 5 | 0.68 | 10 | 1.28 | 14 | 1.52 | | WGP-SA | 6 | 0.78 | 11 | 1.22 | 15 | 1.60 | | CWGP-L-SA | 8 | 1.08 | 13 | 1.48 | 17 | 2.50 | | CWGP-A-BC | 9 | 1.14 | 15 | 1.56 | 18 | 2.82 | | BTG-BC | 4 | 1.10 | 9 | 1.02 | 13 | 1.40 | | BTG-SA | 5 | 0.95 | 10 | 1.04 | 14 | 1.29 | | BTG-L-SA | 7 | 1.74 | 12 | 1.11 | 16 | 1.79 | | BTG-A-BC | 8 | 1.65 | 14 | 1.09 | 17 | 1.87 | Table 5: End-to-end regression times for SixHumpCamel, Abalone and Wine datasets, using the following models: GP, WGP, CWGP, BTG, and the following transformations: SA:SinhArcSinh, BC:BoxCox, L:affine. We note that the timings for BTG depends on the number of quadrature nodes it uses, but we made sure that these settings were consistent with those of Table 4, in which BTG outperforms GP, WGP, and CWGP. Additionally, due to our efficient numerical methods, the end-to-end inference time of BTG is generally comparable to other baselines –the compute time of BTG is only a bit higher than that of WGP. ## 6 Conclusion In this paper, we revisited the Bayesian transformed Gaussian (BTG) model, which is a variant of Bayesian trans-Kriging. BTG can be seen as a fully Bayesian treatment of input-warped GPs, and we believe it fills an important niche in the GP literature, which has yet not explored the combination of transformed GPs and Bayesian inference. We have presented a set of efficient methods for efficiently computing with the BTG model. These methods combine sparse grid quadrature, quadrature sparsification, and tight quantile bounds significantly reduces the expense of computing BTG's predictive median—in certain cases rivaling even the speed of MLE—without degrading prediction accuracy. Furthermore, we proposed a fast LOOCV algorithm for BTG for model selection and assessing model fit. An advantage of our framework is that it allows the practitioner to control the trade-off between the speed and accuracy of the Bayesian approach by modulating the sparsification of the grid and tolerance of the quantile-finding routine. Using these efficient methods, we were able to compute a set of experiments suggesting that BTG demonstrates superior performance over its comparable models in low-data and medium-data regimes, where hyperparameters are likely under-specified. In future work, we would like to combine our approach with approximate GP inference to further improve computational efficiency. Furthermore, though our sparse quadrature rules allow us to go to higher dimensions, we will still eventually hit a limit (depending on the problem, perhaps around 50); to go to dimensions in the hundreds or thousands, additional assumptions and methodologies will be needed. Lastly, we would like to apply BTG to Bayesian optimization, which is one application we believe to be particularly suitable for it, since we expect data to be sparse. ## References Ryan Prescott Adams, Iain Murray, and David JC MacKay. Tractable nonparametric Bayesian inference in Poisson processes with Gaussian process intensities. In Proceedings of the 26th Annual International Conference on Machine Learning, pp. 9–16, 2009. J Aitchinson and JR Dunsmore. Statistical prediction analysis. Technical report, 1975. 17 George EP Box and David R Cox. An analysis of transformations. Journal of the Royal Statistical Society. Series B (Methodological), 26(2):211–243, 1964. Hans-Joachim Bungartz and Michael Griebel. Sparse grids. *Acta Numerica*, 13:147–269, 2004. Henry R Chai and Roman Garnett. Improving quadrature for constrained integrands. In *The 22nd International Conference on Artificial Intelligence and Statistics*, pp. 2751–2759. PMLR, 2019. D Cole, C Martin-Moran, AG Sheard, HKDH Bhadeshia, and DJC MacKay. Modelling creep rupture strength of ferritic steel welds. *Science and Technology of Welding and Joining*, 5(2):81–89, 2000. Paulo Cortez, António Cerdeira, Fernando Almeida, Telmo Matos, and José Reis. Modeling wine preferences by data mining from physicochemical properties. *Decision Support Systems*, 47(4):547–553, 2009. Noel A. C. Cressie. *Statistics for spatial data*. Wiley, 1993. Andreas Damianou and Neil Lawrence. Deep Gaussian processes. In *Artificial intelligence and statistics*, pp. 207–215. PMLR, 2013. Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. Mark N Gibbs. *Bayesian Gaussian processes for regression and classification*. PhD thesis, University of Cambridge, 1998. Jan Graßhoff, Alexandra Jankowski, and Philipp Rostalski. Scalable gaussian process separation for kernels with a non-stationary phase. In *International Conference on Machine Learning*, pp. 3722–3731. PMLR, 2020. Florian Heiss and Viktor Winschel. Likelihood approximation by numerical integration on sparse grids. Journal of Econometrics, 144(1):62 - 80, 2008. Kalvik Jakkala. Deep gaussian processes: A survey. *arXiv preprint arXiv:2106.12135*, 2021. Vidhi Lalchand and Carl Edward Rasmussen. Approximate inference for fully Bayesian Gaussian process regression. In *Symposium on Advances in Approximate Bayesian Inference*, pp. 1–12. PMLR, 2020. Miguel Lázaro-Gredilla. Bayesian warped Gaussian processes. Advances in Neural Information Processing Systems, 25:1619–1627, 2012. Patrick Kofod Mogensen and Asbjørn Nilsen Riseth. Optim: A mathematical optimization package for Julia. Journal of Open Source Software, 3(24):615, 2018. Marcin Molga and Czesław Smutnicki. Test functions for optimization needs. *Test functions for optimization* needs, 101:48, 2005. Victor De Oliveira, Benjamin Kedem, and David A. Short. Bayesian prediction of transformed Gaussian random fields. *Journal of the American Statistical Association*, 92(440):1422–1433, 1997. Carl Edward Rasmussen and Christopher K. I. Williams. *Gaussian processes for machine learning*. MIT Press, 2008. Gonzalo Rios and Felipe Tobar. Compositionally-warped Gaussian processes. *Neural Networks*, 118:235 – 246, 2019. Simone Rossi, Markus Heinonen, Edwin Bonilla, Zheyang Shen, and Maurizio Filippone. Sparse gaussian processes revisited: Bayesian approaches to inducing-variable approximations. In *International Conference* on Artificial Intelligence and Statistics, pp. 1837–1845. PMLR, 2021. Hugh Salimbeni and Marc Deisenroth. Doubly stochastic variational inference for deep gaussian processes. Advances in neural information processing systems, 30, 2017. Edward Snelson, Zoubin Ghahramani, and Carl E. Rasmussen. Warped Gaussian processes. Advances in Neural Information Processing Systems, 16:337–344, 2004. Gunter Spöck, Hannes Kazianka, and Jürgen Pilz. Bayesian trans-Gaussian kriging with log-log transformed skew data. In *Interfacing Geostatistics and GIS*, pp. 29–43. Springer, 2009. Gilbert W. Stewart. *Matrix algorithms*, volume I. SIAM, Society for industrial and applied mathematics, 1998. Dustin Tran, Rajesh Ranganath, and David M Blei. The variational gaussian process. arXiv preprint arXiv:1511.06499, 2015. Andrew Wilson and Hannes Nickisch. Kernel interpolation for scalable structured gaussian processes (kissgp). In *International conference on machine learning*, pp. 1775–1784. PMLR, 2015. ## A Methodology A.1 Quadrature Sparsification We assume the posterior cdf is the mixture of cdfs F(x) = PM i=1 wifi(x), 0 ≤ fi(x) ≤ 1, and fi(x) are monotone increasing for i = 1*, . . . , M*. Assume the weights {wi}M i=1 are decreasingly ordered by magnitude from 1 to M. We consider the quantiles of the approximant Fk(x), a truncated and re-scaled F(x). Lemma A.1. Define k to be the smallest integer such that Pk smallest integer such that $\sum_{i=1}^{k}w_{i}\geq1-\epsilon$. Then define the scaled, truncated, $F_{k}(x):=\dfrac{1}{c}\sum_{i=1}^{k}w_{i}f_{i}(x),\quad c:=\sum_{i=1}^{k}w_{i}$ mixture We have $$|F(x)-F_{k}(x)|\leq2\epsilon.$$ Proof. Let Rk(x) = |Fk(x) − F(x)|. We have $$R_{k}(x)=\left|\left(\frac{1}{c}-1\right)\sum_{i=1}^{k}w_{i}f_{i}(x)+\sum_{i=k+1}^{M}w_{i}f_{i}(x)\right|$$ $$\leq\left|\left(\frac{1}{c}-1\right)\sum_{i=1}^{k}w_{i}f_{i}(x)\right|+\left|\sum_{i=k+1}^{M}w_{i}f_{i}(x)\right|$$ $$\leq\frac{1-c}{c}\sum_{i=1}^{k}w_{i}f_{i}(x)+1-c$$ $$\leq2(1-c)\leq2\epsilon.$$ Proposition A.1 (Error Bound for Positive Weights). For any ϵ ∈ (0, 1), let k *be the smallest integer such* that Pk i=1 wi ≥ 1 − ϵ*. Then define the scaled, truncated mixture* Fk(x) := 1 c X k i=1 wifi(x), c := X k i=1 wi. Let p ∈ (0, 1) and assume that p ± 2ϵ ∈ (0, 1)*. Then we have the bound:* $$F^{-1}(p-2\epsilon)\leq F_{k}^{-1}(p)\leq F^{-1}(p+2\epsilon).$$ Proof. Let Fk(x ∗) = p. Then |p − Fk(x ∗)| ≤ 2ϵ, so $$p-2\epsilon\leq F(x^{*})\leq p+2\epsilon$$ It follows that $$F^{-1}(p-2\epsilon)\leq x^{*}\leq F^{-1}(p+2\epsilon).$$ Proposition A.2 (Error Bound for Negative Weights). Let F(x) be defined as before, except each wi *is no* longer required to be positive. Consider the split F(x) = FM′ (x) + RM′ (x)*, where* FM′ (x) = PM′ i=1 wifi(x) and RM′ (x) = PM i=M′+1 wifi(x). Then for any x, we have RM′ (x) ∈ [ϵ−, ϵ+], where the epsilons are defined as the sum of positive (resp. negative) weights of RM′ (x) $\epsilon_{-}=\sum_{i=M^{\prime}+1}^{M}[w_{i}]_{-}\leq0\,\ \epsilon_{+}=\sum_{i=M^{\prime}+1}^{M}[w_{i}]_{+}\geq0.$ Then we bound F −1(p) *as follows:* $$F^{-1}(p+\epsilon_{-})\leq F_{M^{\prime}}^{-1}(p)\leq F^{-1}(p+\epsilon_{+}).$$ Proof. Let FM′ (x ∗) = p. Then we can wrote F(x ∗) = p + RM′ (x ∗). Since ϵ− ≤ RM′ (x ∗) ≤ ϵ+, it follows that $$p+\epsilon_{-}\leq F(x)$$ ∗) ≤ p + ϵ+ from which the result follows. Proposition A.3 (Error Bound at a quantile). Let F(x) be defined as before, ϵ1, ϵ2 ∈ (0, 1)*, and* Fk(x) be an approximate to F(x) *such that* F −1(p − ϵ1) ≤ F −1 k(p) ≤ F −1(p − ϵ2) for some p ∈ (0, 1)*. Assuming* p − ϵ1, p + ϵ2 ∈ (0, 1)*, we have the following error bound at a quantile,* $$\square$$ $$\left|F_{k}^{-1}(p)-F^{-1}(p)\right|\leq\epsilon\operatorname*{max}_{\xi\in(p-\epsilon_{1},p+\epsilon_{2})}\left|{\frac{d F^{-1}}{d x}}(\xi)\right|,$$ where ϵ = max{ϵ1, ϵ2}. Proof. We have $$\left|F_{k}^{-1}(p)-F^{-1}(p)\right|$$ $$\leq\max\{|F^{-1}(p-\epsilon_{1})-F^{-1}(p)|,|F^{-1}(p-\epsilon_{2})-F^{-1}(p)|\}$$ $$\leq\max\{\epsilon_{1},\epsilon_{2}\}\max_{\xi\in(p-\epsilon_{1},p+\epsilon_{2})}\left|\frac{dF^{-1}}{dx}(\xi)\right|.$$ ## A.2 Quantile Bounds Proposition A.4 (Convex Hull). Let F(x) be defined as before with wi > 0 and PM i=1 wi = 1*. Then* $$\square$$ $$\operatorname*{min}_{i}f_{i}^{-1}(p)\leq F^{-1}(p)\leq\operatorname*{max}_{i}f_{i}^{-1}(p).$$ Proof. Assume for the sake of contradiction that F −1(p) > maxi f −1 i(p). Let k = arg maxi f −1 i(p). Using the fact that f −1 k(p) ≥ f −1 j(p) for any j ̸= k, we have fj (f −1 j(p)) ≥ p for any j ̸= k. Therefore, we have $$\begin{array}{r l}{p>F(f_{k}^{-1}(p))}\\ {=\sum_{j=1}^{M}w_{j}f_{j}(f_{k}^{-1}(p))}\\ {=w_{k}p+\sum_{j\neq i}w_{j}f_{j}(f_{k}^{-1}(p))}\\ {\geq w_{k}p+(1-w_{k})p=p,}\end{array}$$ which leads to a contradiction. The lower bound is analogous. Proposition A.5 (Singular Weight). Let F(x) be defined as before with wi > 0 and PM i=1 wi = 1*. Let* wi = 1 − wi*. Then* $$\operatorname*{max}_{p-\overline{{{w}}}_{i}\geq0}f_{i}^{-1}(p-\overline{{{w}}}_{i})\leq F^{-1}(p)\leq\operatorname*{min}_{p+\overline{{{w}}}_{i}\leq1}f_{i}^{-1}(p+\overline{{{w}}}_{i}).$$ Proof. Assume for sake of contradiction that $$F^{-1}(p)>f_{i}^{-1}(p+\overline{{{w}}}_{i})$$ $\square$ Then $p>F\left(f_{i}^{-1}(p+\overline{w}_{i})\right)$ $=\sum_{j=1}^{N}w_{j}f_{j}\left(f_{i}^{-1}(p+\overline{w}_{i})\right)$ $=w_{i}(p+\overline{w}_{i})+\sum_{j\neq i}w_{j}f_{j}\left(f_{i}^{-1}(p+\overline{w}_{i})\right)$ $\geq w_{i}(p+\overline{w}_{i})$ However this implies that 0 > wi(wi − p), which is a contradiction because 1 ≥ wi and wi ≥ p (by the assumption that p + wi ≤ 1). The lower bound is analogous. ## B Fast Cross Validation In this section, we discuss results leading up to O(n 3) LOOCV algorithms for BTG, which are given by Algorithm 1 and Algorithm 2. Naively, the BTG LOOCV procedure has O(n 4) time cost, due to the costs associated with solving generalized least squares problems related by single-point deletion and evaluating determinants of principle submatrices. We present relevant propositions used to solve these LOOCV subproblems efficiently in §B.1, and derive our full algorithm in §B.2. Notation Let fX, MX, KX, x, σθ,λ, qθ,λ, mθ,λ and Cθ,λ be defined same as in the paper. As before, we use the (−i) notiation to represent to omission of information from the ith data point. For the BTG LOOCV problem, we consider the n submodels {Model(−i)} n i=1 trained on {x (−i), f(−i) X , M(−i) X } n i=1: the locationcovariate-label triples obtained by omitting data points one at a time. We wish to efficiently compute the posterior predictive distributions of all n submodels indexed by i ∈ {1*, ..., n*}, $$p\big{(}f({\bf x}^{(-i)})\mid f_{X}^{(-i)}\big{)}\propto\sum_{j=1}^{M}w_{j}L_{j}J_{j}p(\theta_{j})p(\lambda_{j}),\tag{9}$$ where Lj = p gλj (f(x $\left(x^{(-i)}\right)\mid\theta_j,\lambda_j,f_X^{(-i)}\right)$ and for $i\in\{1,2,\dots,M\}$. Jj = pf (−i) X |θj , λj for j ∈ {1, 2*, . . . , M*}. Recall that in Equation 9, pgλ(f(x)) | *θ, λ, f*X is the probability density function of the t-distribution Tn−p(mθ,λ,(qθ,λCθ,λ) −1) and p(fX|*θ, λ*) is the likelihood of data given hyperparameters. Problem Formulation We have to efficiently compute the parameters that of the posterior mixture of t-distributions in Equation 9: $$\{\mathrm{TParameters}^{(-i)}\}_{i=1}^{n}:=\left\{m_{\theta_{i},\lambda_{i}}^{(-i)},q_{\theta_{i},\lambda_{i}}^{(-i)},C_{\theta_{i},\lambda_{i}}^{(-i)}\right\}_{i=1}^{n}$$ $$(10)$$ For definitions of these quantities, we refer to the main text. We instead emphasize here that solving for q (−i) θ,λ entails solving perturbed generalized least squares problems and that solving for m (−i) θ,λ and C (−i) θ,λ entail solving perturbed linear systems. For the likelihood term in Equation 9, we have $$p(f_{X}|\theta,\lambda)\propto\left|\Sigma_{\theta}\right|^{-1/2}\left|M_{X}^{T}\Sigma_{\theta}^{-1}M_{X}\right|^{-1/2}q_{\theta,\lambda}^{(-(n-p)/2)},$$ hence we are interesting in computing the following for i ∈ {1, 2*, . . . , n*}: $$\mathrm{Det}^{(-i)}=\biggl\{|\Sigma_{\theta}^{(-i)}|,|(M_{X}^{(-i)})^{T}\Sigma_{\theta}^{(-i)}M_{X}^{(-i)}|\biggr\}.$$ . (10) The perturbed least squares problems and linear systems can be solved independently in O(n 3) time, hence a naive LOOCV procedure would take O(n 4) time. However, using matrix decompositions, we can improve this to O(n 3) total time. Algorithms Algorithms 1 and 2 are used for efficiently computing TParameters(−i) n i=1 and Det(−i) n i=1 for fixed hyperparameters (*θ, λ*). The total time complexity is O(n 3), because the dominant costs are precomputing a Cholesky factorization for a kernel matrix and repeating O(n 2) operations across n submodels. Algorithm 1 T-Distributions of Sub-Models Inputs Y = gλ ◦ fX, MX, KX, x Outputs: {m (−i) θ,λ } n i=1, {q (−i) θ,λ } n i=1, {C (−i) θ,λ } n i=1 Pre-compute *R, R*X, and xˆ, where RT R = KX, RTXRX = MTXK −1 X MX, xˆ = K −1 X Y for i = 1 *. . . n* do ℓi = K −1 X ei/|e T i K−1ei| R (−i) X ← Downdate(RX, ℓi) (Proposition B.3) ri ← Yi/∥R−Tei∥ 2 2 xˆ (−i) ← xˆ − riR−1(R−Tei) (Proposition B.2) β (−i) θ,λ ←R (−i) X−1R (−i) X−TM (−i) X xˆ (−i) Frozen Hyperparameters We remark that our LOOCV algorithm is possible because sparse grids and QMC are *deterministic*—since the underlying sampling grids in hyperparameter-space are frozen—in contrast to Monte Carlo (MC) methods, which are *stochastic*. Since we use fixed sparse grids, and we are in fact interested in evaluating the posterior distribution at fixed hyper-parameters {θi, λi}M i=1. If the sampling grid were not frozen across sub-models, our approach would not be viable, because the sampled points in hyperparameter-space would be different for each sub-model. Likewise, in the MLE approach, hyperparameters {θi, λi}M i=1 should theoretically be retrained on the submodels, hence we cannot re-use computed values. Algorithm 2 Fast Determinant Computation 1: **Inputs** KX 2: **Output** {log |K (−i) X |}n i=1 3: Precompute RT R = KX 4: Precompute log(|KX|) 5: for i = 1 *. . . n* do 6: bi = e T i K (−1) X ei 7: log |K (−i) X | ← log(|KX|) + log(bi) (Propsition B.1) 8: **end for** 9: **return** ## B.1 Auxiliary Results In this section, we present linear algebra results used in the derivations of Algorithms 1 and 2 in § B.2. Proposition B.1 (Determinant of a Principal Minor). $$\operatorname*{det}{\big(}\Sigma^{(-i)}{\big)}=\operatorname*{det}(\Sigma){\big(}e_{i}^{T}\Sigma^{-1}e_{i}{\big)}$$ Proposition B.2 (Abridged Linear System). Let K ∈ R n×n be of full rank, and let *c, y* ∈ R n *satisfy* Kc = y. Then if ri = ci/eT i K−1ei*, we have:* $$c^{(-i)}=(K^{(-i)})^{-1}y^{(-i)}=c-r_{i}K^{-1}e_{i}.$$ Lemma B.1 (Determinant of the Schur Complement of a Principal Minor). If X ∈ R n×m with m < n has full column rank and Σ ∈ R n×n *is a positive definite matrix, then* $$\begin{array}{r l}{\operatorname*{det}\left(\left(X^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}X^{(-i)}\right)}\\ {=-{\frac{1}{\operatorname*{det}\left(\Sigma^{(-i)}\right)}}\operatorname*{det}\left(\left[{\begin{array}{l l}{\Sigma}&{X}\\ {X^{T}}&{O}\end{array}}\right]\right)e_{i}^{T}\left[{\begin{array}{l l}{\Sigma}&{X}\\ {X^{T}}&{O}\end{array}}\right]^{-1}e_{i}}\end{array}$$ Proof. Extend the Cholesky factorization RT 11R11 of Σ to obtain the LDL-decomposition $$W:=\begin{bmatrix}\Sigma&X\\ X^{T}&O\end{bmatrix}=\begin{bmatrix}R_{11}^{T}&0\\ R_{12}^{T}&R_{22}^{T}\end{bmatrix}\begin{bmatrix}I&0\\ 0&-I\end{bmatrix}\begin{bmatrix}R_{11}&R_{12}\\ 0&R_{22}\end{bmatrix}$$ where R22 = Cholesky(RT 12R12) and R12 = R −T 11 X. Observe X(−i)T Σ (−i)−1X(−i)is a Schur complement of W(−i). This implies that $$\begin{array}{l}{{\operatorname*{det}\left(W^{(-i)}\right)}}\\ {{=\operatorname*{det}\left(\Sigma^{(-i)}\right)\operatorname*{det}\left(-\left(X^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}X^{(-i)}\right)}}\end{array}$$ By Proposition B.1 $$\operatorname*{det}\left(W^{(-i)}\right)=\operatorname*{det}(W)e_{i}^{T}W^{-1}e_{i}.$$ Therefore $$\begin{array}{r}{\operatorname*{det}\left(\left(X^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}X^{(-i)}\right)}\\ {={\frac{1}{\operatorname*{det}(\Sigma^{(-i)})}}\operatorname*{det}(W)e_{i}^{T}W^{-1}e_{i}.}\end{array}$$ Lemma B.2 (Rank one downdate for bilinear forms). If x ∈ R n and Σ *is a positive definite matrix in* R n×n, then $$\left(x^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}x^{(-i)}=x^{T}\left(\Sigma^{-1}-\frac{\Sigma^{-1}e_{i}e_{i}^{T}\Sigma^{-1}}{e_{i}^{T}\Sigma^{-1}e_{i}}\right)x$$ where Σ (−i) ∈ R (n−1)×(n−1) is the (i, i)th principal minor of Σ and x (−i) ∈ R (n−1) results from deleting the i*th entry of* x. Proof. By Lemma B.1, we have $$\left(x^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}x^{(-i)}=\det\left(\left(x^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}x^{(-i)}\right)$$ $$=\frac{1}{\det(\Sigma^{(-i)})}\det(W)e_{i}^{T}W^{-1}e_{i}.$$ In this equation, $$W=\begin{bmatrix}\Sigma&X\\ X^{T}&O\end{bmatrix}=R^{T}\begin{bmatrix}I&0\\ 0&-1\end{bmatrix}R,\quad R=\begin{bmatrix}R_{11}&R_{12}\\ O&R_{22}\end{bmatrix},$$ where R11 = chol(Σ), R12 = R −T 11 X, and R22 = √x T Σ−1x. Using this decomposition, we may compute the term e T i W−1ei. Since, $$R^{-T}e_{i}=\left[R_{11}^{-T}e_{i}\qquad-\frac{x^{T}\Sigma^{-1}e_{i}}{\sqrt{x^{T}\Sigma^{-1}x}}\right]^{T},$$ we have $$e_{i}^{T}W^{-1}e_{i}=e_{i}^{T}R^{-1}R^{-T}e_{i}-\frac{(e_{i}^{T}\Sigma^{-T}x)(x^{T}\Sigma^{-1}e_{i})}{x^{T}\Sigma^{-1}x}$$ $$=e_{i}^{T}\Sigma^{-1}e_{i}-\frac{(x^{T}\Sigma^{-1}e_{i})^{2}}{x^{T}\Sigma^{-1}x}.$$ $\square$ Lastly, we have $${\frac{\operatorname*{det}(W)}{\operatorname*{det}(\Sigma^{(-i)})}}={\frac{-\operatorname*{det}(\Sigma)\operatorname*{det}(x^{T}\Sigma^{-1}x)}{\operatorname*{det}(\Sigma)e_{i}^{T}\Sigma^{-1}e_{i}}}={\frac{x^{T}\Sigma^{-1}x}{e_{i}^{T}\Sigma^{-1}e_{i}}}.$$ These together imply that $$\left(x^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}x^{(-i)}=x^{T}\Sigma^{-1}x-\frac{x^{T}\Sigma^{-1}e_{i}e_{i}^{T}\Sigma^{-1}e_{i}}{e_{i}^{T}\Sigma^{-1}e_{i}}$$ as desired. Proposition B.3 (Rank one matrix downdate). If X ∈ R n×m with m < n has full column rank and Σ *is a* positive definite matrix in R n×n*. Let* vi = Σ−1ei *then* $$\left(X^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}X^{(-i)}=X^{T}\left(\Sigma^{-1}-\frac{v_{i}v_{i}^{T}}{e_{i}^{T}\Sigma^{-1}e_{i}}\right)X,$$ where Σ (−i) ∈ R (n−1)×(n−1) is the (i, i)th principal minor of Σ and X(−i) ∈ R (n−1)×m results from deleting row i *from* X. Proof.: Let $\hat{\Sigma}:=\Sigma^{-1}-\frac{\Sigma^{-1}e_{i}e_{i}^{T}\Sigma^{-1}}{e_{i}^{T}\Sigma^{-1}e_{i}}$. It suffices to prove that $$(x^{(-i)})^{T}(\Sigma^{(-i)})^{-1}y^{(-i)}=x^{T}\hat{\Sigma}y,\quad\forall x,y\in\mathbb{R}^{N}$$ However, this follows from Lemma B.2, because $$\left((x+y)^{(-i)}\right)^{T}\bigl(\Sigma^{(-i)}\bigr)^{-1}(x+y)^{(-i)}=(x+y)^{T}\hat{\Sigma}(x+y)$$ Expanding and canceling symmetric terms yields x (−i)T Σ (−i)−1y (−i) +y (−i)T Σ (−i)−1x (−i) = x T Σˆy + y T Σˆx implying the result. ## B.2 Algorithm Derivation Recall the following definitions of elements in {TParameters(−i)} n i=1 from §B: $$q_{\theta,\lambda}=\min_{\beta}\left\|g_{\lambda}\big{(}f_{X}\big{)}-M_{X}\beta\right\|_{\big{(}K_{X}\big{)}^{-1}}^{2}$$ $$\hat{\beta}_{\theta,\lambda}=\arg\min_{\beta}\left\|g_{\lambda}\big{(}f_{X}\big{)}-M_{X}\beta\right\|_{\big{(}K_{X}\big{)}^{-1}}^{2}$$ $$m_{\lambda,\theta}=K_{\mathbf{x}X}K_{X}^{-1}\big{(}g_{\lambda}(f_{X})-M_{X}\beta_{\lambda,\theta}\big{)}+\hat{\beta}_{\lambda,\theta}^{T}m(\mathbf{x})$$ $C_{\lambda,\theta}=B(\mathbf{x})/[k_{\theta}(\mathbf{x},\mathbf{x})]\,$ (Schur Complement) . Cλ,θ = B(x)/[kθ(x, x)] (Schur Complement) (14) We use the generalized least squares LOOCV subroutine, outlined in Section B.2.1 to compute q (−i) θ,λ and ˆ β (−i) θ,λ efficiently for all i ∈ {1*, ..., n*}. We use Proposition B.2 to efficiently compute mλ,θ and Cλ,θ whenever a perturbed linear system arises. Generally, these routines involve precomputing a Cholesky decomposition and using it for back-substitution. These steps are enumerated in Algorithm 1. The computation of {Det(−i)} n i=1 is straightforward given Proposition B.1 and a Cholesky decomposition of the kernel matrix. ## B.2.1 Generalized Least Squares The generalized least squares (GLS) LOOCV problem is that of solving the following set of problems efficiently: $\left\{\arg\min\limits_{x\in\mathbb{R}^p}\left\|b^{(-i)}-A^{(-i)}x\right\|_{\Sigma^{(-i)}}^2\right\}_{i=1}^n.$ sitive definite, $b\in\mathbb{R}^n$, $A\in\mathbb{R}^{n\times p}$, $\mathrm{Rank}(A)=1$ $$(11)$$ $$(12)$$ $$(13)$$ $$(14)$$ $$(15)$$ It is assumed that Σ ∈ R n×n is positive definite, b ∈ R n×p, Rank(A) = Rank(A(−i)) = p for some p < n and for all i ∈ {1, 2*, ..., n*}. We consider the normal equations for the ith subproblem: $$\operatorname*{arg\,min}_{x\in\mathbb{R}}{\big(}A^{(-i)}x-b^{(-i)}{\big)}^{T}{\big(}\Sigma^{(-i)}{\big)}^{-1}{\big(}A^{(-i)}x-b^{(-i)}{\big)},$$ namely, $$\left(A^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}A^{(-i)}x=\left(A^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}b^{(-i)}.$$ (−i). (15) We first show that Equation 15 has a unique solution. By Proposition B.3, we have $$\left(A^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}\left(A^{(-i)}\right)=A^{T}\Sigma^{-1}A-\frac{v_{i}v_{i}^{T}}{e_{i}^{T}\Sigma^{-1}e_{i}},$$ where vi = AT Σ −1ei. The LHS is a rank-1 downdate applied to AT Σ −1A. Moreover, the LHS is positive definite and hence invertible, because by assumption, Rank(A(−i)) = p, and Σ (−i)is positive definite. We find the solution to Equation 15 by first computing the Cholesky factorization of the LHS. Specifically, given a Cholesky factorization RT R of AT Σ −1A from the full problem, the Cholesky factorization of the subproblem can be computed by a O(p 2) Cholesky downdate R(−i) = Downdate(*R, v*i/eT i Σ −1ei) such that $$\left(R^{(-i)}\right)^{T}R^{(-i)}=\left(A^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}A^{(-i)}.$$ We therefore can solve the normal equation 15 $$x^{(-i)}=\left(\left(A^{(-i)}\right)^{T}\left(\Sigma^{(-i)}\right)^{-1}A^{(-i)}\right)^{-1}\left(A^{(-i)}\right)^{T}y^{(-i)},$$ i)=11(-i). The vector of $\mathfrak{G}(\cdot^{2})$ is strictly holomorphic. where where y (−i) = (Σ(−i)) −1b (−i). The cost of O(n 2) is attained by evaluating terms from right to left. We first evaluate y (−i)in O(n 2) time by making use of Proposition B.2. We then perform back-substitution using the cholesky factor R(−i)in O(p 2) time. The overall time complexity is thus O(n 3). ## C Supplementary Numerical Results In addition to the main results in Table 4, we provide results of the MAE metrics as well in Table 6. Conclusions are similar as in Section 5. | IntSine | Camel | Abalone | Wine | Creep | | | | | | | |-----------|---------|-----------|--------|---------|-------|-------|-------|-------|-------|-------| | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | | | GP | 0.227 | 0.171 | 2.003 | 1.781 | 3.290 | 2.208 | 1.994 | 1.792 | 37.88 | 25.68 | | WGP-A | 0.179 | 0.117 | 2.055 | 1.815 | 3.097 | 2.068 | 0.811 | 0.677 | 35.48 | 24.27 | | WGP-SA | 0.172 | 0.109 | 2.012 | 1.788 | 2.992 | 2.022 | 0.809 | 0.670 | 61.62 | 45.85 | | WGP-BC | 0.184 | 0.123 | 1.964 | 1.751 | 2.826 | 1.940 | 1.045 | 0.784 | 40.38 | 25.49 | | CWGP-L-SA | 0.172 | 0.109 | 2.055 | 1.815 | 3.117 | 2.100 | 0.808 | 0.670 | 91.89 | 73.05 | | CWGP-A-BC | 0.174 | 0.113 | 1.960 | 1.747 | 3.088 | 2.069 | 0.808 | 0.670 | 37.89 | 25.34 | | BTG-I | 0.169 | 0.100 | 1.820 | 1.731 | 2.804 | 1.842 | 0.808 | 0.670 | 38.11 | 26.18 | | BTG-A | 0.168 | 0.101 | 1.827 | 1.741 | 2.890 | 1.900 | 0.807 | 0.669 | 38.68 | 27.68 | | BTG-SA | 0.165 | 0.104 | 1.801 | 1.796 | 2.791 | 1.822 | 0.820 | 0.696 | 91.69 | 74.04 | | BTG-BC | 0.170 | 0.102 | 1.675 | 1.666 | 3.225 | 2.172 | 0.808 | 0.670 | 39.10 | 26.52 | | BTG-L-SA | 0.145 | 0.082 | 1.673 | 1.658 | 2.871 | 1.870 | 0.809 | 0.670 | 91.83 | 73.05 | | BTG-A-BC | 0.159 | 0.090 | 1.828 | 1.742 | 2.832 | 1.814 | 0.802 | 0.664 | 35.25 | 24.44 | Table 6: A comprehensive set of RMSE and MAE results for prediction using the IntSine, SixHumpCamel, Abalone, Wine and Creep datasets. We generally kept the training sets small, to highlight BTG's advantages in the data-sparse regime, though for the IntSine function there was a good amount of data. We compare the following models: GP, WGP, CWGP, BTG, and use the following transformations transformations: I: Identity, A: ArcSinh, SA: SinhArcSinh, BC: BoxCox, L: affine. The best method is bolded; we find that BTG has lower RMSE and MAE than the other models, though unsurprisingly, different transformations are more suitable for different datasets.
Review 1: Summary: This work revisits the BTG model, which has latent and observations spaces with a deterministic function mapping these two spaces. The central idea is to approximate the BTG posterior predictive density using a mixture of t-distributions. In doing so, several tricks are cleverly intermixed to address computational challenges in obtaining the GP posterior. The proposed work is evaluated in various relevant experimental settings to ascertain the advantages of introduced techniques, i.e., sparse grids, QMC, and fast way to perform LOOCV. Strengths and Weaknesses: Strengths: - This paper presents relevant literature and content in a way that is easier to follow and sets up a clear motivation. - This work presents several theoretical and practical results that are interesting. E.g., analysis to quantify the quantile estimation error by sparsifying quadrature rules is interesting. - Empirical analyses highlighting proposed algorithms' computational and speed aspects are convincing. Weaknesses: - Time and accuracy compared with the MLE approach would be helpful. A top example demonstrates an 'overconfidence problem with the MLE approach, but an experimental setup involving a real dataset would add more value. - It seems worth mentioning about GraBhoff et al. 2020 and how the author's work compares to theirs. GraBhoff et al. 2020 adopt SKI to WGP setting and is fast low dimensional settings similar to the proposed work and sparse grids. - Simone et al. also propose a fully Bayesian sparse GPs approach that is relatively more scalable. It is worth mentioning why this approach would not apply to wrapped input settings considered in this paper. Or if it is, then it may be compared with them. - It'd be nice to mention when these approaches are more feasible and when they won't be possible. E.g., sparse grids are typically infeasible for high dimensions. Does the sparsification of quadrature allow it to go to higher dimensions? GraBhoff et al. 2020:- Jan GraBhoff, Alexandra Jankowski, Philipp Rostalski, "Scalable {G}aussian Process Separation for Kernels with a Non-Stationary Phase" Proceedings of the 37th International Conference on Machine Learning, PMLR 119:3722-3731, 2020. Rossi, Simone, et al. "Sparse Gaussian processes revisited: Bayesian approaches to inducing-variable approximations." International Conference on Artificial Intelligence and Statistics. PMLR, 2021. Requested Changes: One of the most critical changes is demonstrating that the proposed approach can indeed yield better uncertainty estimates on a real dataset. For the remaining changes, please refer to the Weaknesses section for the requested change. Consider points with which you agree. Minor typo: 'quartic' in "which incurs quartic cost naively." Broader Impact Concerns: I don't see it as a concern. ================================================== Review 2: Summary: The article proposes a computationally efficient approximation to the Bayesian Transformed Gaussian (BTG) model (i.e. composition of a GP with a deterministic function). The proposed method approximates the Bayesian posterior by a mixture of T-distributions, leverages sparse-quadrature methods (as well as a sparsification trick) instead of naive Monte-Carlo approximations, as well as clever numerical Linear-Algebra tricks for speeding-up computations. The proposed pipeline is tested on a range of test datasets and appears to provide competitive predictive performances without sacrificing scalability.  Before gathering a few comments, I would like to point out that I am **not** an expert in GP modeling. Strengths and Weaknesses: I have found the text well-written and relatively easy to follow. The motivation for the proposed methodology is clear, and the brief literature review is sufficient. I have not checked every single computation line-by-line, but the derivations are relatively standard. The numerical experiments are well executed and convincing. I think that it would be interesting to understand in more details the regime when the Bayesian treatment (BTG) is actually worth implementing when compared to the point-estimate approach (WGP/MLE). It is clear from the simulation (and the discussion in the text) that the data-scarce regime is such a scenarios -- what does happen with larger datasets? Requested Changes: I have a few questions: these are not necessarily requests of changes, but questions that I have asked myself while reading the manuscript -- this also indicates that some of the points below are now crystal clear in the current version of the manuscript. 1. The choice of prior distributions appears quite arbitrary (ie. chosen to ease computation, mainly). Is this correct? Does it impact the performance? If scalability were not an issue, are there better choices to consider? 2. In Equation (7) for $\phi(f|\theta, \lambda, \ldots)$ , am I correct assuming that the integral with respect to $f(x)$ does not equal one, because of the term $|g'_{\lambda}(f(x))|$ ? 3. In Equation $(8)$ do the weights $\widetilde{w}_i$ sum-up to one? I am finding this confusing. 4. Why use both MSE and RMSE? 5. I am not an expert in GP -- I could not help myself wonder whether choosing a more flexible family of kernel function would be enough to avoid using any "wrapping" function? In other words, would this lead to roughly equivalent predictive performances? All the experiments are performed with the extremely simple RBF kernel. 6. Performing a simple Gaussian approximation (eg. Laplace approx) of the posterior is a possible approach in between MLE and the proposed approach -- how is this approach performing, numerically? 7. One a possibly very simple example, this would be interesting, I think, to investigate WGP vs BTG as the number of points increases -- this would help to understand the regime when the "full Bayesian treatment" starts to not be necessary. I have enjoyed reading the text and I am looking forward to reading the authors' comments and clarifications. Broader Impact Concerns: NA. ================================================== Review 3: Summary: This paper revisited the Bayesian Transformed Gaussian process (BTG) model, which is summarized below: The original BTG (Kedem & Oliviera, 1997) imposes a Gaussian process (GP) prior on a parametric transformation of a (non-parametric) function of interest. This helps relaxing a strong assumption of Gaussian process which stipulates that the observation distribution is a multivariate normal distribution. This is similar to the idea of warped Gaussian processes (WGP) by (Snelson et al., 2004) but unlike WGP which optimizes the transformation/warped function via MLE; the BTG model further imposes a parametric prior on the warping function, which enables analytic derivation of the model evidence. However, the BTG model needs to use an artificial (and uninformative) prior to enable such analytic full Bayesian treatment, which is also costly in spaces of high-dimensional data. The BTG revisitation proposed in this paper therefore focuses on developing a more practical Bayesian treatment to reduce the overall computation cost of BTG while retaining its full Bayesian flavor. The BTG is also generalized to include multi-layered warping. Efficient methods for computing BTG predictive medians and quantiles as well as fast LOOCV with BTG are also proposed. The results are positively demonstrated on 6 regression datasets with input dim ranging from 5 to 18. Strengths and Weaknesses: Strengths: The paper is very well-written with clear & well-organized presentation. Despite being highly technical, the paper is actually easy to follow. The theoretical results are interesting & refreshing to read. Weaknesses: Despite the above strengths, there are several aspects of this paper that are unclear or even debatable for me: First, I do not agree with the viewpoint that variational inference on deep GP is not considered a fully Bayesian treatment. To me, full Bayesian treatment means we have uncertainty calibration of the model parameters; and variational inference (VI) does provide that. In fact, exact full Bayesian treatment is rarely possible and mostly people would resort to approximation schemes which are either via VI or sampling, such as the MC approaches adopted by the authors. Thus, in this line of thought, I would consider deep GP as a variant of multi-layer warped GP with full Bayesian treatment. As pointed out by the authors, deep GP provides a multi-layered transformation in which each layer is a random function distributed by a GP prior. On high level, deep GP and the revisited BTG basically aims to solve the same modeling problem with the same idea on provided multi-layered warping except that one is non-parametric while the other is parametric. Given this, I believe the experiment needs comparison with deep GP baselines to demonstrate more convincingly the advantages of the revisited BTG over deep GP. Second, regarding the improved scalability of BTG, I think the authors might have missed comparison with a set of potentially competitive baselines that involves the use of Gaussian processes. To elaborate, while warped Gaussian processes had been mostly demonstrated for full Gaussian processes, incorporating such warping idea to sparse Gaussian processes is straightforward and will likely lead to significant improvement in the compute cost. To see this, note that the key to warped Gaussian processes is a simple application of the change-of-variable theorem to the marginal likelihood, which results in an augmentation of the original likelihood with an additional log det of the corresponding Jacobian. Most sparse GP (which scales linearly in the no. of observations) has an analytic marginal likelihood and hence, incorporating the warping idea is immediately possible. I suspect this will likely reduce the cost to O(Mn) where M is the no. of quadrature nodes. Here are a few samples in this direction: Sparse online warped Gaussian process for wind power probabilistic forecasting (Applied Energy, 2013, pages 410-428) Sparse Spectrum Warped Input Measures for Nonstationary Kernel Learning (NeurIPS-20) Alternatively, we can also pick any off-the-shelf sparse GPs [*] and apply the change-of-variable theorem on their marginal likelihood to derive fast variant of warped Gaussian processes. [*] https://www.jmlr.org/papers/volume6/quinonero-candela05a/quinonero-candela05a.pdf Last, the entire point of being fully Bayesian is to have good uncertainty calibration. But this aspect has not been demonstrated at all. Furthermore, the claim that the proposed method can scale well in high-dimensional data space is a not very well-demonstrated seeing that most experimental datasets have low dimensions. Requested Changes: 1. Comparison with Deep GP models as well as the warping variant of sparse Gaussian processes as elaborated above. 2. Elaborate (at least empirically) on how the revisited BTG would have an advantage over deep GP as well as the (warped) sparse GP baselines in terms of uncertainty calibration. 3. If possible, do consider providing extra experiments with higher-dimensional (e.g., d = 100) datasets. Broader Impact Concerns: N/A ================================================== Review 4: Summary: This paper revisits the Bayesian transformed Gaussian introduced in Oliveira et al. (1997) and presents it as a Bayesian counterpart of the Warp GP (with potentially multiple layers of transformation) by assigning a prior to the warping parameters. The main contribution of the paper is to introduce a few techniques to speed up the computational cost of BTG inference, prediction and selection, including: - Replace Monte Carlo estimation with sparse grid quadrature or Quasi-Monte Carlo. Additionally sparsify the samples to trade-off approximation error with speed - Use quantile bounds to speed up quantile estimation. - Fast implementation of Leave-One-Out-Cross-Validation that reduces the computation complexity from N^4 to N^3. The paper also conducts empirical comparison of BTG with multiple transformation layers with GP and WGP methods, and provides a Julia package for transformed GPs. Strengths and Weaknesses: *Strengths* - This paper is well written in general and easy to follow, although a few sections would require some extent of rewritten and clarification. - The introduced techniques to speed up BTG computation are sound and well explained. Using quantile bounds to speed up the search is a nice idea. - The theoretical analysis to quantify the quantile estimation error caused by sparsification is useful in practice. - The empirical analysis of each component of the algorithm is useful for readers to appreciate their contribution to the entire method. - The Julia package could be a useful tool for people to use more sophisticated and robust GP algorithms than a vanilla implementation. *Weaknesses* - Limited novelty. The main contribution is to speed up a BTG model proposed in 1997 using a series of techniques. Quadrature is a widely used method to speed Monte Carlo estimation. It’s hard to justify that revisiting BTG in the context of ML and GP literature as a contribution compared to the original paper that proposed BTG as a Bayesian version for Gaussian random fields. - Some claims about the efficiency of the proposed method are not well supported by the experiment. - In Figure 3, to obtain a sufficient weight coverage, e.g. 0.9 or 0.95, the required number of nodes of QMC is similar to sparse grid quadrature. How do the authors choose the sparsification level in the experiments? Also, the prediction time is shown in the log-log scale. One should show it in the linear scale to tell whether it’s linear or estimate the exponent. - In Figure 4, the authors claim “It is verified that the naive way has a O(n^4) cost while our … to O(n^3)” but the figure clearly shows that Naive LOOC scales better than n^4 while the prosed is worse than n^3. Can you estimate the exponent of the curves and present them in the paper? - Please list the estimation error in Table 4 to check whether the differences are statistically significant. - Lack of comparison with BWGP The closest method to the BTG is Bayesian WGP. The authors only compare their method with vanilla GP and WGP with MLE but what they really need to compare with is BWGP that also takes a Bayesian approach to estimate the warping parameters. - Not sufficient empirical verification. Many of the conclusions are drawn based on a single (synthetic) example, e.g. the smoothness of the $\phi$ function in Figure 2 to justify the use of quadrature method; bounds speed up in Table 3; comparison of weight concentration in Figure 3. Also there are plenty of benchmarks for function regression, both synthetic and real ML applications. The empirical experiments on the five datasets in Table 4 (2 synthetic and 3 real) is probably not convincing enough. - There are several places that require some rewriting. - The introduction of BTG in section 3 is not clear enough. A simple explanation for “trans-kriging model” would be very helpful to understand how the presentation of BTG here is different from that in Oliveira et al. (1997). - Section 3.1, the notation n, p, and prior of parameters in the marginal probability are used without definition. Is the notation \eta a typo? Statements like “BTG adopts the improper joint prior” and “BTG then adopts a conditional normal-inverse-gamma prior on (\beta, \tau)” are contradicting with each other. - “input-waped” GPs has another meaning in the literature (Snoek et al., 2014) that warps the inputs x while this paper warps the outputs y. - Figure 1 is not a good example to show the benefit of BTG compared to GP as “a fully Bayesian model” vs “its MLE counterpart”. To show the advantage against WGP, I’d expect a comparison with WGP instead of GP. Also, it looks like the length scale of Figure 1 is not well fitted. I guess the GP prediction will be better with a smaller length scale. - In section 2.3 and Table 1, “the Bayesian Warped GP is not a fully Bayesian GP, and instead approximates the posterior distribution using variational inference”. I would not say that BWGP is not fully Bayesian while the proposed method is. Neither computes the exact posterior accurately but takes a different approximation, variational inference vs Monte Carlo. - Conclusion: “we introduced the Bayesian transformed Gaussian (BTG) model”. I would not say so. Refs: Snoek, J., Swersky, K., Zemel, R. and Adams, R., 2014, June. Input warping for Bayesian optimization of non-stationary functions. In International Conference on Machine Learning (pp. 1674-1682). PMLR. Requested Changes: Please refer to Weaknesses section for requested change. The main points: - Comparison with BWGP - Experiments on additional benchmarks. For ablation studies, it’s fine to use one example for demonstration in the main text but it would be very useful to have additional examples in the appendix. For the main results in Table 4, I would expect more test functions. - Rewriting part of the text as pointed out above. Broader Impact Concerns: None. This paper introduces a few techniques to speed up the computation of an existing model. ================================================== Metareview: Recommendation: Accept as is Comment: This submission makes an important contribution to a remarkably flexible model class: the Bayesian transformed Gaussian (BTG) model. Although quite flexible and useful for modeling, the model presents numerous computational challenges in a practical setting. The authors outline best practices for working with this model -- introducing some useful computational "tricks" along the way -- resulting in an effective scheme for working with the BTG model in practice. These algorithmic contributions are coupled with a series of well-designed empirical investigations offering additional insight into the BTG model. I want to commend the authors in particular for their efforts in engaging the reviewers during the discussion period and incorporating numerous edits into their draft accordingly, which I believe strengthened the paper considerably. ==================================================
# Learning Predictive Checklists With Probabilistic Logic Programming Anonymous authors Paper under double-blind review ## Abstract Checklists have been widely recognized as effective tools for completing complex tasks in a systematic manner. Although originally intended for use in procedural tasks, their interpretability and ease of use have led to their adoption for predictive tasks as well, including in clinical settings. However, designing checklists can be challenging, often requiring expert knowledge and manual rule design based on available data. Recent work has attempted to address this issue by using machine learning to automatically generate predictive checklists from data, although these approaches have been limited to Boolean data. We propose a novel method for learning predictive checklists from diverse data modalities, such as images and time series. Our approach relies on probabilistic logic programming, a learning paradigm that enables matching the discrete nature of checklist with continuous-valued data. We propose a regularization technique to tradeoff between the information captured in discrete concepts of continuous data and permit a tunable level of interpretability for the learned checklist concepts. We demonstrate that our method outperforms various explainable machine learning techniques on prediction tasks involving image sequences, medical time series, and clinical notes. ## 1 Introduction In recent years, machine learning models have gained popularity in the healthcare domain due to their impressive performance in various medical tasks, including diagnosis from medical images and early prediction of sepsis from clinical time series, among others (Davenport & Kalakota, 2019; Esteva et al., 2019). Despite the proliferation of these models in the literature, their wide adoption in real-world clinical practice remains challenging (Futoma et al., 2020; Ahmad et al., 2018; Ghassemi et al., 2020; De Brouwer et al., 2022). Ensuring the level of robustness required for healthcare applications is difficult for deep learning models due to their inherent black box nature. Non-interpretable models make stress testing arduous and thus undermine the confidence required to deploy them in critical applications such as clinical practice. To address this issue, recent works have focused on developing novel architectures that are both human-interpretable and retain the high performance of black box models (Ahmad et al., 2018). One such approach is learning medical checklists from available medical records. Due to their simplicity and ability to assist clinicians in complex situations, checklists have become increasingly popular in medical practice (Haynes et al., 2009). However, the simplicity of using checklists typically contrasts with the complexity of their design process. Creating a performant checklist requires domain experts who manually collect evidence about the particular clinical problem of interest, and subsequently reach consensus on meaningful checklist rules (Hales et al., 2008). As the number of available medical records grows, the manual collection of evidence becomes more tedious, bringing the need for partially automated design of medical checklists. Recent works have taken a step in that direction by learning predictive checklists from Boolean, categorical, or continuous tabular data (Zhang et al., 2021; Makhija et al., 2022). Nevertheless, many available clinical data, such as images or time series, are neither categorical nor tabular by nature. They therefore fall outside the limits of applicability of previous approaches for learning checklists from data. This work aims at building checklists based on the presence or absence of concepts learnt from high-dimensional data, thereby addressing this limitation. Prior work leverages integer programming to generate checklists, but the discrete (combinatorial) nature of solving integer programs makes it challenging to learn predictive checklists from images or time series data. Deep learning architectures rely on gradient-based optimization which differs in style and is difficult to reconcile with integer programming (Shvo et al., 2021). We instead propose to formulate predictive checklists within the framework of probabilistic logic programming. This enables extracting binary concepts from highdimensional modalities like images, time series, and text data according to a probabilistic checklist objective, while propagating derivatives throughout the entire neural network architecture. As a proof-of-concept, we show that our architecture can be leveraged to learn a checklist of decision trees operating on concepts learnt from the input data, highlighting the capacity of our approach to handle discrete learning structures. Our architecture, ProbChecklist, operates by learning binary concepts from high-dimensional inputs, which are then used for evaluating the checklist. This is unlike existing approaches that rely on summary statistics of the input data (e.g. mean or standard deviation of time series). Nevertheless, this flexibility also reports parts of the burden of interpretability to the learnt concepts. Indeed, depending on how the concepts are learnt, their meaning can become unclear. We therefore investigate two strategies for providing predictive and interpretable concepts. The first relies on using inherently interpretable concept extractors, which only focus on specific aspects of the input data (Johnson et al., 2022). The second adds regularization penalties to enforce interpretability in the neural network by design. Several regularization terms have been coined to ensure the concepts are unique, generalizable, and correspond to distinctive input features (Jeffares et al., 2023) (Zhang et al., 2018). ![1_image_0.png](1_image_0.png) Clinical practice is a highly stressful environment where complex decisions with far-reaching consequences have to be made quickly. In this context, the simplicity, robustness, and effectiveness of checklists can make a difference (Hales et al., 2007). Furthermore, healthcare datasets contain sensitive patient information, including ethnicity and gender, which should not cause substantial differences in the treatment provided. However, machine learning models trained on clinical data have been shown to exhibit unacceptable imbalance of performance for different population groups, resulting in biased predictions. When allocating scarce medical resources, fairness should be emphasized more than accuracy to avoid targeting minority subgroups (Fawzy et al., 2022). In an attempt to mitigate this problem, we study the impact of including a fairness regularization into our architecture and report significant reductions in the performance gap across sensitive populations. We validate our approach empirically on several classification tasks using various data modalities such as images and clinical time series. We show that ProbChecklist outperforms previous learnable predictive checklist approaches as well as interpretable machine learning baselines. We showcase the capabilities of our method on two healthcare case studies: early prediction of sepsis and mortality in the intensive care unit. Figure 1: Example checklist learnt by our architecture. Three or more checks entail a positive neoplasm prediction. ## Contributions. - We propose the first framework to learn predictive checklists from arbitrary input data modalities. Our approach can learn checklists and extract meaningful concepts from time series and images, among others. In contrast with previous works that used (mixed-)integer programming, our approach formulates the predictive checklist learning within the framework of probabilistic logical programming. This makes ProbChecklist more amenable to modern deep learning optimization methods. - We investigate the impact of different schemes for improving the interpretability of the concepts learnt as the basis of the checklist. We employ regularization techniques to encourage the concepts to be distinct, so they can span the entire input vector and be specialized, i.e. ignore the noise in the signal and learn sparse representations. We also investigate the impact of incorporating fairness constraints into our architecture. - We validate our framework on different data modalities such as images, text and time series, displaying significantly improved performance compared to state-of-the-art checklist learning methods. ## 2 Related Works A major motivation for our work is the ability to learn effective yet interpretable predictive models from data, as exemplified by the interpretable machine learning literature. Conceptually, our method builds upon the recent body of work on learning predictive checklists from data. The implementation of our solution is directly inspired by the literature on probabilistic logic programming. Interpretable machine learning. Motivated by the lack of robustness and trust of black box models, a significant effort has been dedicated to developing more human-interpretable machine learning models in the last years (Ahmad et al., 2018; Murdoch et al., 2019). Among them, one distinguishes between *intrinsic* (*i.e.* when the model is itself interpretable such as decision trees) and posthoc (*i.e.* when trained models are interpreted a posteriori) methods (Du et al., 2019). Checklists belong to the former category as they are an intuitive and easy to use decision support tool. Compared to decision trees, checklists are more concise (there is no branching structure) and can thus be potentially more effective in high stress environments (a more detailed argument is presented in Appendix D). Our approach also relies on building concepts from the input data. Because the concepts are learnt from data, they may themselves lack a clear interpretation. Both intrinsic and posthoc interpretability techniques can then be applied for the concept extraction pipeline (Jeffares et al., 2023). Concept Bottleneck Models (Koh et al., 2020) insert a concept layer before the last fully connected layer, assigning a human-understandable concepts to each neuron. However, a major limitation is that it requires expensive annotated data for predefined concepts. Rule-based learning. Boolean rule mining and decision rule set learning is a well-studied area that has garnered considerable attention spurred by the demand for interpretable models. Some examples of logic-based models include Disjunctive Normal Forms (OR of ANDs), Conjunctive Normal Forms (AND of ORs), chaining of rules in the form of IF-THEN-ELSE conditions in decision lists, and decision tables. Most approaches perform pre-mining of candidate rules and sample rules using integer programs (IP), simulated annealing, performing local search algorithm for optimizing simplicity and accuracy (Lakkaraju et al., 2016), and Bayesian framework for constructing a maximum a posteriori (MAP) solution (Wang et al., 2017). Checklist learning. Checklists, pivotal in clinical decision-making, are typically manually designed by expert clinicians (Haynes et al., 2009). Increasing medical records make manual evidence collection tedious, prompting the need for automated medical checklist design. Recent works have taken a step in that direction by learning predictive checklists from Boolean or categorical medical data (Zhang et al., 2021). Makhija et al. (2022) have extended this approach by allowing for continuous tabular data using mixed integer programming. Our work builds upon these recent advances but allows for complex input data modalities. What is more, in contrast to previous works, our method does not rely on integer programming and thus exhibits much faster computing times and is more amenable to the most recent deep learning stochastic optimization schemes. Probabilistic logical programming. Probabilistic logic reasoning combines logic and probability theory. It represents a refreshing framework from deep learning in the path towards artificial intelligence, focusing on high-level reasoning. Examples of areas relying on these premises include statistical artificial intelligence (Raedt et al., 2016; Koller et al., 2007) and probabilistic logic programming (De Raedt & Kimmig, 2015). More recently, researchers have proposed hybrid architectures, embedding both deep learning and logical reasoning components (Santoro et al., 2017; Rocktäschel & Riedel, 2017; Manhaeve et al., 2018). Probabilistic logic reasoning has been identified as important component for explainable or interpretable machine learning, due to its ability to incorporate knowledge graphs (Arrieta et al., 2020). Combination of deep learning and logic reasoning programming have been implemented in interpretable computer vision tasks, among others (Bennetot et al., 2019; Oldenhof et al., 2023). ## 3 Background Problem statement: We consider a supervised learning problem where we have access to N input data points xi ∈ X and corresponding binary labels yi ∈ {0, 1}. Each input data point consists of a collection of K data modalities: xi = {x 1 i , x 2 i , . . . , x K i }. Each data modality can either be continuous (x k i ∈ R dk ) or binary (x k i ∈ {0, 1} dk ). Categorical data are assumed to be represented in expanded binary format. We set d as the overall dimension of xi. That is, d =PK k=1 dk. The N input data points and labels are aggregated in a data structure X and a vector y respectively. Our objective is to learn an interpretable decision function f : *X → {*0, 1} from some hypothesis class F that minimizes some error criterion d between the predicted and the true label. The optimal function f ∗then is: f ∗ = arg minf∈F Ex,y∼D[d(f(x), y)], where D stands for the observational data distribution. We limit the search space of decision functions F to the set of predictive checklists, which are defined below. Predictive checklists: Generally, we define a predictive checklist as a linear classifier applying on a list of M binary concepts ci ∈ {0, 1}M. A checklist will predict a data point, represented by M concepts ci = {c 1 i , . . . , cM i }, as positive if the number of concepts with c m i = 1 is larger or equal to a threshold T. That is, given a data point with concepts ci, the predicted label of a checklist with threshold T is expressed as: $${\hat{y}}_{i}={\begin{cases}1&{\mathrm{if}}\quad\sum_{m=1}^{M}c_{i}^{m}\geq T\\ 0&{\mathrm{otherwise}}\end{cases}}$$ $$(1)$$ The only parameter of a checklist is the threshold T. Nevertheless, the complexity lies in the definition of the list of concepts that will be given as input to the checklist. This step can be defined as mapping ψ that produces the binary concepts from the input data: ci = ψ(xi). Existing approaches for learning checklists from data differ by their mapping ψ. Zhang et al. (2021) assume that the input data is already binary. In this case, the mapping is a binary matrix ΨM ∈ {0, 1}M×ksuch that ΨM1k = 1k, where 1k is a column vector of ones1. One then computes ci as ci = ΨMxi. The element of ΨM as well as the number of concepts M (hence the dimension of the matrix) are learnable parameters. Previous approaches (Makhija et al., 2022) relax the binary input data assumption by allowing for the creation of binary concepts from continuous data through thresholding. Writing x b i and x c i for the binary and real parts of the input data respectively, the concept creation mechanism transforms the real data to binary with thresholding and then uses the same matrix ΨM. We have ci = ΨM[x b i ,sign(x c i − ti)], where [·, ·] is the concatenation operator, tiis a vector of thresholds, sign(·) is an element-wise function that returns 1 is the element is positive and 0 otherwise. In this formulation one learns the number of concepts M, the binary matrix ΨM as well as the thresholds values ti. Probabilistic logic programming: Probabilistic logical reasoning is a knowledge representation approach that involves the use of probabilities to encode uncertainty in knowledge. This is encoded in a probabilistic logical program (PLP) P connected by a set of N probabilistic facts U = {U1*, ..., U*N } and M logical rules F = {f1*, ...f*M}. PLP enables inference on knowledge graphs P by calculating the probability of a query. This query is executed by summing over the probabilities of different "worlds" w = u1*, ..., u*N (i.e., individual realizations of the set of probabilistic facts) that are compatible with the query q. The probability of a query q in a program P can be inferred as PP (q) = Pw P(w) · I[F(w) ≡ q], where F(w) ≡ q indicates that the propagation of the realization w across the knowledge graph, according to the logical rules F, leads to q being true. The motivation behind using a PLP is to navigate the tradeoff between discrete checklists and learnable soft concepts. Incorporating a neural network into this framework enables the generation of probabilistic facts denoted as the neural predicate U θ, where θ represents the weights. These weights can be trained to minimize a loss that depends on the probability of a query q: ˆθ = arg minθ L(P(q | θ)). 1This corresponds effectively to every row of Ψ summing to 1. ![4_image_0.png](4_image_0.png) ![4_image_1.png](4_image_1.png) Figure 2: **Overview of our proposed ProbChecklist.** Given K data modalities as the input for sample i, we train K concept learners to obtain the vector of probabilistic concepts of each modality p k i ∈ [0, 1]d ′ k . Next, we concatenate into the full concepts probabilities (pi) for sample i. For training the concept learners, we pass pi through the probabilistic logic module. At inference time, we discretize pi through the thresholding parameter τ to obtain binary concepts ci, which are used to construct a complete predictive checklist. ## 4 Probchecklist: Learning Fair And Interpretable Predictive Checklists 4.1 Architecture Overview Our method first applies concept extractors, ψ, on each data modality. Each concept extractor outputs a list of concept probabilities for each data modality. These probabilities are then concatenated to form a vector of probabilistic concepts (pi) for a given data sample. This vector is dispatched to a probabilistic logic module that implements a probabilistic checklist with query q := P(yi = ˆyi). We can then compute the probability of the label of each data sample and backpropagate through the whole architecture. At inference time, the checklist inference engines discretize the probabilistic checklist to provide a complete predictive checklist. A graphical depiction of the overall architecture is given in Figure 2. ## 4.2 Data Modalities And Concepts Data modalities refer to the distinct sets of data that characterize specific facets of a given process. For instance, in the context of healthcare, a patient profile typically includes different clinical time series, FMRI and CT-scan images, as well as prescriptions and treatment details in text format. The division in data modalities is not rigid but reflects some underlying expert knowledge. Concepts are characteristic binary variables that are learnt separately for each modality. ## 4.3 Concept Extractor Instead of directly learning binary concepts, we extract soft concepts that we subsequently discretize. For each of the K data modalities, we have a soft concept extractor ψk : R dk → [0, 1]d ′ k that maps the input data to a vector of probabilities p k i , where d ′ k is the number of soft concepts to be extracted from data modality k. Concatenating the outputs of the K concept extractors results in a vector of probabilities pi ∈ [0, 1]d ′, with the d ′the total number of soft concepts. ## 4.3.1 Interpretability Of The Concept Extractor The concepts extractors ψk are typically implemented with deep neural networks and are therefore not interpretable in general. To address this issue, we propose two mechanisms to improve the interpretability of the learnt concepts: (1) *focused* concept learners and (2) regularization terms that incorporate explainability in the structure of the concept learners. Focused concept extractor Focused models limit the range of features that can contribute to a concept. This increases the interpretability of each concept by explicitly narrowing down the set of features that can contribute to a given concept. Examples of focused models include LSTMs that only take specific features of the time series as input (Johnson et al., 2022), CNNs that only take a specific part of the image as input, or decision trees that only use a subset of the input features. Interpretability regularization Another approach for achieving interpretability is via regularization. For instance, TANGOS favors concepts that are obtained from distinct and sparse subsets of the input vector, avoiding overlap (Jeffares et al., 2023). As in the focused concept extractor, it allows narrowing down the set of input features that can impact a given concept. Sparsity is achieved by taking the L1-norm of the concept gradient attributions with respect to the input vector. Decorrelation between different concepts is achieved by penalizing the inner product of the gradient attributions for all pairs of concepts. More details about TANGOS and its mathematical formulation can be found in Appendix F.1. ## 4.4 Checklist Learning The checklist prediction formula in Equation 1 can be understood as a set of logical rules in a probabilistic logical program. Together with the probabilities of each concepts (*i.e.,* d ′ probabilistic facts encoded in the vector pi) this represents a probabilistic logical program Pθ. We refer to θ as the set of learnable parameters in the probabilistic logical program. We want to maximize the probability of a the prediction being correct. That is, we want to maximize the probability of the query q := ˆyi = yi, $$\hat{\theta}=\operatorname*{arg\,min}_{\theta}-P_{\mathcal{P}_{\theta}}(\hat{y}_{i}=y_{i})=\operatorname*{arg\,min}_{\theta}-\sum_{w}P(w)\cdot\mathbb{I}[F(w)\equiv(\hat{y}_{i}=y_{i})]\tag{2}$$ By interpreting the probabilities pi as the probability that the corresponding binary concepts are equal to 1 (*i.e.* pi[j] = P(ci[j] = 1), where [j] indexes the j-th component of the vector), we can write the probability of query q as follows. Proposition 4.1. The probability of the query yˆi = yi *in the predictive checklist is given by* $$P_{\mathbb{P}_{\theta}}(\hat{y}_{i}=1)=1-P_{\mathbb{P}_{\theta}}(\hat{y}_{i}=0)=\sum_{d=T}^{d^{\prime}}\sum_{\sigma\in\Sigma^{d}}\prod_{j=1}^{d^{\prime}}(\mathbf{p}_{i}[j])^{\sigma(j)}(1-\mathbf{p}_{i}[j])^{1-\sigma(j)}\tag{3}$$ where Σd *is the set of selection functions* σ : [d ′] → {0, 1} *such that* Pd $$\Phi\sum_{j=1}^{d^{\prime}}\sigma(j)=d.$$ The detailed derivations are presented in Appendix A. We use the log-likelihood as the loss function, which leads to our final loss: L = yilog(PPθ (ˆyi = 1)) + (1 − yi) log(PPθ (ˆyi = 0)). The parameters θ, include multiple elements: the parameters of the different soft concept extractors (θψ), the number of concepts to be extracted for each data modality d ′ k , and the checklist threshold T. As the soft concept extractors are typically parameterized by neural networks, optimizing L with respect to θψ can be achieved via gradient based methods. d ′ k and T are constrained to be integers and are thus treated as hyper-parameters in our experiments. ## 4.5 Checklist Inference ProbChecklist relies on soft concepts extraction for each data modality. Yet, at test time, a checklist operates on binary concepts. We thus binarize the predicted soft concepts by setting ci[j] = I[pi[j] > τ ]. The thresholding parameter τ is an hyperparameter that can be tuned based on validation data. After training, we construct the final checklist by pruning the concepts that are never used in the training data (*i.e.* concepts j such that ci[j] = 0, ∀i, are pruned). Tuning τ enables navigating the trade-off between sensitivity and specificity depending on the application. ## 4.6 Fairness Regularization We encourage fairness of the learnt checklists by equalizing the error rate across subgroups of protected variables. This is achieved by penalizing significant differences in False Positive (FPR) and False Negative Rates (FNR) for sensitive subgroups (Pessach & Shmueli, 2022). For a binary classification problem with protected attribute S, predicted labels yˆ ∈ {0, 1}, and actual label y ∈ {0, 1}, we define the differences as follows (Corbett-Davies & Goel, 2018): $$\begin{array}{l l}{{\Delta F P R=\|P({\hat{y}}_{i}=1|y=0,S=s_{i})-P({\hat{y}}_{i}=1|y=0,S=s_{j})\|_{1}}}&{{\forall s_{i},s_{j}\in S}}\\ {{\Delta F N R=\|P({\hat{y}}_{i}=0|y=1,S=s_{i})-P({\hat{y}}_{i}=0|y=1,S=s_{j})\|_{1}}}&{{\forall s_{i},s_{j}\in S}}\end{array}$$ $$\binom{4}{5}$$ and combine these in a fairness regularizer LFair = λ(∆*F P R* + ∆*F NR*). ## 4.7 Learning Checklist Of Decision Trees The probabilistic programming framework enables learning discrete structures, such as checklists, using gradients. Ultimately, it also allows using discrete structures for the concept extractor, such as decision trees, that are more interpretable than deep learning methods. This leads to a combined architecture: a checklist of decision trees. A decision tree can be represented as a logical rule. Each node is assigned a learnt concept and branches depending on whether that concept is true or false. For a tree with L layers, we write ci[*j, k*] for the learnt concept assigned to the node at layer j and position k, for data sample i. If ci[*j, k*] = 1, the node branches to node [j + 1, 2k] and to [j + 1, 1 + (k − 1) ∗ 2] otherwise. For a tree with L = 2 layers, the probability that the output of the decision tree is positive can be written as: $${\mathcal{P}}_{\mathrm{tree}}=(1-\mathbf{p}_{i}[1,1])(\mathbf{p}_{i}[2,1])+\mathbf{p}_{i}[1,1](\mathbf{p}_{i}[2,4]),$$ $$(6)$$ Ptree = (1 − pi[1, 1])(pi[2, 1]) + pi[1, 1](pi[2, 4]), (6) where pi[*j, k*] = P(ci[*j, k*] = 1). This logical rule can then be combined with a checklist to form a checklist of decision trees, where the output of each tree is used as a concept in the checklist. However, the concepts used in the decision rules of the decision trees (ci) still have to be learned from the data (through concepts extractors ψ). Simple concept extractors (*e.g.,* sigmoid function on the input data), or more complex (*e.g.,* CNN, LSTMs) can be used to balance the trade-off between interpretability and expressivity. This is in contrast with classical decision tress that can only operate on the original representation of the data (*e.g.,* a classical decision tree on an image would result in pixel-wise rules, which are likely ineffective). While the probabilistic program given above is sufficient for learning decision trees, it falls short of enforcing certain desirable tree characteristics, such as being a *balanced tree*. Indeed, balanced trees are favored for their ability to provide a faithful representation of data, fostering diversity and interpretability of the learned concepts ci. We thus propose three regularization terms designed to facilitate the learning of balanced trees. These terms are grounded in the simple intuition that balanced trees contain distinct concepts at each node and these concepts split the samples evenly, thereby maximizing entropy. Theses regularizations are exposed in detail in Appendix K. Lastly, we note that checklists of trees include simple decision trees. Indeed, a checklist of trees with a single tree, leading to a checklist with a single concept and M = 1, is equivalent to a simple decision tree. ## 5 Experiments We investigate the performance of ProbChecklist along multiple axes. We first compare the classification performance against a range of interpretable machine learning baselines. Second, we show how we can tune the interpretability of the learnt concepts and how we can enforce fairness constraints into ProbChecklist. Lastly, we demonstrate how our approach can be used to learn a checklist of decision tress. Complete details about the datasets, baselines used in our experiments, and hyperparameter tuning are available in Appendix E and C. Baselines. We compare our method against the following baselines. Mixed Integer Programming (MIP)(Makhija et al., 2022). This approach allows to learn predictive checklists from continuous inputs. For images or time series, we typically apply MIP on top of an embedding obtained from a pre-trained deep learning model. Integer Linear Program (ILP)(Zhang et al., 2021). ILP learns predictive checklists with Boolean inputs. We apply these to tabular data by categorizing the data using feature means as threshold. CNN/LSTM/BERT + Logistic Regression (LR). This consists in using a CNN, LSTM or BERT on the input data followed by logistic regression on the combination of the last layer's embeddings of each modality. CNN/LSTM/BERT + Multilayer perceptron (MLP). This is similar to the previous approach but where we apply an MLP on the combination of the last layer's embeddings of each modality. Datasets. A crucial strength of our method resides in its ability to learn predictive from high dimensional input data. We briefly describe the MNIST synthetic dataset created here and defer the descriptions of other datasets (PhysioNet sepsis tabular dataset, MIMIC mortality time series dataset, Medical Abstracts TC Corpus for Neoplasm Detection) to the Appendix E.3 Synthetic MNIST checklist. Due to the absence of real-world datasets with ground-truth checklists, we first validate our idea on a synthetic setup created using MNIST image sequences as input and a checklist defined on digit labels. Each sample consists of a sequence of K = 4 MNIST images (treating each image as a separate modality). We then assign a label to *each samples* according to the following ground-truth checklist. (i) Digit of **Image 1** ∈ {0, 2, 4, 6, 8}, (ii) **Image 2** ∈ {1, 3, 5, 7, 9}, (iii) **Image 3** ∈ {4, 5, 6}, (iv) **Image 4** ∈ {6, 7, 8, 9}. If at least 3 of the rules are satisfied, the label is 1, and 0 otherwise. PhysioNet sepsis tabular dataset. We use the PhysioNet 2019 Early Sepsis Prediction time series dataset (Reyna et al., 2019). We transformed this dataset into tabular data by using basic summary extraction functions such as the mean, standard deviation, and last entry of the clinical time series of each patient. MIMIC mortality dataset. We use the the clinical timseries data from the MIMIC III Clinical Database Johnson et al. (2016) to perform mortality prediction on the data collected at the ICU. We use hourly data of vital signs and laboratory test collected over twenty-four hours. Medical Abstracts TC Corpus. We work with the clinical notes dataset designed for multi-class disease classification (Schopf et al., 2023). However, we only focus on neoplasm detection. We use medical abstracts which describe the conditions of patients. Each note is 5-7 sentences long on average. ## 5.1 Checklist Performance We evaluate the classification performance of the different models according to accuracy, precision, recall and specificity. For the checklist baselines, we also report the total number of concepts used (M) and the threshold for calling a positive sample (T). Results are presented in table 1. Additional results and details about hyperparameter tuning are provided in Appendix E and C. **MNIST checklist** dataset. We used a simple three-layered CNN model as the concept learner for each image. In Table 1, we report the results of the baselines and ProbChecklist for d ′ k = 4 (M = 16) on the test samples. Our method outperforms all the baselines, in terms of accuracy and recall, indicating that it identifies the minority class better than these standard approaches. The MIP failed to find solutions for some folds of the dataset and didn't generalise well on the test samples. Sepsis prediction from PhysioNet tabular data. This setup is ideal for comparison with existing checklist method as they only operate on tabular dataset. In Figure 3, we visualize the checklist Figure 3: Learnt checklist for PhysioNet Sepsis Prediction Task (Tabular). We report the performance result as accuracy (65.69%), precision (0.527), recall (0.755), and specificity (0.6). | Dataset | Model | Accuracy | Precision | Recall | Specificity | d ′ k | T | M | |-------------------------------------|-----------------------|----------------|----------------|-----------------|-----------------|-------------|------------|-----| | CNN + MLP# | 94.72 ± 4.32 | 0.895 ± 0.1 | 0.835 ± 0.13 | 0.976 ± 0.02 | 4 | - | - | | | CNN + LR# | 95.04 ± 0.31 | 0.914 ± 0.01 | 0.836 ± 0.016 | 0.98 ± 0.003 | - | - | | | | MNIST Checklist | pretrained CNN + MIP∗ | 79.56 | 0 | 0 | 1 | 8 | 13.5 ± 0.5 | | | ProbChecklist | 96.808 ± 0.24 | 0.917 ± 0.015 | 0.929 ± 0.01 | 0.978 ± 0.004 | 4 | 8.4 ± 1.2 | 16 | | | PhysioNet Tabular | Logistic Regression# | 62.555 ± 1.648 | 0.624 ± 0.0461 | 0.144 ± 0.0393 | 0.9395 ± 0.0283 | - | - | | | Unit Weighting∗ | 58.278 ± 3.580 | 0.521 ± 0.093 | 0.4386 ± 0.297 | 0.6861 ± 0.251 | 3.2 ± 1.16 | 9.6 ± 0.8 | | | | | | 1 | | | | | | | | ILP mean thresholds∗ | 62.992 ± 0.82 | 0.544 ± 0.087 | 0.1196 ± 0.096 | 0.9326 ± 0.0623 | 2.8 ± 0.748 | 4.4 ± 1.01 | | | | MIP Checklist∗ | 63.688 ± 2.437 | 0.563 ± 0.050 | 0.403 ± 0.082 | 0.7918 ± 0.06 | 3.6 ± 0.8 | 8 ± 1.095 | | | | ProbChecklist | 62.579 ± 2.58 | 0.61 ± 0.076 | 0.345 ± 0.316 | 0.815 ± 0.185S | 1 | 3.6 ± 1.2 | 10 | | | Unit Weighting∗ | 73.681 ± 0.972 | 0.469 ± 0.091 | 0.223 ± 0.206 | 0.889 ± 0.026 | 1 | | | | | MIMIC III | | 6.1 ± 0.830 | 8.9 ± 0.627 | | | | | | | ILP mean thresholds∗ | 75.492 ± 0.318 | 0.545 ± 0.028 | 0.142 ± 0.059 | 0.959 ± 0.019 | 3.6 ± 0.894 | 3.6 ± 0.894 | | | | MIP Checklist∗ | 74.988 ± 0.025 | 0.232 ± 0.288 | 0.014 ± 0.017 | 0.997 ± 0.004 | 4.5 ± 2.082 | 4.5 ± 2.082 | | | | LSTM + LR# | 66.585 ± 2.19 | 0.403 ± 0.02 | 0.684 ± 0.039 | 0.66 ± 0.034 | - | - | | | | LSTM + MLP# | 76.128 ± 0.737 | 0.446 ± 0.223 | 0.23 ± 0.132 | 0.939 ± 0.036 | - | - | | | | LSTM + MLP# (all features) | 80.04 ± 0.598 | 0.328 ± 0.266 | 0.129 ± 0.131 | 0.962 ± 0.043 | - | - | | | | ProbChecklist | 77.58 ± 0.481 | 0.642 ± 0.075 | 0.247 ± 0.032 | 0.953 ± 0.019 | 2 | 9.6 | 20 | | | BERT + ILP∗ | 72.991 ± 8.06 | 0.292 ± 0.29 | 0.197 ± 0.26 | 0.879 ± 0.17 | 1.2 ± 0.4 | 1.2 ± 0.4 | | | | BERT + MIP∗ | 69.32 ± 8.1 | 0.583 ± 0.14 | 0.059 ± 0.08 | 0.991 ± 0.09 | 2.5 ± 0.6 | 4 ± 0.8 | | | | | | 6 | | | | | | | | Medical Abstracts Corpus BERT + LR# | 80.193 ± 0.88 | 0.790 ± 0.051 | 0.138 ± 0.065 | 0.988 ± 0.007 | - | - | | | | BERT + MLP# | 81.782 ± 0.31 | 0.941 ± 0.04 | 0.07 ± 0.009 | 0.961 ± 0.01 | - | - | | | | ProbChecklist | 83.213 ± 0.23 | 0.616 ± 0.006 | 0.623 ± 0.01 | 0.891 ± 0.003 | 6 | 3 | 6 | | Table 1: Performance results for all the models and baselines on all the datasets. We report accuracy, precision, recall as well as conciseness of the learnt checklist. We conduct a comparative analysis of ProbChecklist's performance across various metrics, acknowledging that primary metrics are often task-specific. This aspect broadens the potential applications of our method. To facilitate visualization and comparison, we plot these results in Section I of the Appendix (Figure 14). To aid the readers, we mark the non-interpretable baseline with \# and existing checklist learning methods that operate only on tabular datasets with *. learnt by ProbChecklist in one of the experiments. We observe that ProbChecklist exhibits similar performance to checklist baselines. Neoplasm detection from Medical Abstracts TC Corpus. We use a BERT model pretrained on MIMIC-III clinical notes (BioBERT) (Alsentzer et al., 2019) with frozen weights as our concept learner. We treat the entire paragraph as a single modality and feed it into BERT to obtain an M-dimensional embedding which represent soft concepts. Our checklist has a much better recall and accuracy than previous methods. Both checklist learning and deep learning methods give poor performance on the minority class. Mortality prediction using MIMIC mortality time series data. To learn concepts from clinical timeseries, we initialize K two-layered LSTMs to serve as the concept learners. We highlight our key results in Table 1. We surpass existing methods in terms of accuracy and precision with a significant margin. We find that a checklist with better recall can be constructed by optimizing over F1-Score instead of accuracy. Sensitivity analysis. We investigate the evolution of performance of ProbChecklist with increasing number of learnt concepts d ′ k . On Figure 4a, we show the accuracy, precision, recall, and specificity in function of the number of concepts per image on the MNIST dataset. We observe a significant improvement in performance when d ′ k increases from 1 to 2, and saturates after d ′ k = 3. This suggests that having learning one concept per image is inadequate to capture all the signal in the sample and that d ′ k is an important hyperparameter. We provide results for the sensitivity analysis on the other datasets in Appendix E.6 and additional details on hyperparameter tuning in Appendix C. ## 5.2 Concepts Interpretation ProbChecklist learns interpretable concepts for tabular data by learning thresholds to binarize continuous features. However, interpreting the learnt concepts for complex modalities such as time series, images, and text is significantly more challenging. We investigate the concepts learnt from image and time series datasets with an interpretability regularization as described in Section 4.3.1. To gain insight into what patterns of signals refer to each individual concept, we examine the gradient of each concept with respect to each dimension of the input signal. Intuitively, the interpretability regularization enforces the concepts to focus on a sparse set of features of the input data. ![9_image_1.png](9_image_1.png) Sensitivity Analysis for MNIST Checklist (a) Performance of ProbChecklist with varying d ′ k on MNIST Checklist Dataset (b) We plot images and corresponding gradient attributions ![9_image_0.png](9_image_0.png) heat maps for seven inputs samples of the Image 2 modality of the MNIST dataset. We used a checklist with two learnable concepts per image. The intensity of red denotes the positive contribution of each pixel, whereas blue indicates the negative. If a concept predicted as true for an image, then we represent that with plus (+) sign, and with a negative sign (-) otherwise. Figure 4: Results of ProbChecklist on MNIST Checklist Dataset: (a) Sensitivity Analysis (b) Interpretation of the concepts learnt. MNIST images. We analyze the gradient of our checklist on individual pixels of the input images. We use a checklist with two concepts per image. On Figure 4b, we show example images of the *Image 2* of the MNIST dataset along with the gradient heat map for each learnt concept of the checklist. The ground truth concept for this image is **Image 2** ∈ {1, 3, 5, 7, 9}. First, we see that the 7, 9, and 5 digits are indeed the only ones for which the predicted concepts of our checklist are positive. Second, we infer from the gradient heat maps that concepts 1 and 2 focus on the image's upper half and centre region, respectively. Concept 1 is true for digits 5, 8, 9 and 7, indicating that it corresponds to a horizontal line or slight curvature in the upper half. Since Digits 0 and 2 have deeper curvature than the other images, and there is no activity in that region in the case of 4, concept 1 is false for them. concept 2 is true for images with a vertical line, including digits 9, 4, 5 and 7. Therefore, concept 2 is false for the remaining digits (0, 2, 8). The checklist outcome matches the ground truth when both concepts are true for a given image. Complementary analyses on MNIST images and MIMIC III time series is provided in Appendix F.3 and F.4. This analysis ensures interpretability at the individual sample level. As illustrated in the previous example, recognizing and comprehending these concepts at the dataset level relies on visual inspection. Neoplasm detection from medical abstracts. Compared to images and time series, interpreting concepts learned from textual data is easier because its building blocks are tokens which are already human understandable. For the Neoplasm detection task, we adopt an alternative method by conducting a token frequency analysis across the entire dataset. This approach has yielded a more lucid checklist shown in Figure 1. We identified key tokens associated with positive and negative concepts (positive and negative tokens). Each concept is defined by the presence of positive words and the absence of negative words. ## 5.3 Fairness We evaluate the fairness of ProbChecklist on the MIMIC-III Mortality Prediction task and show that we can reduce the performance disparities between sensitive attributes by incorporating fairness regularization (FR) terms, as introduced in Section 4.6. We set the sensitive features as gender ∈ {*M ale, F emale*} and ethnicity ∈ {*Black, W hite, Others*}. Our results are displayed on Tables 5 and 10. These disparities in performance across different sub-populations are significantly reduced after fairness regularization is used. To see the effectiveness of the regularizer, we report the percentage decrease in ∆FNR and ∆FPR observed with respect to the unregularized checklist predictions for all pairs of sensitive subgroups. Similar fairness constraints (FC) can also be added to the ILP mean-thresholds baseline (Jin et al., 2022). We include a separate constraint for each pair that restricts |∆FNR| and |∆FPR| to be less than ϵ = 0.05. It is important to note that our approach minimizes the summation of ∆FNR and ∆FPR across all pairs of subgroups, but in the ILP we can specify a strict upper bound for each pair. Due to this, we might observe an increase in the gap for certain pairs in case of ProbChecklist, but adjusting the relative weights of these terms in the loss equation helps in achieving optimal performance. Although ProbChecklist had higher initial FNR/FPR values, the regularizer effectively reduces them to be comparable to those of ILP, particularly for the ethnicity pairs. ## 5.4 Checklist Of Trees | Method | Female-Male | White-Black | Black-Others | White-Others | | | | | | |-----------------------------------------|---------------|---------------|----------------|----------------|--------|--------|--------|--------|--------| | ∆FNR ∆FPR ∆FNR ∆FPR ∆FNR ∆FPR ∆FNR ∆FPR | | | | | | | | | | | w/o FC | 0.038 | 0.011 | 0.029 | 0.026 | 0.152 | 0.018 | 0.182 | 0.045 | | | ILP mean thresholds | FC | 0.011 | 0.001 | 0.031 | 0.008 | 0.049 | 0.016 | 0.017 | 0.0007 | | % ↓ | 71.053 | 90.909 | -6.897 | 69.231 | 67.763 | 11.111 | 90.659 | 98.444 | | | ProbChecklist | w/o FR | 0.127 | 0.311 | 0.04 | 0.22 | 0.02 | 0.273 | 0.02 | 0.053 | | FR | 0.103 | 0.089 | 0.028 | 0.016 | 0.021 | 0.008 | 0.006 | 0.008 | | | % ↓ | 18.898 | 71.383 | 30.000 | 92.727 | -5.000 | 97.033 | 70.000 | 85.660 | | Figure 5: Improvement in fairness metrics across gender and ethnicity on MIMIC III for the mortality prediction task after adding fairness regularization. We report ∆FNR and ∆FPR for all pairs of subgroups of sensitive features and the percentage decrease (% ↓) wrt unregularized checklist. In this section, we demonstrate the flexibility of our ProbChecklist approach for learning other interpretable forms of logical decision rules and show that we can learn checklists of decision trees, where each concept is given by a decision tree. We first demonstrate that our approach can be used to learn a single decision tree and then show an example with a checklist that comprises three decision trees. ## 5.4.1 Learning A Simple Decision Tree To illustrate the ability of our method to learn a simple decision tree, we created a dataset where the input consists of two digits, D1 and D2, both between 0 and 9, and generated a label according to the decision tree shown in Figure 6. We used soft concept extractors of the form ψ(x) = σ(β T x), with β a learnable vector with same dimension than x, and σ(·) the sigmoid function. We note that because the first rule checks if D1 is even, there is no decision tree with the same number of layers that can achieve 100% accuracy on this data. We performed a simple train, validation, test split and report our results on the test set. Figure 6 shows the ground truth tree along with the learnt decision trees (with and without balanced tree regularization). We observe that the simple ProbChecklist strategy result in a reasonable predictive performance but also note the significant added value of the balanced tree regularization, which greatly improve the performance of the learnt tree. ## 5.4.2 Learning Checklists Of Trees Lastly, we integrate the decision trees into the ProbChecklist framework to construct a checklist composed of trees, i.e. each concept in the checklist is the output of a decision tree. The checklist is composed of a total of T trees, with τ the checklist thresholding parameter. We generated a synthetic dataset by using three identical decision trees with L = 3 layers, as shown in Figure 7. Each data sample comprises three digits (D1, D2, D3), between 0 and 9. Each decision tree operates on a single digit. For each sample, a label was created by combining the outcomes of all decision trees, and checking whether it exceeds T = 2. We used the same concept extractors as in the simple decision tree experiment. The learnt checklist of decision trees is shown in Figure 7, which achieves a classification performance of 0.65 AUC-ROC on the test split. It is important to note that this task is considerably more challenging than learning checklists with binary concepts or a single decision tree. In this experiment, our aim is to identify the concepts at each node of all the trees in the checklist using only the checklist outcome as the training signal. This constitutes a significantly weaker training signal compared to the previous experiments on a single decision tree. ## 6 Discussion Performance of ProbChecklist. Through these experiments, we aim to showcase that ProbChecklist surpasses existing checklist methods and achieves comparable performance to MLP (non-interpretable) methods. The switch to learnable concepts explains the improvement in accuracy over checklist methods. These concepts capture more signal than fixed summary/concept extractors used in prior works to create binarized tabular data. It's important to note that a checklist, due to its binary weights, has a strictly lower capacity and is less expressive than deep learning but possesses a more practical and interpretable structure. Despite this, it exhibits similar performance to an MLP. We also want to emphasize that ProbChecklist provides a significantly broader applicability to multimodal datasets while maintaining performance comparable to checklist baselines on tabular datasets. Figure 6: We illustrate both the ground truth decision tree and ![11_image_0.png](11_image_0.png) ![11_image_1.png](11_image_1.png) the learnt decision trees. The balanced tree was obtained after applying the proposed regularization scheme. Figure 7: We illustrate both the true checklist with M = 3, T= 2 and the predicted checklist for the checklist of tree experiment. The resulting checklist had an AUC-ROC of 0.65 Interpretability of checklist structure and learnt concepts. Although ProbChecklist employs a probabilistic objective for training the concept learners, the end classifier used for inference is, in fact, a discrete checklist. While this makes the classifier highly interpretable, it also shifts the focus of interpretability to the learnt concepts. We fully realize this trade-off and investigate existing techniques to maintain feature-space interpretability. For tabular datasets, ProbChecklist learns thresholds to binarize continuous features to give interpretable concepts. For time series and images, our initial results highlighted that the gradient attributions for different concepts learnt from one modality were very similar. We employ regularization terms (4.3) to enforce sparsity, avoid redundancy, and learn strongly discriminative features with high probability. We also use focused concept learners to avoid learning concepts that are functions of multiple modalities. Identifying patterns from the binarized concepts is primarily based on visual inspection and expert knowledge. Compared to images and time series, interpreting concepts from textual data is easier because text is constructed from tokens that are understandable to us. Therefore, for the medical abstract neoplasm classification task, we identify the key tokens contributing to each concept. Lastly, it's important to note that ProbChecklist is a flexible framework, and other interpretable models can be easily incorporated as concept learners. We offer a more in-depth discussion on the interpretability of concepts for each modality in Appendix F.2. Extensions of ProbChecklist. The probabilistic programming framework offers remarkable flexibility, allowing for modifications to the logical rule to accommodate various discrete structures. In our experiments, we explore decision tree learning and introduce a checklist of decision trees. Additionally, we extend our approach to learning checklists with learnable integer weights (see Appendix H). With this extension, we can assign a weight to each item, indicating its relative importance. Limitations. We have taken the first step towards learning checklists from complex modalities, whereas the existing methods are restricted to tabular data. Even though we have a mechanism to learn interpretable checklist classifiers using logical reasoning, more work is needed on the interpretability of the learnt concepts. Another drawback is the exponential memory complexity of the training. A fruitful future direction would be to study approximations to explore a smaller set of combinations of concepts. Detailed complexity analysis can be found in Appendix B. ## References Muhammad Aurangzeb Ahmad, Carly Eckert, and Ankur Teredesai. Interpretable machine learning in healthcare. In *Proceedings of the 2018 ACM international conference on bioinformatics, computational* biology, and health informatics, pp. 559–560, 2018. Emily Alsentzer, John Murphy, William Boag, Wei-Hung Weng, Di Jin, Tristan Naumann, and Matthew McDermott. Publicly available clinical BERT embeddings. In Proceedings of the 2nd Clinical Natural Language Processing Workshop, pp. 72–78, Minneapolis, Minnesota, USA, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-1909. URL https://www.aclweb.org/anthology/ W19-1909. Alejandro Barredo Arrieta, Natalia Díaz-Rodríguez, Javier Del Ser, Adrien Bennetot, Siham Tabik, Alberto Barbado, Salvador García, Sergio Gil-López, Daniel Molina, Richard Benjamins, et al. Explainable artificial intelligence (xai): Concepts, taxonomies, opportunities and challenges toward responsible ai. Information fusion, 58:82–115, 2020. Adrien Bennetot, Jean-Luc Laurent, Raja Chatila, and Natalia Díaz-Rodríguez. Towards explainable neural-symbolic visual reasoning. *arXiv preprint arXiv:1909.09065*, 2019. Sam Corbett-Davies and Sharad Goel. The measure and mismeasure of fairness: A critical review of fair machine learning, 2018. Thomas Davenport and Ravi Kalakota. The potential for artificial intelligence in healthcare. *Future healthcare* journal, 6(2):94, 2019. Edward De Brouwer, Javier Gonzalez, and Stephanie Hyland. Predicting the impact of treatments over time with uncertainty aware neural differential equations. In *International Conference on Artificial Intelligence* and Statistics, pp. 4705–4722. PMLR, 2022. Luc De Raedt and Angelika Kimmig. Probabilistic (logic) programming concepts. *Machine Learning*, 100(1): 5–47, 2015. Mengnan Du, Ninghao Liu, and Xia Hu. Techniques for interpretable machine learning. Communications of the ACM, 63(1):68–77, 2019. Andre Esteva, Alexandre Robicquet, Bharath Ramsundar, Volodymyr Kuleshov, Mark DePristo, Katherine Chou, Claire Cui, Greg Corrado, Sebastian Thrun, and Jeff Dean. A guide to deep learning in healthcare. Nature medicine, 25(1):24–29, 2019. Ashraf Fawzy, Tianshi David Wu, Kunbo Wang, Matthew L. Robinson, Jad Farha, Amanda Bradke, Sherita H. Golden, Yanxun Xu, and Brian T. Garibaldi. Racial and Ethnic Discrepancy in Pulse Oximetry and Delayed Identification of Treatment Eligibility Among Patients With COVID-19. *JAMA Internal* Medicine, 182(7):730–738, 07 2022. ISSN 2168-6106. doi: 10.1001/jamainternmed.2022.1906. URL https://doi.org/10.1001/jamainternmed.2022.1906. Joseph Futoma, Morgan Simons, Trishan Panch, Finale Doshi-Velez, and Leo Anthony Celi. The myth of generalisability in clinical research and machine learning in health care. *The Lancet Digital Health*, 2(9): e489–e492, 2020. Marzyeh Ghassemi, Tristan Naumann, Peter Schulam, Andrew L Beam, Irene Y Chen, and Rajesh Ranganath. A review of challenges and opportunities in machine learning for health. AMIA Summits on Translational Science Proceedings, 2020:191, 2020. Brigette Hales, Marius Terblanche, Robert Fowler, and William Sibbald. Development of medical checklists for improved quality of patient care. *International Journal for Quality in Health Care*, 20(1):22–30, 12 2007. ISSN 1353-4505. doi: 10.1093/intqhc/mzm062. URL https://doi.org/10.1093/intqhc/mzm062. Brigette Hales, Marius Terblanche, Robert Fowler, and William Sibbald. Development of medical checklists for improved quality of patient care. *International Journal for Quality in Health Care*, 20(1):22–30, 2008. Alex B Haynes, Thomas G Weiser, William R Berry, Stuart R Lipsitz, Abdel-Hadi S Breizat, E Patchen Dellinger, Teodoro Herbosa, Sudhir Joseph, Pascience L Kibatala, Marie Carmela M Lapitan, et al. A surgical safety checklist to reduce morbidity and mortality in a global population. New England journal of medicine, 360(5):491–499, 2009. Alan Jeffares, Tennison Liu, Jonathan Crabbé, Fergus Imrie, and Mihaela van der Schaar. TANGOS: Regularizing tabular neural networks through gradient orthogonalization and specialization. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/ forum?id=n6H86gW8u0d. Qixuan Jin, Haoran Zhang, Thomas Hartvigsen, and Marzyeh Ghassemi. Fair multimodal checklists for interpretable clinical time series prediction. In NeurIPS 2022 Workshop on Learning from Time Series for Health, 2022. URL https://openreview.net/forum?id=y4mt_fTy6MY. Alistair E.W. Johnson, Tom J. Pollard, Lu Shen, Li-wei H. Lehman, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G. Mark. Mimic-iii, a freely accessible critical care database. *Scientific Data*, 3(1), 2016. doi: 10.1038/sdata.2016.35. Nari Johnson, Sonali Parbhoo, Andrew Ross, and Finale Doshi velez. Learning predictive and interpretable timeseries summaries from icu data. *AMIA ... Annual Symposium proceedings. AMIA Symposium*, 2021: 581–590, 02 2022. Pang Wei Koh, Thao Nguyen, Yew Siang Tang, Stephen Mussmann, Emma Pierson, Been Kim, and Percy Liang. Concept bottleneck models. 2020. Daphne Koller, Nir Friedman, Sašo Džeroski, Charles Sutton, Andrew McCallum, Avi Pfeffer, Pieter Abbeel, Ming-Fai Wong, Chris Meek, Jennifer Neville, et al. *Introduction to statistical relational learning*. MIT press, 2007. Himabindu Lakkaraju, Stephen H. Bach, and Jure Leskovec. Interpretable decision sets: A joint framework for description and prediction. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '16, pp. 1675–1684, New York, NY, USA, 2016. Association for Computing Machinery. ISBN 9781450342322. doi: 10.1145/2939672.2939874. URL https://doi.org/ 10.1145/2939672.2939874. Yukti Makhija, Edward De Brouwer, and Rahul G Krishnan. Learning predictive checklists from continuous medical data. *arXiv preprint arXiv:2211.07076*, 2022. Robin Manhaeve, Sebastijan Dumancic, Angelika Kimmig, Thomas Demeester, and Luc De Raedt. Deepproblog: Neural probabilistic logic programming. *Advances in Neural Information Processing Systems*, 31, 2018. W James Murdoch, Chandan Singh, Karl Kumbier, Reza Abbasi-Asl, and Bin Yu. Definitions, methods, and applications in interpretable machine learning. *Proceedings of the National Academy of Sciences*, 116(44): 22071–22080, 2019. Martijn Oldenhof, Ádám Arany, Yves Moreau, and Edward De Brouwer. Weakly supervised knowledge transfer with probabilistic logical reasoning for o-object detection. *International Conference on Learning* Representations (ICLR), 2023. Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, highperformance deep learning library. In *Advances in Neural Information Processing Systems* 32, pp. 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf. Dana Pessach and Erez Shmueli. A review on fairness in machine learning. *ACM Comput. Surv.*, 55(3), feb 2022. ISSN 0360-0300. doi: 10.1145/3494672. URL https://doi.org/10.1145/3494672. Luc De Raedt, Kristian Kersting, Sriraam Natarajan, and David Poole. Statistical relational artificial intelligence: Logic, probability, and computation. Synthesis lectures on artificial intelligence and machine learning, 10(2):1–189, 2016. Matthew A Reyna, Chris Josef, Salman Seyedi, Russell Jeter, Supreeth P Shashikumar, M Brandon Westover, Ashish Sharma, Shamim Nemati, and Gari D Clifford. Early prediction of sepsis from clinical data: the physionet/computing in cardiology challenge 2019. In *2019 Computing in Cardiology (CinC)*, pp. Page–1. IEEE, 2019. Tim Rocktäschel and Sebastian Riedel. End-to-end differentiable proving. Advances in neural information processing systems, 30, 2017. Adam Santoro, David Raposo, David G Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. *Advances in neural* information processing systems, 30, 2017. Tim Schopf, Daniel Braun, and Florian Matthes. Evaluating unsupervised text classification: Zero-shot and similarity-based approaches. In *Proceedings of the 2022 6th International Conference on Natural Language* Processing and Information Retrieval, NLPIR '22, pp. 6–15, New York, NY, USA, 2023. Association for Computing Machinery. ISBN 9781450397629. doi: 10.1145/3582768.3582795. URL https://doi.org/10. 1145/3582768.3582795. Maayan Shvo, Andrew C. Li, Rodrigo Toro Icarte, and Sheila A. McIlraith. Interpretable sequence classification via discrete optimization. In *Proceedings of the 35th AAAI Conference on Artificial Intelligence (AAAI)*, 2021. URL https://ojs.aaai.org/index.php/AAAI/article/view/17161. Shirly Wang, Matthew BA McDermott, Geeticka Chauhan, Marzyeh Ghassemi, Michael C Hughes, and Tristan Naumann. Mimic-extract: A data extraction, preprocessing, and representation pipeline for mimic-iii. In *Proceedings of the ACM Conference on Health, Inference, and Learning*, pp. 222–235, 2020. Tong Wang, Cynthia Rudin, Finale Doshi-Velez, Yimin Liu, Erica Klampfl, and Perry MacNeille. A bayesian framework for learning rule sets for interpretable classification. *Journal of Machine Learning Research*, 18 (70):1–37, 2017. URL http://jmlr.org/papers/v18/16-003.html. Haoran Zhang, Quaid Morris, Berk Ustun, and Marzyeh Ghassemi. Learning optimal predictive checklists. Advances in Neural Information Processing Systems, 34:1215–1229, 2021. Quanshi Zhang, Ying Nian Wu, and Song-Chun Zhu. Interpretable convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. ## Appendix A Derivations for the loss function 17 B Complexity Analysis 17 C Hyperparameter Tuning 17 D Conciseness of checklists over decision trees 18 | E | Experiment Details | 18 | | |-------------------------------|-------------------------------------------------------|------|----| | E.1 | Baselines | | 18 | | E.2 | Reasons for creating MNIST synthetic Dataset | | 19 | | E.3 | Datasets | 19 | | | E.4 | Sepsis Prediction using Static Tabular Data | 20 | | | E.5 | Sepsis Prediction using time series data | | 21 | | E.6 | Sensitivity Analysis | 21 | | | E.7 | Checklist Optimization | 22 | | | E.8 | Impact of the binarization scheme | | 22 | | F | Concepts Interpretation | 23 | | | F.1 | TANGOS Regularization | 23 | | | F.2 | Discussion on the Interpretability of learnt concepts | | 24 | | F.3 | MNIST Images | | 24 | | F.4 | MIMIC Time Series | | 25 | | F.5 | Medical Abstracts Corpus | 27 | | | G Additional Fairness Results | 27 | | | H Extension of ProbChecklist: Checklists with learnable integer weights 27 I Plot: Performance Results of ProbChecklist 29 J Implementation 29 K Checklists of decision trees 29 K.1 Trees as logical decision rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 K.2 Learning balanced trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 ## A Derivations For The Loss Function Given the individual probabilities of each concept j being positive, pi[j], the probability that the checklist outputs exactly d positive concepts for sample i is given by the binomial distribution: $$P_{{\mathcal{P}}_{\theta}}(\#{\mathrm{~true~concepts}}=d)=\sum_{\sigma\in\Sigma^{d}}\prod_{j=1}^{d^{\prime}}({\mathbf{p}}_{i}[j])^{\sigma(j)}(1-{\mathbf{p}}_{i}[j])^{1-\sigma(j)},$$ where Σd is the set of selection functions σ : [d ′] → {0, 1} such that Pd ′ j=1 σ(j) = d. The probability that the checklist gives a positive prediction is the probability that the number of positive concepts is larger than T, we thus have $$P_{{\mathcal{P}}_{\theta}}({\hat{y}}_{i}=1)=\sum_{d=T}^{d^{\prime}}\sum_{\sigma\in\Sigma^{d}}\prod_{j=1}^{d^{\prime}}({\mathbf{p}}_{i}[j])^{\sigma(j)}(1-{\mathbf{p}}_{i}[j])^{1-\sigma(j)}.$$ ## B Complexity Analysis Let d be the number of positive concepts for sample i. Probabilistic Checklist Objective is defined as P(d ≥ T), i.e. the sample is classified as positive if T or more concepts (out of M) are true. We discuss the space and time complexity for training and inference separately. Step-wise Breakdown for Training. - **Learning concepts probabilities using a concept learner.** The computational complexity is contingent upon the specific neural network employed. In our analysis, we utilize LSTMs, CNNs, and pre-trained BERT models with fixed weights, ensuring that computations can be performed in polynomial time. - **Loss computation.** We need to compute the probabilistic query P(d ≥ T). This involves iterating over all possible 2M combinations of true concepts ∀ d ≥ T. The probability of each combination is obtained by taking product of concept probabilities. Worst case time complexity: O(M2M) =⇒ **exponential**. We implement the time-efficient O(1) version of this method by caching the combination tensor in memory. In this situation, the memory cost becomes O(M2M). The dimensions of tensor that stores all the combinations is [2M, M]. This is an acceptable trade-off as it enables us to run experiments in reasonable time. Inference. Inference involves a single pass through the concept learner. Since loss does not need to be computed, the inference time is the same for both memory- and time-efficient implementations of ProbChecklist and has the same complexity as the forward propagation of the concept learner. ## Training Details. We trained the time-efficient implementation with memory complexity O(M ∗ 2M) on one NVIDIA A40 GPU with 48GB memory which can fit up to M = 30. Exponential complexity is primary reason for performing feature selection and limiting the modalities to 10 and learning up to 3 features per modality. A fruitful future direction would be to study approximations to explore a smaller set of combinations. ## C Hyperparameter Tuning ProbChecklist framework allows experts to design user-centric checklists. Hyperparameters d ′ k , T and M represent the structure/compactness of the checklist but alone aren't sufficient to garner information about | Training Time (seconds) | Number of concepts | MIP Checklist | ProbChecklist | |-----------------------------|----------------------|-----------------|-----------------| | | ′ | | | | PhysioNet Tabular (d k = 1) | 10 | 667 ± 80.087 | 995.0 ± 35.014 | | | ′ | | | | MNIST (d k = 4) | 16 | 3600 | 2773 ± 22.91 | Table 2: ProbChecklist exhibits exponential complexity. To gauge the impact of this limitation, we provide training times (in seconds) for both MIP Checklist and ProbChecklist. It's crucial to highlight that while MIP Checklist performs effectively with tabular data, successfully uncovering the optimal solution, its performance is poor when applied to MNIST synthetic setup. Even when we set the runtime for Gurobi solver as 1 hour, it struggles to achieve optimal solutions for many cases. On the other hand, ProbChecklist stands out as more reliable, capable of performing end-to-end training and successfully learning the optimal solution. the checklist's performance. Different d ′ k are tried for each modality in an increasing fashion to find the one that performs best. Sensitivity analysis to study the relation between d ′ k and performance (Figure 4a) suggests that the performance saturates after a certain point. This point can be determined experimentally for different modalities. M, total concepts in the checklist, is obtained by pruning concepts that are true for insignificant samples. Our experiments showed that pruning was not required since all the concepts were true for a significant fraction of samples. This indicates the superior quality of the concepts. We try different values of T in the range [M/4, M/2] (total items M) to find the most performant model. However, this hyperparameter tuning doesn;t contribute to the computational cost. For d ′ k , we only only 2-3 values, and use the same value for all the features. Domain experts will be more equipped to choose these values based on their knowledge of the features. For example, if we are recording a time series feature known to stay stable (not fluctuate much), then low d ′ k is sufficient. The value of d ′ k also depends on the number of observations (most blood tests aren't performed hourly, but heart rate and oxygen saturation are monitored continuously). ## D Conciseness Of Checklists Over Decision Trees Decision trees represent another highly interpretable classification method. Compared to checklists, they strike a different balance between expressivity and conciseness. While trees grow exponentially with the number of rules, checklists only grow linearly. Yet, the increased complexity of trees makes them also more expressive. Each decision in a tree only applies to its specific lineage. In contrast, each rule in a checklist applies globally. Despite their lower expressivity, the conciseness of checklists can make them more practical and interpretable than decision trees. ## E Experiment Details In this section we provide additional details about the experiments. ## E.1 Baselines We compare the performance of our method against standard classifiers, including logistic regression (LR) and a classical multilayer perceptron (MLP). For a fair comparison, the process to obtain the M-dimensional concept probabilities is identical for all methods. For the clinical datasets, we also use architectures tailored for learning checklists, namely Unit weighting, SETS checklist, Integer Linear Program (Zhang et al., 2021) with mean thresholds, and MIP from Makhija et al. (2022). These checklist-specific architectures lack the ability to process complex data modalities such as time series data, so we use features mean values for training them. Unit weighting distils a pre-trained logistic regression into a checklist, as also used in Zhang et al. (2021). First, we binarise the data by using the mean feature values as thresholds. By training a simple logistic regression on the continuous data, we can determine the features with negative weights and replace them with their complements. A hyperparameter β to discard features with weights in the range [−*β, β*]. Subsequently, we train logistic regression models on the binarized data by varying T ∈ [0, M] (the checklist threshold) to identify the optimal value of T. SETS checklist (Makhija et al., 2022) is an improvement over Unit Weighting, where mean values are directly utilized for binarization. This method aims to learn feature thresholds (µ) while training a logistic regression in a temperature parameter (τ ) followed by unit weighting to generate the checklist. $$\sigma(\frac{X-\mu}{\tau})\quad\mathrm{where,}\;\;\sigma\;\;\mathrm{sigmoid~function}.$$ $$(7)$$ τ) where, σ sigmoid function. (7) For **Integer Linear Program with Mean Thresholds**, we re-implement the ILP from Zhang et al. (2021) on the mean binarized data and solve the optimization problem using Gurobi. Comparing our method to this baseline provides the most relevant benchmark for evaluation. Mixed Integer Program (Makhija et al., 2022) is a modification of the ILP described above and contains additional constraints to learn thresholds instead of using fixed ones. Again, we re-implement the optimization problem and solve it on Gurobi. BERT/LSTM/CNN + LR employs the concept learners used in ProbChecklist followed by a logistic regression layer on the combination of last layer's embeddings for each modality. Finally, cross-entropy loss is calculated on the predicted class, i.e. P(ˆy = 1). ## E.2 Reasons For Creating Mnist Synthetic Dataset Since there aren't any real-world datasets with a ground truth checklist, we first validate our idea on a synthetic setup where the checklist is known. The key points we examine were the performance of our probabilistic checklist objective compared to standard MLP and LR architectures, the comprehensibility of the concepts learnt, and how well our approach recovers the defined rules. The ideal dataset needed to substantiate our approach comprises different features (or modalities) and a defined rule/condition for each modality to assign the samples a ground truth label. Similar to the structure of a checklist, the sample label depends on how many rules. These points were taken into account while designing the MNIST Synthetic Checklist. ## E.3 Datasets MNIST Checklist Dataset We generate a synthetic dataset from MNIST and define a rule set based on which the instances are classified as 0 or 1. We divide all the images in the MNIST dataset into sequences of K images, and each sequence forms one sample. In the experiments, we set K = 4, which creates a dataset consisting of 10500 samples for training, 4500 for validation, and 2500 for testing. We start by learning M concepts from images directly using K concepts learners, which will later be used for recovering the set checklist. Concept learners would ensure that additional information beyond the labels is also captured. We construct a ground truth checklist using the image labels to simulate a binary classification setup. A sample is assigned y = +1 if T out of K items are true. The final checklist used for experimentation is: - **Ground Truth Checklist (T** = 3, K = 4) □ **Image 1** ∈ {0, 2, 4, 6, 8} □ **Image 2** ∈ {1, 3, 5, 7, 9} □ **Image 3** ∈ {4, 5, 6} □ **Image 4** ∈ {6, 7, 8, 9} The final dataset contains 20.44% positive samples. ## Physionet Sepsis Tabular Dataset We use the PhysioNet 2019 Early Sepsis Prediction time series dataset (Reyna et al., 2019), which was collected from the ICUs of three hospitals. Hourly data of vital signs and laboratory tests are available for the thirty-four non-static features in the dataset. Additionally, four static parameters, gender, duration, age, and anomaly start point, are included. We treat the occurrence of sepsis in patients as the binary outcome variable. The original dataset contains 32,268 patients, with only 8% sepsis patients. We create five subsets with 2200 patients, of which nearly 37% are positive. For this task, we use basic summary extraction functions such as the mean, standard deviation, and last entry of the clinical time series of each patient to tabulate the dataset. We subsequently perform feature selection and only keep the top ten informative features (K = 10) based on logistic regression weights. ## Physionet Sepsis Time Series Data We use the PhysioNet 2019 Early Sepsis Prediction (Reyna et al., 2019) for this task also. The preprocessing steps and formation of subsets are the same as described above. Instead of computing summary statistics from the clinical time series, we train different concept learners to capture the dynamics of the time series. This allows us to encapsulate additional information, such as sudden rise or fall in feature values as concepts. The processed dataset contains 2272 training, 256 validation, 256 testing samples, and 56 time steps for each patient. We fix K = 10, i.e. use the top ten out of thirty-four features based on logistic regression weights. The selected features are {temperature, TroponinI, FiO2, WBC, HCO3, SaO2, Calcium, HR, Fibrinogen, AST}. ## Mimic-Iii Mortality Time Series Data We use the clinical time series data from the MIMIC III Clinical Database (Johnson et al., 2016) to perform mortality prediction on the data collected at the intensive care facilities in Boston. We directly use the famous MIMIC-Extract (Wang et al., 2020) preprocessing and extraction pipeline to transform the raw Electronic Medical Records consisting of vital signs and laboratory records of more than 50,000 into a usable time series format. The processed dataset had a severe class imbalance with respect to the mortality prediction task. We randomly sample from the negative class to increase the percentage to 25% positive patients. Subsequently, we divide the samples into training, validation, and test subsets comprising 6912, 768, and 2048 patients. Like the PhysioNet experiments, we retain the top ten time-series features (K = 10). These features are {heart rate, mean blood pressure, diastolic blood pressure, oxygen saturation, respiratory rate, glucose, blood urea nitrogen, white blood cell count, temperature, creatinine}. To evaluate the proposed fairness regularizer, we introduce the one-hot encodings of two categorical features, gender and ethnicity. Medical Abstracts TC Corpus. We work with the clinical notes dataset designed for multi-class disease classification (Schopf et al., 2023). However, we only focus on neoplasm detection. This subset contains 14438 total samples consisting of 11550 training samples and 2888 testing samples. Out of these, 2530 were positive in training set and 633 were positive in the testing set. To reduce class imbalance of 21.9%, the negative set was subsampled to result in an ratio of positive samples to negative samples of 35%. We use medical abstracts which describe the conditions of patients. Each note is 5-6 sentences long on average. We consider the whole text as one modality (K = 1). ## E.4 Sepsis Prediction Using Static Tabular Data Data. We use the PhysioNet 2019 Early Sepsis Prediction time series dataset (Reyna et al., 2019). We transformed this dataset into tabular data by using basic summary extraction functions such as the mean, standard deviation, and last entry of the clinical time series of each patient. We subsequently perform feature selection and only keep the top ten informative features (K = 10) based on logistic regression weights. Architecture. Since each feature is simply a single-valued function (xi ∈ R), the concept learners are single linear layers followed by a sigmoid activation function. The remaining steps are the same as the previous task, i.e. these concept probabilities are then passed to the probabilistic logic module for P(d > T) computation and loss backpropagation. Baselines. We use standard baselines like MLP and LR, along with checklist-specific architectures, namely Unit weighting, SETS checklist, Integer Linear Program (Zhang et al., 2021) with mean thresholds, MIP from Makhija et al. (2022). Unit weighting distils a pre-trained logistic regression into a checklist, as also used in Zhang et al. (2021). SETS checklist (Makhija et al., 2022) consists of a modified logistic regression incorporating a temperature parameter to learn feature thresholds for binarization, this is followed by unit weighting. Results. We present the results of ProbChecklist and baselines in Table 3. Our performance is slightly lower than the MIP baseline. The highest accuracy is achieved by an MLP, but that comes at the cost of lower interpretability. | Model | Accuracy | Precision | Recall | Specificity | M | T | |---------------------|----------------|----------------|----------------|------------------|------------|-------------| | Dummy Classifier | 37.226 | 0.372 | 1 | 0.628 | - | - | | MLP Classifier | 64.962 ± 2.586 | 0.5726 ± 0.046 | 0.483 ± 0.074 | 0.76043 ± 0.0562 | - | - | | Logistic Regression | 62.555 ± 1.648 | 0.624 ± 0.0461 | 0.144 ± 0.0393 | 0.9395 ± 0.0283 | - | - | | Unit Weighting | 58.278 ± 3.580 | 0.521 ± 0.093 | 0.4386 ± 0.297 | 0.6861 ± 0.251 | 9.6 ± 0.8 | 3.2 ± 1.16 | | SETS Checklist | 56.475 ± 7.876 | 0.517 ± 0.106 | 0.6639 ± 0.304 | 0.494 ± 0.3195 | 10 ± 0 | 6 ± 0.632 | | ILP mean thresholds | 62.992 ± 0.82 | 0.544 ± 0.087 | 0.1196 ± 0.096 | 0.9326 ± 0.0623 | 4.4 ± 1.01 | 2.8 ± 0.748 | | MIP | 63.688 ± 2.437 | 0.563 ± 0.050 | 0.403 ± 0.082 | 0.7918 ± 0.06 | 8 ± 1.095 | 3.6 ± 0.8 | | Concepts + LR | 61.168 ± 1.45 | 0.565 ± 0.059 | 0.324± 0.15 | 0.805 ± 0.1 | - | - | | ProbChecklist | 62.579 ± 2.58 | 0.61 ± 0.076 | 0.345 ± 0.316 | 0.815 ± 0.185S | 10 | 3.6 ± 1.2 | Table 3: Performance results for Sepsis Prediction task using Tabular Data. ## E.5 Sepsis Prediction Using Time Series Data Instead of computing summary statistics from the clinical time series, we train different concept learners to capture the dynamics of the time series. This encapsulates additional information, such as sudden rise or fall in feature values as concepts. Like the setup for tabular dataset, we fix K = 10, i.e. use the top ten features based on logistic regression weights. | Model | Accuracy | Precision | Recall | Specificity | d ′ k | M | T | |--------------------------|----------------|----------------|----------------|----------------|-------------|-------------|-----| | Logistic Regression | 60.627 ± 1.379 | 0.4887 ± 0.106 | 0.1843 ± 0.073 | 0.8792 ± 0.048 | 1 | - | - | | Unit Weighting | 60.532 ± 1.567 | 0.4884 ± 0.087 | 0.1882 ± 0.102 | 0.8745 ± 0.066 | 5 ± 0.63 | 9.2 ± 0.748 | | | ILP mean thresholds | 62.481 ± 0.426 | 0.529 ± 0.242 | 0.0529 ± 0.051 | 0.964 ± 0.031 | 3.4 ± 1.496 | 3.6 ± 1.85 | | | MIP Checklist | 60.767 ± 1.022 | 0.5117 ± 0.055 | 0.142 ± 0.05 | 0.912 ± 0.036 | 3.5 ± 0.866 | 6.5 ± 1.5 | | | CNN + MLP | 63.465 ± 2.048 | 0.585 ± 0.05 | 0.234 ± 0.071 | 0.895 ± 0.021 | - | - | | | CNN + MLP (all features) | 67.19 ± 0.32 | 0.526 ± 0.065 | 0.281 ± 0.041 | 0.835 ± 0.033 | - | - | | | ProbChecklist | 63.671 ± 1.832 | 0.609 ± 0.115 | 0.354 ± 0.157 | 0.823 ± 0.108 | 3 | 4.4 ± 1.356 | 30 | We define K CNNs with two convolutional layers which accept one-dimensional signals as the concept learners for this task. We summarise the results for this task in Table 4. We find that ProbChecklist improves upon the baselines herein as well. Table 4: Performance results for Sepsis Prediction task using Tabular Data. ## E.6 Sensitivity Analysis We study the sensitivity of our approach to the number of learnable concepts. In particular, we compare the performance of ProbChecklistwith increasing number of learnt concepts (d ′ k ). The observed trend for both MNIST (Table 5) and PhysioNet (Table 8) datasets exhibited similarities. We noted a significant improvement in accuracy, precision, and recall when d ′ k increased from 1 to 2, suggesting that the samples contain complex features that a single concept cannot represent. Once all the valuable information is captured, accuracy reaches a saturation point and the performance plateaus with d ′ k . | d ′ k | Evaluation | Accuracy | Precision | Recall | Specificity | T | M | |-----------|--------------|----------------|---------------|---------------|---------------|------------|-----| | 1 | Model | 86.04 ± 0.463 | 0.814 ± 0.027 | 0.412 ± 0.021 | 0.976 ± 0.004 | 3 | 4 | | Checklist | | 72.63 ± 1.42 | 0.427 ± 0.013 | 0.979 ± 0.005 | 0.661 ± 0.018 | | | | 2 | Model | 96.888 ± 0.064 | 0.925 ± 0.008 | 0.922 ± 0.012 | 0.981 ± 0.003 | 5 | 8 | | Checklist | | 92.768 ± 1.6 | 0.752 ± 0.045 | 0.97 ± 0.006 | 0.917 ± 0.02 | | | | 3 | Model | 97.064 ± 0.187 | 0.94 ± 0.008 | 0.915 ± 0.013 | 0.985 ± 0.002 | 7 | 12 | | Checklist | | 96.52 ± 0.33 | 0.9 ± 0.009 | 0.933 ± 0.008 | 0.973 ± 0.002 | | | | 4 | Model | 97.04 ± 0.177 | 0.937 ± 0.005 | 0.917 ± 0.006 | 0.984 ± 0.001 | 8.4 ± 1.2 | 16 | | Checklist | | 96.808 ± 0.24 | 0.917 ± 0.015 | 0.929 ± 0.01 | 0.978 ± 0.004 | | | | 5 | Model | 97.032 ± 0.135 | 0.943 ± 0.005 | 0.91 ± 0.01 | 0.986 ± 0.001 | 9.4 ± 1.36 | 20 | | Checklist | | 96.68 ± 0.269 | 0.918 ± 0.013 | 0.92 ± 0.009 | 0.979 ± 0.004 | | | Table 5: Performance of ProbChecklist with varying d ′ k on MNIST Checklist Dataset ## E.7 Checklist Optimization The checklist generation step from the learnt concepts allows users to tune between sensitivity-specificity depending on the application. The optimal checklist can be obtained by varying the threshold (τ ) used to binarize the learnt concepts (ci[j] = I[pi[j] > τ ]) to optimize the desired metric (Accuracy, F1-Score, AUC-ROC) on the validation data. In Tables 7 and 6, we compare the performance of the checklist obtained by varying the optimization metric. | Loss | Checklist Optimization | Accuracy | Precision | Recall | Specificity | T | M | |-----------|--------------------------|------------|-------------|-----------|---------------|-----|-----| | BCE | Accuracy | 76.4±0.6 | 0.61±0.03 | 0.22±0.09 | 0.95±0.02 | - | - | | Checklist | 76.61±0.52 | 0.59±0.05 | 0.24±0.06 | 0.94±0.02 | 6.6±1.74 | 20 | | | BCE | F1-Score | 67.7±3.04 | 0.41±0.03 | 0.62±0.1 | 0.7±0.07 | - | - | | Checklist | 71.45±1.66 | 0.45±0.02 | 0.58±0.04 | 0.76±0.04 | 7.4±1.36 | 20 | | | Checklist | AUC-ROC | 34.49±4.18 | 0.27±0.01 | 0.98±0.01 | 0.13±0.06 | 4±0 | 20 | In the case of the MIMIC mortality prediction task, we also train our models using Binary Cross Entropy (BCE) loss and optimize over the threshold used to binarize the prediction probabilities. Next, we perform a pairwise comparison between the binary cross-entropy loss and ProbChecklist loss for each optimization metric. From the results in Table 6, it is evident that our method achieves superior performance in terms of accuracy for both metrics. Table 6: Results for different Checklist Optimization methods (Accuracy, F1-Score, AUC-ROC) on the MIMIC Mortality Prediction Task for d ′ k = 2. We report results for the same architecture trained using Binary Cross Entropy (BCE) loss (instead of the proposed ProbChecklist loss) for a fair comparison. For the PhysioNet Sepsis Prediction Task, we analyze a different aspect of our method. We study the difference in performance by changing the number of learnt concepts per modality (d ′ k ) for all the metrics. ## E.8 Impact Of The Binarization Scheme In Tables 8 and 5 we show the difference in performance between two types of evaluation schemes. The first scheme is the typical checklist, obtained by binarizing the concept probabilities and thresholding the total number of positive concepts at T. The second is the direct model evaluation, using the non-binarized output probability. It involves only thresholding P(d > T) to obtain predictions. As expected, the performance of the checklist is slightly lower than the direct model evaluation because concept weights are binarized leading to a more coarse-grained evaluation. | d ′ k | Checklist Optimization | Accuracy | Precision | Recall | Specificity | T | M | |----------|--------------------------|------------|-------------|-----------|---------------|----------|-----| | Accuracy | 62.5±1.5 | 0.67±0.18 | 0.21±0.13 | 0.9±0.1 | 4±0.89 | | | | 1 | F1-Score | 49.22±9.74 | 0.44±0.06 | 0.85±0.11 | 0.27±0.22 | 3.8±0.98 | 10 | | AUC-ROC | 40.72±3.72 | 0.39±0.01 | 0.93±0.12 | 0.08±0.13 | 4±1.22 | | | | Accuracy | 62.97±3.36 | 0.58±0.06 | 0.34±0.18 | 0.82±0.15 | 3±1.1 | | | | 2 | F1-Score | 38.98±1.9 | 0.39±0.02 | 0.98±0.02 | 0.01±0.01 | 2.6±0.8 | 20 | | AUC-ROC | 48.34±10.56 | 0.29±0.17 | 0.54±0.41 | 0.43±0.43 | 3.75±1.09 | | | | d ′ k | Evaluation | Accuracy | Precision | Recall | Specificity | T | M | |-----------|----------------|----------------|---------------|---------------|---------------|-------------|-----| | 1 | Model | 64.105 ± 1.69 | 0.586 ± 0.047 | 0.309 ± 0.025 | 0.857 ± 0.018 | 3 ± 0.89 | 10 | | Checklist | 63.716 ± 3.02 | 0.613 ± 0.12 | 0.233 ± 0.035 | 0.9 ± 0.036 | | | | | 2 | Model | 62.656 ± 2.377 | 0.525 ± 0.025 | 0.565 ± 0.032 | 0.667 ± 0.027 | 3 ± 1.095 | 20 | | Checklist | 62.969 ± 3.355 | 0.582 ± 0.061 | 0.343 ± 0.176 | 0.817 ± 0.145 | | | | | 3 | Model | 60.781 ± 2.09 | 0.503 ± 0.019 | 0.545 ± 0.026 | 0.648 ± 0.019 | 4.4 ± 1.356 | 30 | | Checklist | 63.671 ± 1.832 | 0.609 ± 0.115 | 0.354 ± 0.157 | 0.823 ± 0.108 | | | | Table 7: Results for different Checklist Optimization methods (Accuracy, F1-Score, AUC-ROC) on the PhysioNet Sepsis Prediction Task using timeseries. We report results for different values of d ′ k . Table 8: Evaluation of the binarization scheme for sepsis prediction task using time series data. ## F Concepts Interpretation F.1 Tangos Regularization This section provides a detailed analysis of the learnt concepts using TANGOS regularization outlined in Section 4.3. TANGOS regularization assists in quantifying the contribution of each input dimension to a particular concept. We examine the gradient of each concept obtained from the concept extractors with respect to the input signal. The TANGOS loss consists of two components: The first component enforces sparsity, emphasizing a concentrated subset of the input vector for each concept. The second component promotes uniqueness, minimizing the overlap between the input subsets from which each concept is derived. Sparsity is achieved by taking the L1-norm of the concept gradient attributions with respect to the input vector. To promote decorrelation of signal learned in each concept, the loss is augmented by incorporating the inner product of the gradient attributions for all pairs of concepts. The degree of interpretability of the concepts can be varied by changing the regularization weights in the TANGOS loss equation 8. For a stronger regularization scheme (i.e. higher regularization weights), the gradient attributions are disentangled and sparse. $$\mathcal{L}_{TANGOS}=\lambda_{upvertising}\mathcal{L}_{operity}+\lambda_{correlation}\mathcal{L}_{correlation}$$ $$=\frac{\lambda_{upverity}}{N}\sum_{n=1}^{N}\frac{1}{4}\sum_{k_{j}}^{d_{i}}||\frac{\partial p_{j}(x)}{\partial x_{i}}||_{1}$$ $$+\frac{\lambda_{correlation}}{N}\sum_{n=1}^{N}\frac{1}{4}\mathcal{L}_{C_{2}}\sum_{j=2}^{d_{i}}\sum_{l=1}^{d_{i}-1}\frac{(a^{j}(x_{i}),a^{l}(x_{i}))}{||a^{j}(x_{i})||_{2},||a^{l}(x_{i})||_{2}}\tag{1}$$ where, $a^{j}(x_{i})=\frac{\partial p_{j}(x)}{\partial x_{i}}$ represents the attribution of $j^{th}$ concept with respect to the $i^{th}$ patient $(x_{i})$. $$(8)$$ $$\mathbf{\Pi}(9)$$ $$\left(10\right)$$ To supplement convergence and enhance the stability of our models, we resort to annealing techniques to gradually increase the weights of these regularization terms. ## F.2 Discussion On The Interpretability Of Learnt Concepts Identifying patterns from the binarized concepts is largely based on visual inspection. To aid our analysis, we use gradient attribution of the concepts with respect to the input to identify parts that contribute to each concept. We discuss the interpretability of the concepts for each modality separately: - **Continuous Tabular Dataset (PhysioNet Sepsis Tabular):** Our method works effectively on continuous tabular data where we know what each attribute represents. ProbChecklist learns the thresholds to binarize these continuous features to give the concepts. These concepts are inherently interpretable. All existing methods are designed to operate on continuous or categorical tabular datasets only. As such, our method is already novel. Nevertheless, we investigated the ability of our architecture to handle more complex data modalities. - **Image and Time Series Tasks (MNIST/MIMIC):** Our initial results highlighted that the gradient attributions for the different concepts learned from one modality were very similar (plots in Section F.3). Pixel intensities alone are insufficient for automatically interpreting the concepts, giving rise to the need for visual inspection by domain experts. Therefore, we opted to visualize the gradient attributions of the concepts concerning the input. These plots aid domain experts in extracting patterns and recognizing the learned concepts.TANGOS enforces sparsity and decorrelation among concepts, thereby specializing them to specific input regions and preventing redundancy. While this represents one notion of interpretability, different applications may benefit from alternate definitions suited to their needs. One significant benefit of our approach is its adaptability to incorporate various other interpretability methods, enhancing its flexibility. - **NLP Tasks (Medical Abstract Classification):** Compared to images and time series, interpreting concepts learned from textual data is easier because its building blocks are tokens which are already human understandable. In this setup, instead of employing TANGOS regularization, we identified words associated with positive and negative concepts (positive and negative tokens). Each concept is defined by the presence of positive words and the absence of negative words. The resulting checklist is visualized in Figure 1. We have edited the main paper to include more details about this. ## F.3 Mnist Images We consider the experimental setup where each encoder learns two concepts per image. Figure 8 shows the gradient attribution heatmaps of Image 2 of the MNIST Dataset with respect to both concepts for four cases. The ground truth concept for this image is **Image 2** ∈ {1, 3, 5, 7, 9}. We observe that there is a significant overlap among the gradient attributions when no regularisation terms were used (λ*sparsity* = 0 and λ*correlation* = 0), indicating redundancy in the learnt concepts (almost identical representations). However, it manages to identify odd digits correctly and performs well. For λ*sparsity* = 10 and λ*correlation* = 1, the concepts correspond to simple features like curvatures and straight lines and are easy to identify. We infer from the gradient heat maps that concepts 1 and 2 focus on the image's upper half and centre region, respectively. Concept 1 is true for digits 5, 8, 9 and 7, indicating that it corresponds to a horizontal line or slight curvature in the upper half. Since Digits 0 and 2 have deeper curvature than the other images, and there is no activity in that region in the case of 4, concept 1 is false for them. concept 2 is true for images with a vertical line, including digits 9, 4, 5 and 7. Therefore, concept 2 is false for the remaining digits (0, 2, 8). Table 9 highlights the tradeoff between interpretability of the concepts and the checklist performance. By increasing regularization weights, even though checklist accuracy decreases, the gradient attributions ![24_image_0.png](24_image_0.png) Figure 8: We plot images and corresponding gradient attributions heat maps for seven input samples of the Image 2 modality of the MNIST dataset for different combinations of sparsity and correlation regularization terms. We used a checklist with two learnable concepts per image. The intensity of red denotes the positive contribution of each pixel, whereas blue indicates the negative. If a concept is predicted as true for an image, then we represent that with a plus (+) sign and a negative (-) otherwise. disentangle and become sparse. Based on our experiments, the checklist performance is more sensitive to the sparsity weight (i.e. decreases more sharply). We extend this analysis to the setting with four learnable concepts d ′ k = 4. Figure 9 (λ*sparsity* = 10 and λ*correlation* = 1) shows that each concept is focusing on different regions of the image. At least three concepts out of four are true for odd digits, whereas not more than one sample is true for negative samples. This attests to the ability of the method to learn underlying concepts correctly. | d ′ k | λsparsity | λcorrelation | Accuracy | Precision | Recall | Specificity | |---------|-------------|----------------|------------|-------------|----------|---------------| | 2 | 0 | 0 | 95.48 | 0.829 | 0.981 | 0.948 | | 1 | 0.01 | 93.40 | 0.761 | 0.988 | 0.920 | | | 0.01 | 1 | 92.88 | 0.745 | 0.990 | 0.913 | | | 10 | 1 | 79.28 | 0.485 | 0.978 | 0.733 | | | 4 | 0 | 0 | 97.20 | 0.933 | 0.930 | 0.983 | | 1 | 0.01 | 97.04 | 0.901 | 0.961 | 0.973 | | | 0.01 | 1 | 96.96 | 0.904 | 0.953 | 0.974 | | | 10 | 1 | 78.88 | 0.491 | 0.844 | 0.775 | | Table 9: Performance of ProbChecklist for different combinations of sparsity (λ*sparsity*) and correlation (λ*correlation*) regularization weights on MNIST Checklist Dataset ## F.4 Mimic Time Series For this analysis, we again fix our training setting to d ′ k = 2. Sudden changes in slope in the clinical features were associated with switching of the sign gradient attributes. In Figure 10, we plot the time series for heart rate and corresponding gradient attributions for the first concept learnt by CNN. Maximum activity is ![25_image_0.png](25_image_0.png) Figure 9: We plot images and corresponding gradient attributions heat maps for seven input samples of the ![25_image_1.png](25_image_1.png) Image 2 modality of the MNIST dataset for λ*sparsity* = 10 and λ*correlation* = 1. We used a checklist with four learnable concepts per image. The intensity of red denotes the positive contribution of each pixel, whereas blue indicates the negative. If a concept is predicted as true for an image, then we represent that with a plus (+) sign and a negative (-) otherwise. Figure 10: We plot time series for Heart Rate and corresponding gradient attributions for nine patients at λ*sparsity* = 0.1 and λ*correlation* = 10. The intensity of red denotes the positive contribution of that time step, whereas blue indicates the negative. The border colour of each sample encodes the ground-truth label, with pink being the positive outcome (i.e. mortality). observed between time steps 12 to 17 for all the patients. If a positive peak (or global maxima) is observed in this period (patients 3, 6, 7, 8), then the gradient at all other time steps has a positive contribution. Another interesting observation is that if the nature of the curve is decreasing and the significant portion has negative values (Images 2, 5, 6), then the surrounding gradient attributions have a negative impact. These features are consistent irrespective of the patient outcome. From Figure 11, we infer that gradient attributions for both the concepts are identical. In the absence of regularization terms, it was very hard to explain the concepts that were being learnt. Even though interpretability comes at the cost of performance, it helped in mapping learnt concepts to archetypal signals and patterns in the timeseries. Sudden changes in slope in the clinical features were associated with switching of the sign gradient attributes. ![26_image_0.png](26_image_0.png) ![26_image_1.png](26_image_1.png) Figure 11: We plot time series for Diastolic Blood Pressure and corresponding gradient attributions for for both concepts for different combinations of regularization weights. The intensity of red denotes the positive contribution of that time step, whereas blue indicates the negative. The border colour of each sample encodes the ground-truth label, with pink being the positive outcome (i.e. mortality). If a concept is predicted as true for a patient, then we represent that with a plus (+) sign and a negative (-) otherwise. With the help of Figure 12, we infer the concepts being learnt when the regularization weights are λ*sparsity* = 0.1 and λ*correlation* = 10. The region between time steps 11 to 16 is activated for Heart Rate. The learnt concept is negative when there is a sudden increase (peak) in the values around this region as observed in Patients 4, 5, 6, 7. This concept is true when there is slight fluctuation, or the values are steady around the high gradient region, as seen in the remaining patients. For White Blood Cell Count, our model learns two distinct concepts. The neuron gradient attributions for the first concept are high for time steps 3 to 8. This concept is positive when a local maxima is observed (an increase from the starting value and then a decrease). This pattern is visible in Patients 2, 5. In all the other cases, a local minima is observed first. ## F.5 Medical Abstracts Corpus Since we only work with text data, we assumed that the concepts learnt are functions of tokens in the text. To obtain interpretable summaries of the concept, we train decision trees on token occurrence and use the concept predictions as labels. We then represent each concept by the list of tokens used in the five first layers of each decision tree. We prune this representation by only keeping the unique tokens for each concept. ## G Additional Fairness Results Additionally, we provide FNR and FPR values for each subgroup both before and after applying regularization (Table 10). This is done to ensure that the error rates of majority subgroups, where the performance was originally strong, do not increase. Notably, most minority subgroups benefit from this regularization; however, FNR increases for both the Female (minority) and Male (majority) subgroups after regularization. ## H Extension Of Probchecklist: Checklists With Learnable Integer Weights Checklist structure considers the weight of each item on the checklist as +1. In this section, we propose an extension to allow for integer weights larger than 1 because it has many useful applications and may be of interest to users. Before we formulate a method to learn integer weights for each concept, it is important to note that this would make it harder to interpret the checklist. More specifically, the meaning of the checklist ![27_image_0.png](27_image_0.png) Figure 12: We plot time series for Heart Rate and White Blood Cell Count and corresponding gradient attributions for eight patients for λ*sparsity* = 0.1 and λ*correlation* = 10. The intensity of red denotes the positive contribution of that time step, whereas blue indicates the negative. The border colour of each sample encodes the ground-truth label, with pink being the positive outcome (i.e. mortality). If a concept is predicted as true for a patient, then we represent that with a plus (+) sign and a negative (-) otherwise. | Subgroup | Before/After FR | FPR | FNR | |------------|-------------------|--------|--------| | Female | Before | 0.719 | 0.0989 | | | After | 0.1899 | 0.6975 | | Male | Before | 0.4969 | 0.2931 | | | After | 0.127 | 0.851 | | White | Before | 0.782 | 0.937 | | | After | 0.072 | 0.0868 | | Black | Before | 0.661 | 0.824 | | | After | 0.0563 | 0.0597 | | Others | Before | 0.724 | 0.913 | | | After | 0.064 | 0.0805 | Table 10: We provide the actual values of FNR and FPR for each subgroup before and after fairness regularization is applied. threshold used for classification of samples would now change. Previously, it represented the minimum number of true concepts for a positive classification. Now it signifies a score - the minimum value of the weighted sum of concept probabilities for a positive classification. Given K data modalities as the input for sample i, we train K concept learners to obtain the vector of probabilistic concepts of each modality p k i ∈ [0, 1]d ′ k . Next, we concatenate the full concepts probabilities (pi) for sample i. At this point, we can introduce a trainable weight vector W ∈ [0, 1]d ′(with Pd ′ i=1 wi = 1) of the same dimension as pi (concept probabilities) which will capture the relative importance of the features. | Accuracy | Recall | Precision | | |------------------------------|----------|-------------|-------| | Without Fairness Regularizer | 75.99 | 0.117 | 0.648 | | With Fairness Regularizer | 72.412 | 0.256 | 0.553 | Table 11: We present accuracy, precision, and recall metrics to compare the model's performance before and after applying fairness regularization. Despite observing a decrease in accuracy, the increase in recall signifies a positive development. Element-wise product (⊙) of pi and W represents the weighted concept probabilities and can be denoted with ![28_image_0.png](28_image_0.png) W pi. This vector can be normalized by dividing each element with the maximum entry (L0 norm). While training it i For training the concept learners, we pass W pi through the probabilistic logic module. After training, the integer weights corresponding to each concept in the checklist can be obtained by converting the W to a percentage: Wint. At inference time, we discretize Ci to construct a complete predictive checklist. Next, compute the score WT intCi and compare it against the checklist threshold, M, to classify the sample. Figure 13: Checklists with learnable integer weights ## I Plot: Performance Results Of Probchecklist J Implementation The code for all the experiments and instructions to reproduce the results are available at https://anonymous. 4open.science/r/ProbChecklist-322A/. We have extensively used the PyTorch(Paszke et al., 2019) library in our implementations and would like to thank the authors and developers. ## K Checklists Of Decision Trees K.1 Trees As Logical Decision Rules We denote the depth of the tree with L (> 0) and the layers of the tree with l ∈ 1*, . . . , L*. We assume a balanced binary tree structure of depth L containing 2 l−1 nodes in layer l. The last layer contains leaf nodes that hold the model predictions. The remaining nodes represent M binary partitioning rules, where M =PL−1 l=1 2 l−1 = 2L−1 − 1. We index nodes with (*j, l*) where j ∈ 1*, . . . ,* 2 l−1represents the index of the ![29_image_0.png](29_image_0.png) Figure 14: We plot the performance results reported in Table 1. node in layer l ∈ 1, . . , L − 1. Each node takes an input vector x; and outputs a boolean c(j.1) = 1j.)(x;), We illustrate the structure of the tree in Figure 6. Each path of the decision tree results in a logical rule whose outcome is embedded in the value of it's leaf node. Hence, we can filter out the path which lead to a positive outcome and construct the following logical rule F, for L = 4: $$F(\hat{y_{i}}=1):=(\neg c_{i}^{(1,1)}\wedge\neg c_{i}^{(2,1)}\wedge c_{i}^{(3,2)})\vee(\neg c_{i}^{(1,1)}\wedge c_{i}^{(2,1)}\wedge c_{i}^{(3,4)})\vee(c_{i}^{(1,1)}\wedge\neg c_{i}^{(2,2)}\wedge c_{i}^{(3,6)})\vee(c_{i}^{(1,1)}\wedge c_{i}^{(2,2)}\wedge c_{i}^{(3,8)})\tag{11}$$ When relaxing c.2011 to be a probability between 0 and 1, we can compute the probability of positive label as $$P_{\rm Pr}=P((-c_{i}^{(1,1)})(P(-c_{i}^{(2,1)})P(c_{i}^{(3,2)})+P(c_{i}^{(2,1)})P(c_{i}^{(3,4)}))+P((c_{i}^{(1,1)})(P(-c_{i}^{(2,2)})P(c_{i}^{(3,6)})+P(c_{i}^{(2,2)})P(c_{i}^{(3,8)}))).\tag{12}$$ The node partition rules in the tree can then be learned using soft concept extractors as in Section 4 with the loss: £ = y; log(Po (ji; = 1)) + (1 − y;) log(Pog(y; = 0)). In our experiments, we used M soft concept extractors of the form V(x) = o(B2 x), with 3 a learnable vector with same dimension than x, and o(-) the sigmoid function. We note that although we used simple concept extractors in our experiments, they can be chosen to be arbitrarily complex. For instance, one could use a convolutional neural network on top of images or transformers on top of text, which would produce complex decision rules. This is in contrast with classical decision tress that can only apply to the original representation of the data (e.g., a classical decision tree on an image would result in pixel-wise rules, which are likely ineffective). ## K.2 Learning Balanced Trees The simplest training strategy for training decision trees described above does not enforce any regularization on the produced tree, aside from the number of layers. Yet, certain tree characteristics are desirable when it comes to interpretability and diversity. In particular, balanced trees are favored for their ability to provide a faithful representation of data, fostering diversity in the learned concepts. This characteristic enhances interpretability of the concepts. We propose three regularization terms designed to facilitate the learning of balanced trees. These terms are grounded in the simple intuition that balanced trees contain distinct concepts at each node and these concepts split the samples evenly, thereby maximizing entropy. Let n (l,j) denote the number of data points that are evaluated at j th node in the layer l with N =P2 l−1 j=0 n (l,j). Depending on the number of samples for which concepts c (l,j) iis true, these n (l,j) points will split into two groups containing n (l+1,j′) and n (l+1,j′′)samples. The probabilities of the branches emerging from the split at node c (l,j)is the fraction of samples which are classified positive and negative. P r[c (l,j) = 1] represents the fraction of samples that are classified as positive at split c (l,j). $$P r[c^{(l,j)}=0]={\frac{n^{(l+1,j^{\prime})}}{n^{(l,j)}}};\quad P r[c^{(l,j)}=1]={\frac{n^{(l+1,j^{\prime\prime})}}{n^{(l,j)}}};\quad\left(n^{(l+1,j^{\prime})}+n^{(l+1,j^{\prime\prime})}=n^{(l,j)}\right)$$ (l,j)) (13) Using these branch probabilities we can define the entropy of the split as $$\mathsf{ENT}(l,j)=\sum_{i\in\{0,1\}}-Pr[c^{(l,j)}=i]\ log(Pr[c^{(l,j)}=i])$$ The first regularization method aims to minimize the difference in entropy between the left and right subtrees generated at each split. This is achieved by computing the sum of entropy differences across all nodes where splits occur, resulting in balanced subtrees. $$\mathcal{L}_{ENT_{Subtree}}=\sum_{l=1}^{L-1}\lVert\mathsf{ENT}(l+1,2l-1)-\mathsf{ENT}(l+1,2l)\rVert_{1}\tag{1}$$ $$(13)$$ $$(14)$$ $$\left(15\right)$$ $$(16)$$ The second regularization term seeks to maximize the entropy of the splits in the penultimate layer of the tree (l = L-2). We sum over the entropies of all the splits in the (L − 2)-th layer and add the negative of this loss function. $$\mathcal{L}_{E N T_{F i n a l S p i t}}=\sum_{j=1}^{2^{L-1}}-\mathsf{E N T}(L-1,j)$$ The third regularization ensures the concepts learn from each modality are unique. To promote decorrelation of signals learned in each concept, the loss is augmented by incorporating the inner product of the concept probabilities for all pairs of concepts. | Model | AUC-ROC | LENT_Subtree | LENT_Final_Split | |---------------------|-----------|----------------|--------------------| | PT ree | 0.880 | 5.502 | -2.755 | | +LENT _Subtree | 0.898 | 4.902 | -2.755 | | +LENT _F inal_Split | 0.891 | 3.673 | -3.673 | | +LCorrelation | 0.933 | 5.306 | -3.648 | Table 12: [Single tree] We report the results of our experiment on learning balanced decision trees using the proposed logical rule and regularization terms (see Appendix K). The first entry in the table corresponds to using only the logical rule, while the subsequent entries include the regularization terms. We observe an improvement in the AUC-ROC score as the tree becomes more balanced with the addition of the regularization terms. The decrease in the entropy-based regularization loss indicates the increased balance in the tree structure. Additionally, we present the learned decision trees in Figure 6 to corroborate these findings.